summaryrefslogtreecommitdiffstats
path: root/libs/hwui/Caches.cpp
diff options
context:
space:
mode:
authorRomain Guy <romainguy@google.com>2012-05-12 16:18:58 -0700
committerRomain Guy <romainguy@google.com>2012-05-12 16:22:35 -0700
commitdfa1046ecab165eb0daf5caa8475e993350f4a2b (patch)
tree90cf67b49d82feaad76749749c38c59239bc2b08 /libs/hwui/Caches.cpp
parent2d97a70ff8bbac5ea807003d65b64e3b255e82bc (diff)
downloadframeworks_base-dfa1046ecab165eb0daf5caa8475e993350f4a2b.zip
frameworks_base-dfa1046ecab165eb0daf5caa8475e993350f4a2b.tar.gz
frameworks_base-dfa1046ecab165eb0daf5caa8475e993350f4a2b.tar.bz2
Add call sites for OpenGL's debug label extension
Change-Id: I9c689127e8166cbef92c935f8aa07217ab806dda
Diffstat (limited to 'libs/hwui/Caches.cpp')
-rw-r--r--libs/hwui/Caches.cpp50
1 files changed, 32 insertions, 18 deletions
diff --git a/libs/hwui/Caches.cpp b/libs/hwui/Caches.cpp
index 123695a..f210820 100644
--- a/libs/hwui/Caches.cpp
+++ b/libs/hwui/Caches.cpp
@@ -48,25 +48,9 @@ namespace uirenderer {
///////////////////////////////////////////////////////////////////////////////
Caches::Caches(): Singleton<Caches>(), mInitialized(false) {
- GLint maxTextureUnits;
- glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
- if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) {
- ALOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT);
- }
-
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
-
- if (extensions.hasDebugMarker()) {
- eventMark = glInsertEventMarkerEXT;
- startMark = glPushGroupMarkerEXT;
- endMark = glPopGroupMarkerEXT;
- } else {
- eventMark = eventMarkNull;
- startMark = startMarkNull;
- endMark = endMarkNull;
- }
-
init();
+ initExtensions();
+ initConstraints();
mDebugLevel = readDebugLevel();
ALOGD("Enabling debug mode %d", mDebugLevel);
@@ -105,6 +89,36 @@ void Caches::init() {
mInitialized = true;
}
+void Caches::initExtensions() {
+ if (extensions.hasDebugMarker()) {
+ eventMark = glInsertEventMarkerEXT;
+ startMark = glPushGroupMarkerEXT;
+ endMark = glPopGroupMarkerEXT;
+ } else {
+ eventMark = eventMarkNull;
+ startMark = startMarkNull;
+ endMark = endMarkNull;
+ }
+
+ if (extensions.hasDebugLabel()) {
+ setLabel = glLabelObjectEXT;
+ getLabel = glGetObjectLabelEXT;
+ } else {
+ setLabel = setLabelNull;
+ getLabel = getLabelNull;
+ }
+}
+
+void Caches::initConstraints() {
+ GLint maxTextureUnits;
+ glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
+ if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) {
+ ALOGW("At least %d texture units are required!", REQUIRED_TEXTURE_UNITS_COUNT);
+ }
+
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
+}
+
void Caches::terminate() {
if (!mInitialized) return;