blob: 847b3519b1fa6bbc3bd64a273423b00e3c28eca1 [file] [log] [blame]
Jesse Hall47743382013-02-08 11:13:46 -08001/*
Mathias Agopian518ec112011-05-13 16:21:08 -07002 ** Copyright 2007, The Android Open Source Project
3 **
Jesse Hall47743382013-02-08 11:13:46 -08004 ** Licensed under the Apache License, Version 2.0 (the "License");
5 ** you may not use this file except in compliance with the License.
6 ** You may obtain a copy of the License at
Mathias Agopian518ec112011-05-13 16:21:08 -07007 **
Jesse Hall47743382013-02-08 11:13:46 -08008 ** http://www.apache.org/licenses/LICENSE-2.0
Mathias Agopian518ec112011-05-13 16:21:08 -07009 **
Jesse Hall47743382013-02-08 11:13:46 -080010 ** Unless required by applicable law or agreed to in writing, software
11 ** distributed under the License is distributed on an "AS IS" BASIS,
12 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ** See the License for the specific language governing permissions and
Mathias Agopian518ec112011-05-13 16:21:08 -070014 ** limitations under the License.
15 */
16
Mathias Agopian311b4792017-02-28 15:00:49 -080017#include "egl_object.h"
18
Michael Lentinee2fc6f82015-07-28 16:30:10 -070019#include <sstream>
20
Mathias Agopian518ec112011-05-13 16:21:08 -070021namespace android {
Mathias Agopian518ec112011-05-13 16:21:08 -070022
Yiwei Zhang8af03062020-08-12 21:28:15 -070023egl_object_t::egl_object_t(egl_display_t* disp) : display(disp), count(1) {
Mathias Agopian5b287a62011-05-16 18:58:55 -070024 // NOTE: this does an implicit incRef
Mathias Agopian518ec112011-05-13 16:21:08 -070025 display->addObject(this);
26}
27
Yiwei Zhang8af03062020-08-12 21:28:15 -070028egl_object_t::~egl_object_t() {}
Mathias Agopian518ec112011-05-13 16:21:08 -070029
Mathias Agopian5b287a62011-05-16 18:58:55 -070030void egl_object_t::terminate() {
31 // this marks the object as "terminated"
32 display->removeObject(this);
33 if (decRef() == 1) {
34 // shouldn't happen because this is called from LocalRef
Steve Blocke6f43dd2012-01-06 19:20:56 +000035 ALOGE("egl_object_t::terminate() removed the last reference!");
Mathias Agopian5b287a62011-05-16 18:58:55 -070036 }
37}
38
39void egl_object_t::destroy() {
40 if (decRef() == 1) {
41 delete this;
42 }
43}
44
Mathias Agopianf0480de2011-11-13 20:50:07 -080045bool egl_object_t::get(egl_display_t const* display, egl_object_t* object) {
Mathias Agopian5b287a62011-05-16 18:58:55 -070046 // used by LocalRef, this does an incRef() atomically with
47 // checking that the object is valid.
Mathias Agopianf0480de2011-11-13 20:50:07 -080048 return display->getObject(object);
Mathias Agopian518ec112011-05-13 16:21:08 -070049}
50
Courtney Goeltzenleuchter37836572017-04-26 15:07:51 -060051egl_surface_t::egl_surface_t(egl_display_t* dpy, EGLConfig config, EGLNativeWindowType win,
52 EGLSurface surface, EGLint colorSpace, egl_connection_t const* cnx)
53 : egl_object_t(dpy),
54 surface(surface),
55 config(config),
56 win(win),
57 cnx(cnx),
58 connected(true),
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -070059 colorSpace(colorSpace),
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -070060 egl_smpte2086_dirty(false),
61 egl_cta861_3_dirty(false) {
Yiwei Zhang8af03062020-08-12 21:28:15 -070062 egl_smpte2086_metadata.displayPrimaryRed = {EGL_DONT_CARE, EGL_DONT_CARE};
63 egl_smpte2086_metadata.displayPrimaryGreen = {EGL_DONT_CARE, EGL_DONT_CARE};
64 egl_smpte2086_metadata.displayPrimaryBlue = {EGL_DONT_CARE, EGL_DONT_CARE};
65 egl_smpte2086_metadata.whitePoint = {EGL_DONT_CARE, EGL_DONT_CARE};
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -070066 egl_smpte2086_metadata.maxLuminance = EGL_DONT_CARE;
67 egl_smpte2086_metadata.minLuminance = EGL_DONT_CARE;
68 egl_cta861_3_metadata.maxFrameAverageLightLevel = EGL_DONT_CARE;
69 egl_cta861_3_metadata.maxContentLightLevel = EGL_DONT_CARE;
70
Mathias Agopian65421432017-03-08 11:49:05 -080071 if (win) {
72 win->incStrong(this);
73 }
74}
Jesse Hall25838592012-04-05 15:53:28 -070075
76egl_surface_t::~egl_surface_t() {
Yi Kong48a6cd22018-07-18 10:07:09 -070077 if (win != nullptr) {
Pablo Ceballosae8cf0b2016-05-02 11:24:13 -070078 disconnect();
Mathias Agopian65421432017-03-08 11:49:05 -080079 win->decStrong(this);
Pablo Ceballosae8cf0b2016-05-02 11:24:13 -070080 }
81}
82
83void egl_surface_t::disconnect() {
Yi Kong48a6cd22018-07-18 10:07:09 -070084 if (win != nullptr && connected) {
Mathias Agopian65421432017-03-08 11:49:05 -080085 native_window_set_buffers_format(win, 0);
86 if (native_window_api_disconnect(win, NATIVE_WINDOW_API_EGL)) {
87 ALOGW("EGLNativeWindowType %p disconnect failed", win);
Jesse Hall25838592012-04-05 15:53:28 -070088 }
Pablo Ceballosae8cf0b2016-05-02 11:24:13 -070089 connected = false;
Jesse Hall25838592012-04-05 15:53:28 -070090 }
91}
92
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -070093EGLBoolean egl_surface_t::setSmpte2086Attribute(EGLint attribute, EGLint value) {
94 switch (attribute) {
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -070095 case EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -080096 egl_smpte2086_metadata.displayPrimaryRed.x = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -070097 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -070098 return EGL_TRUE;
99 case EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800100 egl_smpte2086_metadata.displayPrimaryRed.y = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700101 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700102 return EGL_TRUE;
103 case EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800104 egl_smpte2086_metadata.displayPrimaryGreen.x = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700105 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700106 return EGL_TRUE;
107 case EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800108 egl_smpte2086_metadata.displayPrimaryGreen.y = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700109 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700110 return EGL_TRUE;
111 case EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800112 egl_smpte2086_metadata.displayPrimaryBlue.x = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700113 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700114 return EGL_TRUE;
115 case EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800116 egl_smpte2086_metadata.displayPrimaryBlue.y = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700117 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700118 return EGL_TRUE;
119 case EGL_SMPTE2086_WHITE_POINT_X_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800120 egl_smpte2086_metadata.whitePoint.x = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700121 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700122 return EGL_TRUE;
123 case EGL_SMPTE2086_WHITE_POINT_Y_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800124 egl_smpte2086_metadata.whitePoint.y = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700125 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700126 return EGL_TRUE;
127 case EGL_SMPTE2086_MAX_LUMINANCE_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800128 egl_smpte2086_metadata.maxLuminance = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700129 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700130 return EGL_TRUE;
131 case EGL_SMPTE2086_MIN_LUMINANCE_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800132 egl_smpte2086_metadata.minLuminance = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700133 egl_smpte2086_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700134 return EGL_TRUE;
135 }
136 return EGL_FALSE;
137}
138
139EGLBoolean egl_surface_t::setCta8613Attribute(EGLint attribute, EGLint value) {
140 switch (attribute) {
141 case EGL_CTA861_3_MAX_CONTENT_LIGHT_LEVEL_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800142 egl_cta861_3_metadata.maxContentLightLevel = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700143 egl_cta861_3_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700144 return EGL_TRUE;
145 case EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800146 egl_cta861_3_metadata.maxFrameAverageLightLevel = value;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700147 egl_cta861_3_dirty = true;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700148 return EGL_TRUE;
149 }
150 return EGL_FALSE;
151}
152
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700153EGLBoolean egl_surface_t::getSmpte2086Metadata(android_smpte2086_metadata& metadata) const {
154 if (!egl_smpte2086_dirty) return EGL_FALSE;
155 if (egl_smpte2086_metadata.displayPrimaryRed.x == EGL_DONT_CARE ||
156 egl_smpte2086_metadata.displayPrimaryRed.y == EGL_DONT_CARE ||
157 egl_smpte2086_metadata.displayPrimaryGreen.x == EGL_DONT_CARE ||
158 egl_smpte2086_metadata.displayPrimaryGreen.y == EGL_DONT_CARE ||
159 egl_smpte2086_metadata.displayPrimaryBlue.x == EGL_DONT_CARE ||
160 egl_smpte2086_metadata.displayPrimaryBlue.y == EGL_DONT_CARE ||
161 egl_smpte2086_metadata.whitePoint.x == EGL_DONT_CARE ||
162 egl_smpte2086_metadata.whitePoint.y == EGL_DONT_CARE ||
163 egl_smpte2086_metadata.maxLuminance == EGL_DONT_CARE ||
164 egl_smpte2086_metadata.minLuminance == EGL_DONT_CARE) {
165 ALOGW("egl_surface_t: incomplete SMPTE 2086 metadata!");
166 return EGL_FALSE;
167 }
168
Yiwei Zhang8af03062020-08-12 21:28:15 -0700169 metadata.displayPrimaryRed.x = static_cast<float>(egl_smpte2086_metadata.displayPrimaryRed.x) /
170 EGL_METADATA_SCALING_EXT;
171 metadata.displayPrimaryRed.y = static_cast<float>(egl_smpte2086_metadata.displayPrimaryRed.y) /
172 EGL_METADATA_SCALING_EXT;
173 metadata.displayPrimaryGreen.x =
174 static_cast<float>(egl_smpte2086_metadata.displayPrimaryGreen.x) /
175 EGL_METADATA_SCALING_EXT;
176 metadata.displayPrimaryGreen.y =
177 static_cast<float>(egl_smpte2086_metadata.displayPrimaryGreen.y) /
178 EGL_METADATA_SCALING_EXT;
179 metadata.displayPrimaryBlue.x =
180 static_cast<float>(egl_smpte2086_metadata.displayPrimaryBlue.x) /
181 EGL_METADATA_SCALING_EXT;
182 metadata.displayPrimaryBlue.y =
183 static_cast<float>(egl_smpte2086_metadata.displayPrimaryBlue.y) /
184 EGL_METADATA_SCALING_EXT;
185 metadata.whitePoint.x =
186 static_cast<float>(egl_smpte2086_metadata.whitePoint.x) / EGL_METADATA_SCALING_EXT;
187 metadata.whitePoint.y =
188 static_cast<float>(egl_smpte2086_metadata.whitePoint.y) / EGL_METADATA_SCALING_EXT;
189 metadata.maxLuminance =
190 static_cast<float>(egl_smpte2086_metadata.maxLuminance) / EGL_METADATA_SCALING_EXT;
191 metadata.minLuminance =
192 static_cast<float>(egl_smpte2086_metadata.minLuminance) / EGL_METADATA_SCALING_EXT;
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800193
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700194 return EGL_TRUE;
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800195}
196
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700197EGLBoolean egl_surface_t::getCta8613Metadata(android_cta861_3_metadata& metadata) const {
198 if (!egl_cta861_3_dirty) return EGL_FALSE;
199
200 if (egl_cta861_3_metadata.maxContentLightLevel == EGL_DONT_CARE ||
201 egl_cta861_3_metadata.maxFrameAverageLightLevel == EGL_DONT_CARE) {
202 ALOGW("egl_surface_t: incomplete CTA861.3 metadata!");
203 return EGL_FALSE;
204 }
205
Yiwei Zhang8af03062020-08-12 21:28:15 -0700206 metadata.maxContentLightLevel = static_cast<float>(egl_cta861_3_metadata.maxContentLightLevel) /
207 EGL_METADATA_SCALING_EXT;
208 metadata.maxFrameAverageLightLevel =
209 static_cast<float>(egl_cta861_3_metadata.maxFrameAverageLightLevel) /
210 EGL_METADATA_SCALING_EXT;
Courtney Goeltzenleuchter936799c2018-03-02 16:47:08 -0700211
212 return EGL_TRUE;
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800213}
214
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700215EGLBoolean egl_surface_t::getColorSpaceAttribute(EGLint attribute, EGLint* value) const {
216 if (attribute == EGL_GL_COLORSPACE_KHR) {
217 *value = colorSpace;
218 return EGL_TRUE;
219 }
220 return EGL_FALSE;
221}
222
Yiwei Zhang8af03062020-08-12 21:28:15 -0700223EGLBoolean egl_surface_t::getSmpte2086Attribute(EGLint attribute, EGLint* value) const {
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700224 switch (attribute) {
225 case EGL_SMPTE2086_DISPLAY_PRIMARY_RX_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800226 *value = egl_smpte2086_metadata.displayPrimaryRed.x;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700227 return EGL_TRUE;
228 break;
229 case EGL_SMPTE2086_DISPLAY_PRIMARY_RY_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800230 *value = egl_smpte2086_metadata.displayPrimaryRed.y;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700231 return EGL_TRUE;
232 break;
233 case EGL_SMPTE2086_DISPLAY_PRIMARY_GX_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800234 *value = egl_smpte2086_metadata.displayPrimaryGreen.x;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700235 return EGL_TRUE;
236 break;
237 case EGL_SMPTE2086_DISPLAY_PRIMARY_GY_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800238 *value = egl_smpte2086_metadata.displayPrimaryGreen.y;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700239 return EGL_TRUE;
240 break;
241 case EGL_SMPTE2086_DISPLAY_PRIMARY_BX_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800242 *value = egl_smpte2086_metadata.displayPrimaryBlue.x;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700243 return EGL_TRUE;
244 break;
245 case EGL_SMPTE2086_DISPLAY_PRIMARY_BY_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800246 *value = egl_smpte2086_metadata.displayPrimaryBlue.y;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700247 return EGL_TRUE;
248 break;
249 case EGL_SMPTE2086_WHITE_POINT_X_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800250 *value = egl_smpte2086_metadata.whitePoint.x;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700251 return EGL_TRUE;
252 break;
253 case EGL_SMPTE2086_WHITE_POINT_Y_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800254 *value = egl_smpte2086_metadata.whitePoint.y;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700255 return EGL_TRUE;
256 break;
257 case EGL_SMPTE2086_MAX_LUMINANCE_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800258 *value = egl_smpte2086_metadata.maxLuminance;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700259 return EGL_TRUE;
260 break;
261 case EGL_SMPTE2086_MIN_LUMINANCE_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800262 *value = egl_smpte2086_metadata.minLuminance;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700263 return EGL_TRUE;
264 break;
265 }
266 return EGL_FALSE;
267}
268
Yiwei Zhang8af03062020-08-12 21:28:15 -0700269EGLBoolean egl_surface_t::getCta8613Attribute(EGLint attribute, EGLint* value) const {
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700270 switch (attribute) {
271 case EGL_CTA861_3_MAX_CONTENT_LIGHT_LEVEL_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800272 *value = egl_cta861_3_metadata.maxContentLightLevel;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700273 return EGL_TRUE;
274 break;
275 case EGL_CTA861_3_MAX_FRAME_AVERAGE_LEVEL_EXT:
Courtney Goeltzenleuchter786ab882018-01-26 13:37:33 -0800276 *value = egl_cta861_3_metadata.maxFrameAverageLightLevel;
Courtney Goeltzenleuchter12ffe092017-11-16 14:27:48 -0700277 return EGL_TRUE;
278 break;
279 }
280 return EGL_FALSE;
281}
282
Pablo Ceballosae8cf0b2016-05-02 11:24:13 -0700283void egl_surface_t::terminate() {
284 disconnect();
285 egl_object_t::terminate();
286}
287
Mathias Agopian48d438d2012-01-28 21:44:00 -0800288egl_context_t::egl_context_t(EGLDisplay dpy, EGLContext context, EGLConfig config,
Yiwei Zhang0657fba2020-08-12 19:09:26 -0700289 egl_connection_t const* cnx, int version)
290 : egl_object_t(get_display(dpy)),
291 dpy(dpy),
292 context(context),
293 config(config),
294 read(nullptr),
295 draw(nullptr),
296 cnx(cnx),
297 version(version) {}
Mathias Agopian48d438d2012-01-28 21:44:00 -0800298
299void egl_context_t::onLooseCurrent() {
Yi Kong48a6cd22018-07-18 10:07:09 -0700300 read = nullptr;
301 draw = nullptr;
Mathias Agopian48d438d2012-01-28 21:44:00 -0800302}
303
304void egl_context_t::onMakeCurrent(EGLSurface draw, EGLSurface read) {
305 this->read = read;
306 this->draw = draw;
307
308 /*
309 * Here we cache the GL_EXTENSIONS string for this context and we
310 * add the extensions always handled by the wrapper
311 */
Yiwei Zhang8af03062020-08-12 21:28:15 -0700312 if (!gl_extensions.empty()) return;
Mathias Agopian48d438d2012-01-28 21:44:00 -0800313
Yiwei Zhang8af03062020-08-12 21:28:15 -0700314 // call the implementation's glGetString(GL_EXTENSIONS)
315 const char* exts = (const char*)gEGLImpl.hooks[version]->gl.glGetString(GL_EXTENSIONS);
316 if (!exts) return;
Alistair Strachan89301ea2015-05-22 14:10:09 -0700317
Yiwei Zhang8af03062020-08-12 21:28:15 -0700318 // If this context is sharing with another context, and the other context was reset
319 // e.g. due to robustness failure, this context might also be reset and glGetString can
320 // return NULL.
321 gl_extensions = exts;
322 if (gl_extensions.find("GL_EXT_debug_marker") == std::string::npos) {
323 gl_extensions.insert(0, "GL_EXT_debug_marker ");
324 // eglGetProcAddress could return function pointers to these
325 // functions while they actually don't work. Fix them now.
326 __eglMustCastToProperFunctionPointerType* f;
327 f = (__eglMustCastToProperFunctionPointerType*)&gEGLImpl.hooks[version]
328 ->gl.glInsertEventMarkerEXT;
329 if (*f != gl_noop) *f = gl_noop;
330 f = (__eglMustCastToProperFunctionPointerType*)&gEGLImpl.hooks[version]
331 ->gl.glPushGroupMarkerEXT;
332 if (*f != gl_noop) *f = gl_noop;
333 f = (__eglMustCastToProperFunctionPointerType*)&gEGLImpl.hooks[version]
334 ->gl.glPopGroupMarkerEXT;
335 if (*f != gl_noop) *f = gl_noop;
336 }
Jesse Hall09fc8f92017-09-29 15:57:42 -0700337
Yiwei Zhang8af03062020-08-12 21:28:15 -0700338 // tokenize the supported extensions for the glGetStringi() wrapper
339 std::stringstream ss;
340 std::string str;
341 ss << gl_extensions;
342 while (ss >> str) {
343 tokenized_gl_extensions.push_back(str);
Mathias Agopian48d438d2012-01-28 21:44:00 -0800344 }
345}
346
Mathias Agopian518ec112011-05-13 16:21:08 -0700347}; // namespace android