From 85d32b74e6eb43b0aa43f8635fce34ff83ef63a1 Mon Sep 17 00:00:00 2001 From: Henry Song Date: Thu, 23 Jul 2015 19:38:39 +0530 Subject: [PATCH] Optimization when we know that surface is in transparent black. If the original surface has not been modified or is clear, we can avoid downloading data. Change-Id: If881bae9109a57f061a4e8d956c3eaf3c6691cf1 Signed-off-by: nisanthmp --- src/cairo-gl-surface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cairo-gl-surface.c b/src/cairo-gl-surface.c index 665ab244a..cf0f4e75d 100644 --- a/src/cairo-gl-surface.c +++ b/src/cairo-gl-surface.c @@ -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. -- 2.34.1