diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-07 20:07:37 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-07 20:10:27 +0000 |
commit | b1234f3d3a27f326b8048e3d6b476021a26e9101 (patch) | |
tree | c9d4847a5a0a1061bd793d77e43b74ae523fd6f3 /src | |
parent | afdf931e61821985b31b339d1f346ddd7c4e9e3c (diff) |
sna: Expand multiplies of two 16-bit values to a full 32-bit range
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_glyphs.c | 27 | ||||
-rw-r--r-- | src/sna/sna_render_inline.h | 2 |
2 files changed, 16 insertions, 13 deletions
diff --git a/src/sna/sna_glyphs.c b/src/sna/sna_glyphs.c index a9dbed7c..acec1116 100644 --- a/src/sna/sna_glyphs.c +++ b/src/sna/sna_glyphs.c @@ -723,7 +723,7 @@ glyphs_via_mask(struct sna *sna, } component_alpha = NeedsComponent(format->format); - if (width * height * format->depth < 8 * 256) { + if ((uint32_t)width * height * format->depth < 8 * 256) { pixman_image_t *mask_image; int s; @@ -1137,27 +1137,30 @@ glyphs_fallback(CARD8 op, g->info.width, g->info.height); } else { - DBG(("%s: glyph+(%d, %d) to dst (%d, %d)x(%d, %d)\n", + int xi = x - g->info.x; + int yi = y - g->info.y; + + DBG(("%s: glyph+(%d, %d) to dst (%d, %d)x(%d, %d), src (%d, %d) [op=%d]\n", __FUNCTION__, dx, dy, - x - g->info.x, - y - g->info.y, - g->info.width, - g->info.height)); + xi, yi, + g->info.width, g->info.height, + src_x + xi, + src_y + yi, + op)); pixman_image_composite(op, src_image, glyph_image, dst_image, - src_x + (x - g->info.x), - src_y + (y - g->info.y), + src_x + xi, + src_y + yi, dx, dy, - x - g->info.x, - y - g->info.y, + xi, yi, g->info.width, g->info.height); } - free_pixman_pict(picture,glyph_image); + free_pixman_pict(picture, glyph_image); next_glyph: x += g->info.xOff; @@ -1207,7 +1210,7 @@ sna_glyphs(CARD8 op, if (REGION_NUM_RECTS(dst->pCompositeClip) == 0) return; - if (FALLBACK) + if (FALLBACK || DEBUG_NO_RENDER) goto fallback; if (sna->kgem.wedged || !sna->have_render) { diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h index 8ad755c1..91aa7e4e 100644 --- a/src/sna/sna_render_inline.h +++ b/src/sna/sna_render_inline.h @@ -90,7 +90,7 @@ is_dirty_gpu(DrawablePtr drawable) static inline Bool too_small(DrawablePtr drawable) { - return (drawable->width * drawable->height * drawable->bitsPerPixel <= 8*4096) && + return ((uint32_t)drawable->width * drawable->height * drawable->bitsPerPixel <= 8*4096) && !is_dirty_gpu(drawable); } |