[PATCH 09/12] glamor: Take transforms into account when preparing for a fallback.

Eric Anholt eric at anholt.net
Wed Jul 8 12:45:15 PDT 2015


This function takes the start x/y and the destination's width/height,
so it only works if there's no transform.  We could potentially
transform this box and take its bounds with some rounding, but this at
least gets us to read out enough data.

Note that this does the same overshoot on destination pictures with a
transform attached, but that seems unlikely to be used anyway.

Signed-off-by: Eric Anholt <eric at anholt.net>
---
 glamor/glamor_prepare.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c
index 9bfc557..f63cd6e 100644
--- a/glamor/glamor_prepare.c
+++ b/glamor/glamor_prepare.c
@@ -220,8 +220,15 @@ glamor_prepare_access_picture_box(PicturePtr picture, glamor_access_t access,
 {
     if (!picture || !picture->pDrawable)
         return TRUE;
-    return glamor_prepare_access_box(picture->pDrawable, access,
-                                    x, y, w, h);
+    if (picture->transform) {
+        return glamor_prepare_access_box(picture->pDrawable, access,
+                                         0, 0,
+                                         picture->pDrawable->width,
+                                         picture->pDrawable->height);
+    } else {
+        return glamor_prepare_access_box(picture->pDrawable, access,
+                                         x, y, w, h);
+    }
 }
 
 void
-- 
2.1.4



More information about the xorg-devel mailing list