summaryrefslogtreecommitdiff
path: root/libs/hwui/Caches.cpp
diff options
context:
space:
mode:
author Chris Craik <ccraik@google.com> 2015-01-26 18:06:29 -0800
committer Chris Craik <ccraik@google.com> 2015-01-27 17:12:39 -0800
commit65fe5eeb19e2e15c8b1ee91e8a2dcf0c25e48ca6 (patch)
tree2283afa7268a8c9c488eb533066881e2b24d73a5 /libs/hwui/Caches.cpp
parentd05d91358d89953a1374601a5b04b7ed65403e8c (diff)
Move scissor state to RenderState
Change-Id: I1227a3886fb24e4d9fad79fca469794f06cfb15e
Diffstat (limited to 'libs/hwui/Caches.cpp')
-rw-r--r--libs/hwui/Caches.cpp80
1 files changed, 6 insertions, 74 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 107eb08b2ca6..20dd21c510d3 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -16,16 +16,17 @@
#define LOG_TAG "OpenGLRenderer"
-#include <utils/Log.h>
-#include <utils/String8.h>
-
#include "Caches.h"
+
#include "DisplayListRenderer.h"
#include "GammaFontRenderer.h"
-#include "Properties.h"
#include "LayerRenderer.h"
+#include "Properties.h"
+#include "renderstate/RenderState.h"
#include "ShadowTessellator.h"
-#include "RenderState.h"
+
+#include <utils/Log.h>
+#include <utils/String8.h>
namespace android {
@@ -80,10 +81,6 @@ bool Caches::init() {
mTexCoordsArrayEnabled = false;
- glDisable(GL_SCISSOR_TEST);
- scissorEnabled = false;
- mScissorX = mScissorY = mScissorWidth = mScissorHeight = 0;
-
glActiveTexture(gTextureUnits[0]);
mTextureUnit = 0;
@@ -579,71 +576,6 @@ void Caches::unbindTexture(GLuint texture) {
}
///////////////////////////////////////////////////////////////////////////////
-// Scissor
-///////////////////////////////////////////////////////////////////////////////
-
-bool Caches::setScissor(GLint x, GLint y, GLint width, GLint height) {
- if (scissorEnabled && (x != mScissorX || y != mScissorY ||
- width != mScissorWidth || height != mScissorHeight)) {
-
- 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;
- mScissorY = y;
- mScissorWidth = width;
- mScissorHeight = height;
-
- return true;
- }
- return false;
-}
-
-bool Caches::enableScissor() {
- if (!scissorEnabled) {
- glEnable(GL_SCISSOR_TEST);
- scissorEnabled = true;
- resetScissor();
- return true;
- }
- return false;
-}
-
-bool Caches::disableScissor() {
- if (scissorEnabled) {
- glDisable(GL_SCISSOR_TEST);
- scissorEnabled = false;
- return true;
- }
- return false;
-}
-
-void Caches::setScissorEnabled(bool enabled) {
- if (scissorEnabled != enabled) {
- if (enabled) glEnable(GL_SCISSOR_TEST);
- else glDisable(GL_SCISSOR_TEST);
- scissorEnabled = enabled;
- }
-}
-
-void Caches::resetScissor() {
- mScissorX = mScissorY = mScissorWidth = mScissorHeight = 0;
-}
-
-///////////////////////////////////////////////////////////////////////////////
// Tiling
///////////////////////////////////////////////////////////////////////////////