summaryrefslogtreecommitdiff
path: root/libs/hwui/Caches.cpp
diff options
context:
space:
mode:
author Romain Guy <romainguy@google.com> 2013-02-06 16:51:04 -0800
committer Romain Guy <romainguy@google.com> 2013-02-07 12:11:22 -0800
commit3bbacf27c0be1bae4e4483577fc89ae3113abe5d (patch)
tree102ffa5362c1782af27f2f0abad3e9f481479e79 /libs/hwui/Caches.cpp
parentc2a972131f1870042eb63847d4b24fbe718d8e3f (diff)
Add a RenderBuffer object to store stencil buffers.
Bug #7146141 This change is needed to add a render buffer cache to avoid creating and destroying stencil buffers on every frame. This change also allows the renderer to use a 1 bit or 4 bit stencil buffer whenever possible. Finally this change fixes a bug introduced by a previous CL which causes the stencil buffer to not be updated in certain conditions. The fix relies on a new optional parameter in drawColorRects() that can be used to avoid performing a quickReject on rectangles generated by the clip region. Change-Id: I2f55a8e807009887b276a83cde9f53fd5c01199f
Diffstat (limited to 'libs/hwui/Caches.cpp')
-rw-r--r--libs/hwui/Caches.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 1a86b3a4b32b..492bb7d171f5 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -47,7 +47,7 @@ namespace uirenderer {
// Constructors/destructor
///////////////////////////////////////////////////////////////////////////////
-Caches::Caches(): Singleton<Caches>(), mInitialized(false) {
+Caches::Caches(): Singleton<Caches>(), mExtensions(Extensions::getInstance()), mInitialized(false) {
init();
initFont();
initExtensions();
@@ -100,7 +100,7 @@ void Caches::initFont() {
}
void Caches::initExtensions() {
- if (extensions.hasDebugMarker()) {
+ if (mExtensions.hasDebugMarker()) {
eventMark = glInsertEventMarkerEXT;
startMark = glPushGroupMarkerEXT;
endMark = glPopGroupMarkerEXT;
@@ -110,7 +110,7 @@ void Caches::initExtensions() {
endMark = endMarkNull;
}
- if (extensions.hasDebugLabel()) {
+ if (mExtensions.hasDebugLabel()) {
setLabel = glLabelObjectEXT;
getLabel = glGetObjectLabelEXT;
} else {
@@ -470,13 +470,13 @@ void Caches::resetScissor() {
///////////////////////////////////////////////////////////////////////////////
void Caches::startTiling(GLuint x, GLuint y, GLuint width, GLuint height, bool discard) {
- if (extensions.hasTiledRendering() && !debugOverdraw) {
+ if (mExtensions.hasTiledRendering() && !debugOverdraw) {
glStartTilingQCOM(x, y, width, height, (discard ? GL_NONE : GL_COLOR_BUFFER_BIT0_QCOM));
}
}
void Caches::endTiling() {
- if (extensions.hasTiledRendering() && !debugOverdraw) {
+ if (mExtensions.hasTiledRendering() && !debugOverdraw) {
glEndTilingQCOM(GL_COLOR_BUFFER_BIT0_QCOM);
}
}