diff options
author | Eric Anholt <eric@anholt.net> | 2015-07-02 13:33:01 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2015-10-19 00:03:07 -0700 |
commit | 09dd98f9e04bbedc1d34fe2541a5ca5f27336b0c (patch) | |
tree | 65518b1d2915bf8e320ad6c63509e751845043d3 | |
parent | 5ace5f63a44caa400a25c4c331eda75ce104e04e (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)
(cherry picked from commit c1111710628cc2a9dfaee0d74ea9fceee990095b)
-rw-r--r-- | glamor/glamor_prepare.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/glamor/glamor_prepare.c b/glamor/glamor_prepare.c index 83ba7f16f..53a1cf6c6 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 |