xf86-video-intel: src/sna/sna_glyphs.c

Chris Wilson ickle at kemper.freedesktop.org
Mon Jun 16 02:34:31 PDT 2014


 src/sna/sna_glyphs.c |   17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 10cb36e1ddc6f4bf41941b24d6557343aa595a13
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Mon Jun 16 10:33:07 2014 +0100

    sna/glyphs: Add DBG option to force use of the glyph image mask
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 0835175..1ce7170 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -71,7 +71,7 @@
 #define NO_GLYPH_CACHE 0
 #define NO_GLYPHS_TO_DST 0
 #define NO_GLYPHS_VIA_MASK 0
-#define NO_SMALL_MASK 0
+#define FORCE_SMALL_MASK 0 /* -1 = never, 1 = always */
 #define NO_GLYPHS_SLOW 0
 #define NO_DISCARD_MASK 0
 
@@ -1087,6 +1087,17 @@ sna_glyph_get_image(GlyphPtr g, ScreenPtr s)
 	return image;
 }
 
+static inline bool use_small_mask(struct sna *sna, int16_t width, int16_t height, int depth)
+{
+	if (FORCE_SMALL_MASK)
+		return FORCE_SMALL_MASK > 0;
+
+	if (depth * width * height < 8 * 4096)
+		return true;
+
+	return too_large(sna, width, height);
+}
+
 flatten static bool
 glyphs_via_mask(struct sna *sna,
 		CARD8 op,
@@ -1147,9 +1158,7 @@ glyphs_via_mask(struct sna *sna,
 	}
 
 	component_alpha = NeedsComponent(format->format);
-	if (!NO_SMALL_MASK &&
-	    ((uint32_t)width * height * format->depth < 8 * 4096 ||
-	     too_large(sna, width, height))) {
+	if (use_small_mask(sna, width, height, format->depth)) {
 		pixman_image_t *mask_image;
 
 		DBG(("%s: small mask [format=%lx, depth=%d, size=%d], rendering glyphs to upload buffer\n",


More information about the xorg-commit mailing list