summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-04 22:14:05 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-04 22:14:05 +0000
commit93193aaf7d0fc4e3a3b9be1632bfd36331b47d2e (patch)
treedbd81a51bdfc6824e564f088be4fe05e928a4c69
parenta0d1de962a8107cfcaefd82eb8ffaf3e4da0e130 (diff)
test
-rw-r--r--src/sna/sna_glyphs.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c
index 5830d9ba..f2c17885 100644
--- a/src/sna/sna_glyphs.c
+++ b/src/sna/sna_glyphs.c
@@ -519,21 +519,8 @@ static void apply_damage_clipped_to_dst(struct sna_composite_op *op,
static inline bool clipped_glyphs(PicturePtr dst, int nlist, GlyphListPtr list, GlyphPtr *glyphs)
{
- PixmapPtr pixmap;
BoxRec box;
- if (dst->pCompositeClip->data) {
- DBG(("%s: yes, has complex region\n", __FUNCTION__));
- return true;
- }
-
- pixmap = get_drawable_pixmap(dst->pDrawable);
- if (dst->pCompositeClip->extents.x2 - dst->pCompositeClip->extents.x1 >= pixmap->drawable.width &&
- dst->pCompositeClip->extents.y2 - dst->pCompositeClip->extents.y1 >= pixmap->drawable.height) {
- DBG(("%s: no, region matches drawable\n", __FUNCTION__));
- return false;
- }
-
glyph_extents(nlist, list, glyphs, &box);
DBG(("%s? glyph extents (%d, %d), (%d, %d), region (%d, %d), (%d, %d): %s\n",
__FUNCTION__, box.x1, box.y1, box.x2, box.y2,
@@ -542,10 +529,9 @@ static inline bool clipped_glyphs(PicturePtr dst, int nlist, GlyphListPtr list,
box.y1 < dst->pCompositeClip->extents.y1 ||
box.x2 > dst->pCompositeClip->extents.x2 ||
box.y2 > dst->pCompositeClip->extents.y2) ? "yes" : "no"));
- return (box.x1 < dst->pCompositeClip->extents.x1 ||
- box.y1 < dst->pCompositeClip->extents.y1 ||
- box.x2 > dst->pCompositeClip->extents.x2 ||
- box.y2 > dst->pCompositeClip->extents.y2);
+
+ return pixman_region_contains_rectangle(dst->pCompositeClip,
+ &box) != PIXMAN_REGION_IN;
}
flatten static bool