@@ -48,25 +48,9 @@ namespace uirenderer {
4848// /////////////////////////////////////////////////////////////////////////////
4949
5050Caches::Caches (): Singleton<Caches>(), mInitialized (false ) {
51- GLint maxTextureUnits;
52- glGetIntegerv (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
53- if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) {
54- ALOGW (" At least %d texture units are required!" , REQUIRED_TEXTURE_UNITS_COUNT);
55- }
56-
57- glGetIntegerv (GL_MAX_TEXTURE_SIZE, &maxTextureSize);
58-
59- if (extensions.hasDebugMarker ()) {
60- eventMark = glInsertEventMarkerEXT;
61- startMark = glPushGroupMarkerEXT;
62- endMark = glPopGroupMarkerEXT;
63- } else {
64- eventMark = eventMarkNull;
65- startMark = startMarkNull;
66- endMark = endMarkNull;
67- }
68-
6951 init ();
52+ initExtensions ();
53+ initConstraints ();
7054
7155 mDebugLevel = readDebugLevel ();
7256 ALOGD (" Enabling debug mode %d" , mDebugLevel );
@@ -105,6 +89,36 @@ void Caches::init() {
10589 mInitialized = true ;
10690}
10791
92+ void Caches::initExtensions () {
93+ if (extensions.hasDebugMarker ()) {
94+ eventMark = glInsertEventMarkerEXT;
95+ startMark = glPushGroupMarkerEXT;
96+ endMark = glPopGroupMarkerEXT;
97+ } else {
98+ eventMark = eventMarkNull;
99+ startMark = startMarkNull;
100+ endMark = endMarkNull;
101+ }
102+
103+ if (extensions.hasDebugLabel ()) {
104+ setLabel = glLabelObjectEXT;
105+ getLabel = glGetObjectLabelEXT;
106+ } else {
107+ setLabel = setLabelNull;
108+ getLabel = getLabelNull;
109+ }
110+ }
111+
112+ void Caches::initConstraints () {
113+ GLint maxTextureUnits;
114+ glGetIntegerv (GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits);
115+ if (maxTextureUnits < REQUIRED_TEXTURE_UNITS_COUNT) {
116+ ALOGW (" At least %d texture units are required!" , REQUIRED_TEXTURE_UNITS_COUNT);
117+ }
118+
119+ glGetIntegerv (GL_MAX_TEXTURE_SIZE, &maxTextureSize);
120+ }
121+
108122void Caches::terminate () {
109123 if (!mInitialized ) return ;
110124
0 commit comments