summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-10-17 07:51:45 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-10-17 07:51:46 -0700
commitbe29d82f740fea2ed35d89bd9aa4644f4c042762 (patch)
tree3a91bd617bfe76f299b341bbe840bdad4b0c8545 /libs
parent91ffeddb8b6ceec9a18ae34f88bd56560335de7f (diff)
parentaa42c9af6ea2158a685ebf9b338e6d2355712268 (diff)
downloadframeworks_base-be29d82f740fea2ed35d89bd9aa4644f4c042762.zip
frameworks_base-be29d82f740fea2ed35d89bd9aa4644f4c042762.tar.gz
frameworks_base-be29d82f740fea2ed35d89bd9aa4644f4c042762.tar.bz2
Merge "Correctly adjust clip regions that lie offscreen" into jb-mr1-dev
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;