summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2012-10-17 07:57:04 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-10-17 07:57:04 -0700
commit9cb417b76fa72b3a53c6ce6d4017b389f553a2b8 (patch)
tree582c66585af108d6178cd604b70d11089f3c940c
parenta98e7502815d961911aac12fa4b24ca2118a48df (diff)
parentc894029a8e398502c058c2f5332bfe75d4b01735 (diff)
downloadframeworks_base-9cb417b76fa72b3a53c6ce6d4017b389f553a2b8.zip
frameworks_base-9cb417b76fa72b3a53c6ce6d4017b389f553a2b8.tar.gz
frameworks_base-9cb417b76fa72b3a53c6ce6d4017b389f553a2b8.tar.bz2
am c894029a: am be29d82f: Merge "Correctly adjust clip regions that lie offscreen" into jb-mr1-dev
* commit 'c894029a8e398502c058c2f5332bfe75d4b01735': Correctly adjust clip regions that lie offscreen
-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;