[patch] gl: when using a surface as source/mask in drawing operation on GL surface target, we can avoid map_to_image()

"Henry (Yu) Song - SISA" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <3955FA337689574EB32F94B12A7E6E9E0B4FA43F@ex10mail>
commit 99d01460c93ae83c1eea5a221b34d7a990e60528
Author: Henry (Yu) Song <[email protected]>
Date:   Fri Mar 30 07:49:54 2012 -0700

    gl: when using a surface as a source or mask, there is no need to download
    newly created gl surface to an image.  glReadPixels() can be slow.  We
    can avoid that.

diff --git a/src/cairo-gl-operand.c b/src/cairo-gl-operand.c
index ddff5e7..8ce534f 100644
--- a/src/cairo-gl-operand.c
+++ b/src/cairo-gl-operand.c
@@ -261,7 +261,8 @@ _cairo_gl_pattern_texture_setup (cairo_gl_operand_t *operand,
 	_cairo_gl_surface_create_scratch (ctx,
 					  CAIRO_CONTENT_COLOR_ALPHA,
 					  extents->width, extents->height);
-    image = cairo_surface_map_to_image (&surface->base, NULL);
+    image = cairo_image_surface_create (CAIRO_FORMAT_ARGB32,
+					extents->width, extents->height);
 
     /* If the pattern is a GL surface, it belongs to some other GL context,
        so we need to release this device while we paint it to the image. */
--
cairo mailing list
[email protected]
http://lists.cairographics.org/mailman/listinfo/cairo
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.