summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-01-17 10:10:54 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-01-17 10:10:54 +0000
commitd5c8d38afaba04281157bafe212e93f010ae00f5 (patch)
treea44984c508e547b59457d99d4569c7f445630475
parent9552438caa4d295c99a9b8821cf2644739861c6a (diff)
sna: Refactor to remove a goto from sna_put_zpixmap_blt()
The complexity of the function has been moved to move-to-cpu so we can take further advantage of the simplified logic in put_zpixmap to clean up the code by removing an unwanted goto. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 4bb50cd6..8c7daa29 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3428,7 +3428,6 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
PixmapPtr pixmap = get_drawable_pixmap(drawable);
struct sna *sna = to_sna_from_pixmap(pixmap);
struct sna_pixmap *priv = sna_pixmap(pixmap);
- unsigned flags;
char *dst_bits;
int dst_stride;
BoxRec *box;
@@ -3440,24 +3439,22 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
if (gc->alu != GXcopy)
return false;
- if (!priv) {
+ if (priv) {
+ unsigned flags = MOVE_WRITE;
+ if (w == pixmap->drawable.width) {
+ flags |= MOVE_WHOLE_HINT;
+ if (h != pixmap->drawable.height)
+ flags |= MOVE_READ;
+ }
+
+ if (!sna_drawable_move_region_to_cpu(&pixmap->drawable,
+ region, flags))
+ return false;
+ } else {
if (drawable->depth < 8)
return false;
-
- goto blt;
- }
-
- flags = MOVE_WRITE;
- if (w == pixmap->drawable.width) {
- flags |= MOVE_WHOLE_HINT;
- if (h != pixmap->drawable.height)
- flags |= MOVE_READ;
}
- if (!sna_drawable_move_region_to_cpu(&pixmap->drawable, region, flags))
- return false;
-
-blt:
get_drawable_deltas(drawable, pixmap, &dx, &dy);
x += dx + drawable->x;
y += dy + drawable->y;