Optimization when we know that surface is in transparent black. 02/45102/2
authorHenry Song <henry.song@samsung.com>
Thu, 23 Jul 2015 14:08:39 +0000 (19:38 +0530)
committernisanthmp <nisanth.mp@samsung.com>
Mon, 3 Aug 2015 13:18:33 +0000 (18:48 +0530)
If the original surface has not been modified or is clear,
we can avoid downloading data.

Change-Id: If881bae9109a57f061a4e8d956c3eaf3c6691cf1
Signed-off-by: nisanthmp <nisanth.mp@samsung.com>
src/cairo-gl-surface.c

index 665ab24..cf0f4e7 100644 (file)
@@ -1583,11 +1583,11 @@ _cairo_gl_surface_map_to_image (void      *abstract_surface,
 
     /* If the original surface has not been modified or
      * is clear, we can avoid downloading data. */
-/*    if (surface->base.is_clear || surface->base.serial == 0) {
+    if (surface->base.is_clear || surface->base.serial == 0) {
        status = _cairo_gl_context_release (ctx, status);
        return image;
     }
-*/
+
     /* This is inefficient, as we'd rather just read the thing without making
      * it the destination.  But then, this is the fallback path, so let's not
      * fall back instead.