summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-10-16 17:36:16 -0700
committerChet Haase <chet@google.com>2012-10-16 17:36:16 -0700
commitaa42c9af6ea2158a685ebf9b338e6d2355712268 (patch)
tree051d7e09ddbc7baf5afa0a9d4d151a302c8ee0d8 /libs
parentd07fa6e0dc8141e5e77ffec6863f81a246bf8384 (diff)
downloadframeworks_base-aa42c9af6ea2158a685ebf9b338e6d2355712268.zip
frameworks_base-aa42c9af6ea2158a685ebf9b338e6d2355712268.tar.gz
frameworks_base-aa42c9af6ea2158a685ebf9b338e6d2355712268.tar.bz2
Correctly adjust clip regions that lie offscreen
We were clamping the x/y location of the scissor to 0,0, but not adjusting the width/height appropriately. This fix adjusts width/height and also clamps them to 0 to correctly clip out offscreen operations. Issue #7221524 Top left and top right portions of the screen blanks out after some time Change-Id: I47f23336ea612409ed86652b9a68e272819ef00e
Diffstat (limited to 'libs')
-rw-r--r--libs/hwui/Caches.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index d18a5b0..e7085b0 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -399,9 +399,20 @@ bool Caches::setScissor(GLint x, GLint y, GLint width, GLint height) {
if (scissorEnabled && (x != mScissorX || y != mScissorY ||
width != mScissorWidth || height != mScissorHeight)) {
- if (x < 0) x = 0;
- if (y < 0) y = 0;
-
+ if (x < 0) {
+ width += x;
+ x = 0;
+ }
+ if (y < 0) {
+ height += y;
+ y = 0;
+ }
+ if (width < 0) {
+ width = 0;
+ }
+ if (height < 0) {
+ height = 0;
+ }
glScissor(x, y, width, height);
mScissorX = x;