[Spice-devel] [PATCH 22/30] Convert cairo canvas read_bits() to pixman

Alexander Larsson alexl at redhat.com
Thu Feb 18 12:58:48 PST 2010


---
 common/cairo_canvas.c |   11 +++++------
 1 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/common/cairo_canvas.c b/common/cairo_canvas.c
index 0b6f9ff..198785e 100644
--- a/common/cairo_canvas.c
+++ b/common/cairo_canvas.c
@@ -1947,18 +1947,17 @@ void canvas_draw_stroke(CairoCanvas *canvas, SpiceRect *bbox, SpiceClip *clip, S
 
 void canvas_read_bits(CairoCanvas *canvas, uint8_t *dest, int dest_stride, const SpiceRect *area)
 {
-    cairo_t *cairo = canvas->cairo;
-    cairo_surface_t* surface;
+    pixman_image_t* surface;
     uint8_t *src;
     int src_stride;
     uint8_t *dest_end;
 
     ASSERT(canvas && area);
 
-    surface = cairo_get_target(cairo);
-    src_stride = cairo_image_surface_get_stride(surface);
-    src = cairo_image_surface_get_data(surface) + area->top * src_stride +
-                                                  area->left * sizeof(uint32_t);
+    surface = canvas->image;
+    src_stride = pixman_image_get_stride(surface);
+    src = (uint8_t *)pixman_image_get_data(surface) +
+        area->top * src_stride + area->left * sizeof(uint32_t);
     dest_end = dest + (area->bottom - area->top) * dest_stride;
     for (; dest != dest_end; dest += dest_stride, src += src_stride) {
         memcpy(dest, src, dest_stride);
-- 
1.6.6



More information about the Spice-devel mailing list