Loading libs/hwui/Caches.cpp +32 −18 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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; Loading libs/hwui/Caches.h +18 −3 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ public: }; /** * Initializes the cache. * Initialize caches. */ void init(); Loading Loading @@ -247,15 +247,30 @@ public: GammaFontRenderer fontRenderer; ResourceCache resourceCache; // Debug methods PFNGLINSERTEVENTMARKEREXTPROC eventMark; PFNGLPUSHGROUPMARKEREXTPROC startMark; PFNGLPOPGROUPMARKEREXTPROC endMark; PFNGLLABELOBJECTEXTPROC setLabel; PFNGLGETOBJECTLABELEXTPROC getLabel; private: void initExtensions(); void initConstraints(); static void eventMarkNull(GLsizei length, const GLchar* marker) { } static void startMarkNull(GLsizei length, const GLchar* marker) { } static void endMarkNull() { } static void setLabelNull(GLenum type, uint object, GLsizei length, const char* label) { } static void getLabelNull(GLenum type, uint object, GLsizei bufferSize, GLsizei* length, char* label) { if (length) *length = 0; if (label) *label = '\0'; } GLuint mCurrentBuffer; GLuint mCurrentIndicesBuffer; void* mCurrentPositionPointer; Loading libs/hwui/Extensions.h +3 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ namespace uirenderer { #endif // Vendor strings #define VENDOR_IMG "Imagination Technologies" /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -68,6 +67,7 @@ public: mHasFramebufferFetch = hasExtension("GL_NV_shader_framebuffer_fetch"); mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer"); mHasDebugMarker = hasExtension("GL_EXT_debug_marker"); mHasDebugLabel = hasExtension("GL_EXT_debug_label"); const char* vendor = (const char*) glGetString(GL_VENDOR); EXT_LOGD("Vendor: %s", vendor); Loading @@ -84,6 +84,7 @@ public: inline bool needsHighpTexCoords() const { return mNeedsHighpTexCoords; } inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } inline bool hasDebugMarker() const { return mHasDebugMarker; } inline bool hasDebugLabel() const { return mHasDebugLabel; } bool hasExtension(const char* extension) const { const String8 s(extension); Loading @@ -104,6 +105,7 @@ private: bool mHasFramebufferFetch; bool mHasDiscardFramebuffer; bool mHasDebugMarker; bool mHasDebugLabel; }; // class Extensions }; // namespace uirenderer Loading Loading
libs/hwui/Caches.cpp +32 −18 Original line number Diff line number Diff line Loading @@ -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); Loading Loading @@ -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; Loading
libs/hwui/Caches.h +18 −3 Original line number Diff line number Diff line Loading @@ -107,7 +107,7 @@ public: }; /** * Initializes the cache. * Initialize caches. */ void init(); Loading Loading @@ -247,15 +247,30 @@ public: GammaFontRenderer fontRenderer; ResourceCache resourceCache; // Debug methods PFNGLINSERTEVENTMARKEREXTPROC eventMark; PFNGLPUSHGROUPMARKEREXTPROC startMark; PFNGLPOPGROUPMARKEREXTPROC endMark; PFNGLLABELOBJECTEXTPROC setLabel; PFNGLGETOBJECTLABELEXTPROC getLabel; private: void initExtensions(); void initConstraints(); static void eventMarkNull(GLsizei length, const GLchar* marker) { } static void startMarkNull(GLsizei length, const GLchar* marker) { } static void endMarkNull() { } static void setLabelNull(GLenum type, uint object, GLsizei length, const char* label) { } static void getLabelNull(GLenum type, uint object, GLsizei bufferSize, GLsizei* length, char* label) { if (length) *length = 0; if (label) *label = '\0'; } GLuint mCurrentBuffer; GLuint mCurrentIndicesBuffer; void* mCurrentPositionPointer; Loading
libs/hwui/Extensions.h +3 −1 Original line number Diff line number Diff line Loading @@ -40,7 +40,6 @@ namespace uirenderer { #endif // Vendor strings #define VENDOR_IMG "Imagination Technologies" /////////////////////////////////////////////////////////////////////////////// Loading Loading @@ -68,6 +67,7 @@ public: mHasFramebufferFetch = hasExtension("GL_NV_shader_framebuffer_fetch"); mHasDiscardFramebuffer = hasExtension("GL_EXT_discard_framebuffer"); mHasDebugMarker = hasExtension("GL_EXT_debug_marker"); mHasDebugLabel = hasExtension("GL_EXT_debug_label"); const char* vendor = (const char*) glGetString(GL_VENDOR); EXT_LOGD("Vendor: %s", vendor); Loading @@ -84,6 +84,7 @@ public: inline bool needsHighpTexCoords() const { return mNeedsHighpTexCoords; } inline bool hasDiscardFramebuffer() const { return mHasDiscardFramebuffer; } inline bool hasDebugMarker() const { return mHasDebugMarker; } inline bool hasDebugLabel() const { return mHasDebugLabel; } bool hasExtension(const char* extension) const { const String8 s(extension); Loading @@ -104,6 +105,7 @@ private: bool mHasFramebufferFetch; bool mHasDiscardFramebuffer; bool mHasDebugMarker; bool mHasDebugLabel; }; // class Extensions }; // namespace uirenderer Loading