summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann <ssp@redhat.com>2011-12-17 05:39:32 -0500
committerSøren Sandmann <ssp@redhat.com>2011-12-17 05:39:32 -0500
commit635a5887c52382b481de1ecca463a3fbb7fd6aa3 (patch)
treed5ff5d5be95d11ff6aeac3bf565f321f2037eaf3
parent8ea466a2f408524a9fcc08ed0a17f3c935857afa (diff)
Don't translate newly generated paccess region
The region passed to uxa_prepare_access() is in screen coordinates, but the driver wants drawable coordinates. Hence we do a translation. However, when the passed region is NULL, we generate the region ourselves based on the full drawable extents. This region is already in drawable space so shouldn't be translated.
-rw-r--r--src/uxa/uxa.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/src/uxa/uxa.c b/src/uxa/uxa.c
index 9d02e34..dc973ef 100644
--- a/src/uxa/uxa.c
+++ b/src/uxa/uxa.c
@@ -152,24 +152,22 @@ Bool uxa_prepare_access(DrawablePtr pDrawable, RegionPtr region, uxa_access_t ac
if (!pPixmap)
return TRUE;
- box.x1 = 0;
- box.y1 = 0;
- box.x2 = pDrawable->width;
- box.y2 = pDrawable->height;
-
- REGION_INIT (pScreen, &region_rec, &box, 1);
if (!region)
- region = &region_rec;
-
-#if 0
- /* Confine to the size of the drawable pixmap. The original
- * drawable may be bigger than the underlying one. For example,
- * the root window might be bigger than the screen pixmap.
- */
- REGION_INTERSECT (pScreen, region, region, &region_rec);
-#endif
- REGION_TRANSLATE (pScreen, region, xoff, yoff);
+ {
+ box.x1 = 0;
+ box.y1 = 0;
+ box.x2 = pDrawable->width;
+ box.y2 = pDrawable->height;
+ REGION_INIT (pScreen, &region_rec, &box, 1);
+ region = &region_rec;
+ }
+ else
+ {
+ /* The driver expects a region in drawable coordinates */
+ REGION_TRANSLATE (pScreen, region, xoff, yoff);
+ }
+
result = TRUE;
if (uxa_screen->info->prepare_access)