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

Henry (Yu) Song - SISA hsong at sisa.samsung.com
Tue Oct 9 08:29:29 PDT 2012


>From 80142bc08d1b82a2d5d7f775314a1505a328eaae Mon Sep 17 00:00:00 2001
From: Henry Song <henry.song at samsung.com>
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


More information about the cairo mailing list