]> www.fi.muni.cz Git - evince.git/commitdiff
dvi: Add image_done method to DviDevice to notify that the image is finished
authorCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 8 Nov 2010 18:06:11 +0000 (19:06 +0100)
committerCarlos Garcia Campos <carlosgc@gnome.org>
Mon, 8 Nov 2010 18:06:11 +0000 (19:06 +0100)
This way we can mark the surface dirty when all pixels have been
modified.

backend/dvi/cairo-device.c
backend/dvi/mdvi-lib/bitmap.c
backend/dvi/mdvi-lib/mdvi.h

index 47425cad7e0be21a503a449c8fff618f525c35bb..51aea3790c5fe2d6501db737e759740d87242012 100644 (file)
@@ -259,6 +259,12 @@ dvi_cairo_put_pixel (void *image, int x, int y, Ulong color)
        *p = color;
 }
 
+static void
+dvi_cairo_image_done (void *ptr)
+{
+        cairo_surface_mark_dirty((cairo_surface_t *)ptr);
+}
+
 static void
 dvi_cairo_set_color (void *device_data, Ulong fg, Ulong bg)
 {
@@ -280,6 +286,7 @@ mdvi_cairo_device_init (DviDevice *device)
        device->create_image = dvi_cairo_create_image;
        device->free_image = dvi_cairo_free_image;
        device->put_pixel = dvi_cairo_put_pixel;
+        device->image_done = dvi_cairo_image_done;
        device->set_color = dvi_cairo_set_color;
 #ifdef HAVE_SPECTRE
        device->draw_ps = dvi_cairo_draw_ps;
index 53f21207613f11a8b88515a10b0cc098113b7f63..6edec1dfea2036bb0d8f78800d7a5aad40ab3285 100644 (file)
@@ -1028,6 +1028,8 @@ void      mdvi_shrink_glyph_grey(DviContext *dvi, DviFont *font,
                for(x = 0; x < w; x++)
                        dev->put_pixel(image, x, y, pixels[0]);
        }
+
+        dev->image_done(image);
        DEBUG((DBG_BITMAPS, "shrink_glyph_grey: (%dw,%dh,%dx,%dy) -> (%dw,%dh,%dx,%dy)\n",
                glyph->w, glyph->h, glyph->x, glyph->y,
                dest->w, dest->h, dest->x, dest->y));
index 327e61fe39572b852e0e4cb4131eed439f4940b0..37664a766b1afa56eeff48cb2dcbc49f58b02daa 100644 (file)
@@ -99,6 +99,7 @@ typedef void *(*DviCreateImage)       __PROTO((void *device_data,
                                         Uint bpp));
 typedef void (*DviFreeImage)   __PROTO((void *image));
 typedef void (*DviPutPixel)    __PROTO((void *image, int x, int y, Ulong color));
+typedef void (*DviImageDone)    __PROTO((void *image));
 typedef void (*DviDevDestroy)   __PROTO((void *data));
 typedef void (*DviRefresh)      __PROTO((DviContext *dvi, void *device_data));
 typedef void (*DviSetColor)    __PROTO((void *device_data, Ulong, Ulong));
@@ -114,6 +115,7 @@ struct _DviDevice {
        DviCreateImage  create_image;
        DviFreeImage    free_image;
        DviPutPixel     put_pixel;
+        DviImageDone    image_done;
        DviDevDestroy   dev_destroy;
        DviRefresh      refresh;
        DviSetColor     set_color;