summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-27 13:42:37 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-27 13:44:48 +0100
commita6ba93283b20a50ff36758624d2967562b7bdae9 (patch)
tree3dda8d8304f00f89ad660d9e933f2b900f69e397
parentee5c74deee77db4292ce197ab7facca422f86021 (diff)
sna/glyphs: Add DBG option for glyph tolerance
And bump it to 3 so that glyph filtering doesn't force us to use the mask too often. References: https://bugs.freedesktop.org/show_bug.cgi?id=77436 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_glyphs.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 9b9ae102..0bb72d8d 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -83,6 +83,7 @@
#define N_STACK_GLYPHS 512
#define NO_ATLAS ((PicturePtr)-1)
+#define GLYPH_TOLERANCE 3
#define glyph_valid(g) *((uint32_t *)&(g)->info.width)
#define glyph_copy_size(r, g) *(uint32_t *)&(r)->width = *(uint32_t *)&g->info.width
@@ -1517,8 +1518,10 @@ glyphs_format(int nlist, GlyphListPtr list, GlyphPtr * glyphs)
* boundary is small, yet glyphs frequently
* overlap on the boundaries.
*/
- if (x1 < extents.x2-1 && x2 > extents.x1+1 &&
- y1 < extents.y2-1 && y2 > extents.y1+1) {
+ if (x1 < extents.x2-GLYPH_TOLERANCE &&
+ x2 > extents.x1+GLYPH_TOLERANCE &&
+ y1 < extents.y2-GLYPH_TOLERANCE &&
+ y2 > extents.y1+GLYPH_TOLERANCE) {
DBG(("%s: overlapping glyph inside line, current bbox (%d, %d), (%d, %d), glyph (%d, %d), (%d, %d)\n",
__FUNCTION__,
extents.x1, extents.y1, extents.x2, extents.y2,
@@ -1547,10 +1550,10 @@ skip_glyph:
*/
if (!first) {
for (j = 0; j < i; j++) {
- if (extents.x1 < list_extents[j].x2-1 &&
- extents.x2 > list_extents[j].x1+1 &&
- extents.y1 < list_extents[j].y2-1 &&
- extents.y2 > list_extents[j].y1+1) {
+ if (extents.x1 < list_extents[j].x2-GLYPH_TOLERANCE &&
+ extents.x2 > list_extents[j].x1+GLYPH_TOLERANCE &&
+ extents.y1 < list_extents[j].y2-GLYPH_TOLERANCE &&
+ extents.y2 > list_extents[j].y1+GLYPH_TOLERANCE) {
DBG(("%s: overlapping lines, current bbox (%d, %d), (%d, %d), previous line (%d, %d), (%d, %d)\n",
__FUNCTION__,
extents.x1, extents.y1, extents.x2, extents.y2,