summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2015-07-02 13:33:01 -0700
committerEric Anholt <eric@anholt.net>2015-07-10 09:42:58 -0700
commitc1111710628cc2a9dfaee0d74ea9fceee990095b (patch)
treeb5aad6f994bba94c81556f9dbb75bbd1cc693f21
parentc16e086dace81151f399485e5c686617a43d5b94 (diff)
glamor: Take transforms into account when preparing for a fallback.
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. v2: Add XXX comment for the commit message note (Suggested by Michel). Signed-off-by: Eric Anholt <eric@anholt.net> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> (v1) Reviewed-by: Dave Airlie <airlied@redhat.com> (v1)
-rw-r--r--glamor/glamor_prepare.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c
index 9bfc557e1..833291c58 100644
--- a/glamor/glamor_prepare.c
+++ b/glamor/glamor_prepare.c
@@ -220,8 +220,22 @@ 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 a transform is set, we don't know what the bounds is on the
+ * source, so just prepare the whole pixmap. XXX: We could
+ * potentially work out where in the source would be sampled based
+ * on the transform, and we don't need do do this for destination
+ * pixmaps at all.
+ */
+ 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