[gimp] plug-ins: remove backbuffer from map-object
- From: Mikael Magnusson <mikachu src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] plug-ins: remove backbuffer from map-object
- Date: Sat, 19 Feb 2011 09:45:13 +0000 (UTC)
commit 85474bff18f99f6bbcf02d5955884d591eff26a1
Author: Mikael Magnusson <mikachu src gnome org>
Date: Sun Feb 13 17:49:27 2011 +0100
plug-ins: remove backbuffer from map-object
plug-ins/map-object/map-object-preview.c | 50 ++---------------------------
1 files changed, 4 insertions(+), 46 deletions(-)
---
diff --git a/plug-ins/map-object/map-object-preview.c b/plug-ins/map-object/map-object-preview.c
index b8189cc..92dcad0 100644
--- a/plug-ins/map-object/map-object-preview.c
+++ b/plug-ins/map-object/map-object-preview.c
@@ -17,18 +17,10 @@
#include "map-object-preview.h"
-typedef struct
-{
- gint x, y, w, h;
- cairo_surface_t *image;
-} BackBuffer;
-
gdouble mat[3][4];
gint lightx, lighty;
-static BackBuffer backbuf = { 0, 0, 0, 0, NULL };
-
/* Protos */
/* ====== */
@@ -181,7 +173,7 @@ draw_light_marker (gint xpos,
gint ypos)
{
GdkColor color;
- cairo_t *cr, *cr_p;
+ cairo_t *cr;
gint pw, ph, startx, starty;
if (mapvals.lightsource.type != POINT_LIGHT)
@@ -204,40 +196,6 @@ draw_light_marker (gint xpos,
lightx = xpos;
lighty = ypos;
- /* Save background */
- /* =============== */
-
- backbuf.x = lightx - 7;
- backbuf.y = lighty - 7;
- backbuf.w = 14;
- backbuf.h = 14;
-
- /* X doesn't like images that's outside a window, make sure */
- /* we get the backbuffer image from within the boundaries */
- /* ======================================================== */
-
- if (backbuf.x < startx)
- backbuf.x = startx;
- else if ((backbuf.x + backbuf.w) > startx + pw)
- backbuf.w = MAX(startx + pw - backbuf.x, 0);
- if (backbuf.y < starty)
- backbuf.y = starty;
- else if ((backbuf.y + backbuf.h) > starty + ph)
- backbuf.h = MAX(starty + ph - backbuf.y, 0);
-
- if (backbuf.image)
- cairo_surface_destroy (backbuf.image);
-
- backbuf.image = cairo_surface_create_similar (preview_surface,
- CAIRO_CONTENT_COLOR,
- PREVIEW_WIDTH, PREVIEW_HEIGHT);
- cr_p = cairo_create (backbuf.image);
- cairo_rectangle (cr_p, backbuf.x, backbuf.y, backbuf.w, backbuf.h);
- cairo_clip (cr_p);
- cairo_set_source_surface (cr_p, preview_surface, startx, starty);
- cairo_paint (cr_p);
- cairo_destroy (cr_p);
-
cairo_arc (cr, lightx, lighty, 7, 0, 2 * M_PI);
cairo_fill (cr);
@@ -287,9 +245,9 @@ update_light (gint xpos,
gtk_widget_queue_draw (previewarea);
}
-/******************************************************************/
-/* Draw preview image. if DoCompute is TRUE then recompute image. */
-/******************************************************************/
+/**************************/
+/* Compute preview image. */
+/**************************/
void
compute_preview_image (void)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]