[patch] gl: skip using mask surface when source pattern is solid

"Henry (Yu) Song - SISA" <[email protected]>
Newsgroups gmane.comp.lib.cairo
Message-ID <3955FA337689574EB32F94B12A7E6E9E246E0B5E@sisaex01sj>
From 80142bc08d1b82a2d5d7f775314a1505a328eaae Mon Sep 17 00:00:00 2001
From: Henry Song <[email protected]>
Date: Tue, 9 Oct 2012 08:17:17 -0700
Subject: [PATCH] gl: We can skit using mask surface if the source pattern is
 opaque during text rendering in gl traps compositor

---
 src/cairo-traps-compositor.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/cairo-traps-compositor.c b/src/cairo-traps-compositor.c
index eeee20c..4548459 100644
--- a/src/cairo-traps-compositor.c
+++ b/src/cairo-traps-compositor.c
@@ -2268,6 +2268,7 @@ _cairo_traps_compositor_glyphs (const cairo_compositor_t	*_compositor,
 				cairo_bool_t			 overlap)
 {
     const cairo_traps_compositor_t *compositor = (cairo_traps_compositor_t *)_compositor;
+    cairo_bool_t glyphs_overlap = overlap;
     cairo_int_status_t status;
 
     TRACE ((stderr, "%s\n", __FUNCTION__));
@@ -2283,11 +2284,15 @@ _cairo_traps_compositor_glyphs (const cairo_compositor_t	*_compositor,
     if (likely (status == CAIRO_INT_STATUS_SUCCESS)) {
 	cairo_composite_glyphs_info_t info;
 	unsigned flags = 0;
+	const cairo_pattern_t *pattern = extents->original_source_pattern;
+
+	if (_cairo_pattern_is_opaque_solid (pattern))
+	   glyphs_overlap = FALSE; 
 
 	info.font = scaled_font;
 	info.glyphs = glyphs;
 	info.num_glyphs = num_glyphs;
-	info.use_mask = overlap || ! extents->is_bounded;
+	info.use_mask = glyphs_overlap || ! extents->is_bounded;
 	info.extents = extents->bounded;
 
 	if (extents->mask.width > extents->bounded.width ||
-- 
1.7.9.5
-- 
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.