summaryrefslogtreecommitdiff
path: root/libs/hwui/Caches.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/hwui/Caches.cpp')
-rw-r--r--libs/hwui/Caches.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index c3bac5d2eedb..f2205f65974e 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -79,6 +79,8 @@ void Caches::init() {
mTexCoordsArrayEnabled = false;
+ mScissorX = mScissorY = mScissorWidth = mScissorHeight = 0;
+
glActiveTexture(gTextureUnits[0]);
mTextureUnit = 0;
@@ -312,6 +314,17 @@ void Caches::activeTexture(GLuint textureUnit) {
}
}
+void Caches::setScissor(GLint x, GLint y, GLint width, GLint height) {
+ if (x != mScissorX || y != mScissorY || width != mScissorWidth || height != mScissorHeight) {
+ glScissor(x, y, width, height);
+
+ mScissorX = x;
+ mScissorY = y;
+ mScissorWidth = width;
+ mScissorHeight = height;
+ }
+}
+
TextureVertex* Caches::getRegionMesh() {
// Create the mesh, 2 triangles and 4 vertices per rectangle in the region
if (!mRegionMesh) {