• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //
2 // Copyright 2016 The ANGLE Project Authors. All rights reserved.
3 // Use of this source code is governed by a BSD-style license that can be
4 // found in the LICENSE file.
5 //
6 
7 // FunctionsEGL.cpp: Implements the FunctionsEGL class.
8 
9 #include "libANGLE/renderer/gl/egl/FunctionsEGL.h"
10 
11 #include <algorithm>
12 
13 #include "common/platform.h"
14 #include "common/string_utils.h"
15 #include "libANGLE/renderer/driver_utils.h"
16 #include "libANGLE/renderer/gl/FunctionsGL.h"
17 #include "libANGLE/renderer/gl/egl/functionsegl_typedefs.h"
18 
19 namespace
20 {
21 
22 template <typename T>
SetPtr(T * dst,void * src)23 bool SetPtr(T *dst, void *src)
24 {
25     if (src)
26     {
27         *dst = reinterpret_cast<T>(src);
28         return true;
29     }
30     return false;
31 }
32 }  // namespace
33 
34 namespace rx
35 {
36 
37 struct FunctionsEGL::EGLDispatchTable
38 {
EGLDispatchTablerx::FunctionsEGL::EGLDispatchTable39     EGLDispatchTable()
40         : bindAPIPtr(nullptr),
41           chooseConfigPtr(nullptr),
42           createContextPtr(nullptr),
43           createPbufferSurfacePtr(nullptr),
44           createWindowSurfacePtr(nullptr),
45           destroyContextPtr(nullptr),
46           destroySurfacePtr(nullptr),
47           getConfigAttribPtr(nullptr),
48           getDisplayPtr(nullptr),
49           getErrorPtr(nullptr),
50           initializePtr(nullptr),
51           makeCurrentPtr(nullptr),
52           queryStringPtr(nullptr),
53           querySurfacePtr(nullptr),
54           swapBuffersPtr(nullptr),
55           terminatePtr(nullptr),
56 
57           bindTexImagePtr(nullptr),
58           releaseTexImagePtr(nullptr),
59           surfaceAttribPtr(nullptr),
60           swapIntervalPtr(nullptr),
61 
62           createImageKHRPtr(nullptr),
63           destroyImageKHRPtr(nullptr),
64 
65           createSyncKHRPtr(nullptr),
66           destroySyncKHRPtr(nullptr),
67           clientWaitSyncKHRPtr(nullptr),
68           getSyncAttribKHRPtr(nullptr),
69 
70           waitSyncKHRPtr(nullptr),
71 
72           swapBuffersWithDamageKHRPtr(nullptr),
73 
74           presentationTimeANDROIDPtr(nullptr),
75 
76           setBlobCacheFuncsANDROIDPtr(nullptr),
77 
78           getCompositorTimingSupportedANDROIDPtr(nullptr),
79           getCompositorTimingANDROIDPtr(nullptr),
80           getNextFrameIdANDROIDPtr(nullptr),
81           getFrameTimestampSupportedANDROIDPtr(nullptr),
82           getFrameTimestampsANDROIDPtr(nullptr),
83 
84           dupNativeFenceFDANDROIDPtr(nullptr)
85     {}
86 
87     // 1.0
88     PFNEGLBINDAPIPROC bindAPIPtr;
89     PFNEGLCHOOSECONFIGPROC chooseConfigPtr;
90     PFNEGLCREATECONTEXTPROC createContextPtr;
91     PFNEGLCREATEPBUFFERSURFACEPROC createPbufferSurfacePtr;
92     PFNEGLCREATEWINDOWSURFACEPROC createWindowSurfacePtr;
93     PFNEGLDESTROYCONTEXTPROC destroyContextPtr;
94     PFNEGLDESTROYSURFACEPROC destroySurfacePtr;
95     PFNEGLGETCONFIGATTRIBPROC getConfigAttribPtr;
96     PFNEGLGETDISPLAYPROC getDisplayPtr;
97     PFNEGLGETERRORPROC getErrorPtr;
98     PFNEGLINITIALIZEPROC initializePtr;
99     PFNEGLMAKECURRENTPROC makeCurrentPtr;
100     PFNEGLQUERYSTRINGPROC queryStringPtr;
101     PFNEGLQUERYSURFACEPROC querySurfacePtr;
102     PFNEGLSWAPBUFFERSPROC swapBuffersPtr;
103     PFNEGLTERMINATEPROC terminatePtr;
104 
105     // 1.1
106     PFNEGLBINDTEXIMAGEPROC bindTexImagePtr;
107     PFNEGLRELEASETEXIMAGEPROC releaseTexImagePtr;
108     PFNEGLSURFACEATTRIBPROC surfaceAttribPtr;
109     PFNEGLSWAPINTERVALPROC swapIntervalPtr;
110 
111     // EGL_KHR_image
112     PFNEGLCREATEIMAGEKHRPROC createImageKHRPtr;
113     PFNEGLDESTROYIMAGEKHRPROC destroyImageKHRPtr;
114 
115     // EGL_KHR_fence_sync
116     PFNEGLCREATESYNCKHRPROC createSyncKHRPtr;
117     PFNEGLDESTROYSYNCKHRPROC destroySyncKHRPtr;
118     PFNEGLCLIENTWAITSYNCKHRPROC clientWaitSyncKHRPtr;
119     PFNEGLGETSYNCATTRIBKHRPROC getSyncAttribKHRPtr;
120 
121     // EGL_KHR_wait_sync
122     PFNEGLWAITSYNCKHRPROC waitSyncKHRPtr;
123 
124     // EGL_KHR_swap_buffers_with_damage
125     PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC swapBuffersWithDamageKHRPtr;
126 
127     // EGL_ANDROID_presentation_time
128     PFNEGLPRESENTATIONTIMEANDROIDPROC presentationTimeANDROIDPtr;
129 
130     // EGL_ANDROID_blob_cache
131     PFNEGLSETBLOBCACHEFUNCSANDROIDPROC setBlobCacheFuncsANDROIDPtr;
132 
133     // EGL_ANDROID_get_frame_timestamps
134     PFNEGLGETCOMPOSITORTIMINGSUPPORTEDANDROIDPROC getCompositorTimingSupportedANDROIDPtr;
135     PFNEGLGETCOMPOSITORTIMINGANDROIDPROC getCompositorTimingANDROIDPtr;
136     PFNEGLGETNEXTFRAMEIDANDROIDPROC getNextFrameIdANDROIDPtr;
137     PFNEGLGETFRAMETIMESTAMPSUPPORTEDANDROIDPROC getFrameTimestampSupportedANDROIDPtr;
138     PFNEGLGETFRAMETIMESTAMPSANDROIDPROC getFrameTimestampsANDROIDPtr;
139 
140     // EGL_ANDROID_native_fence_sync
141     PFNEGLDUPNATIVEFENCEFDANDROIDPROC dupNativeFenceFDANDROIDPtr;
142 };
143 
FunctionsEGL()144 FunctionsEGL::FunctionsEGL()
145     : majorVersion(0), minorVersion(0), mFnPtrs(new EGLDispatchTable()), mEGLDisplay(EGL_NO_DISPLAY)
146 {}
147 
~FunctionsEGL()148 FunctionsEGL::~FunctionsEGL()
149 {
150     SafeDelete(mFnPtrs);
151 }
152 
initialize(EGLNativeDisplayType nativeDisplay)153 egl::Error FunctionsEGL::initialize(EGLNativeDisplayType nativeDisplay)
154 {
155 #define ANGLE_GET_PROC_OR_ERROR(MEMBER, NAME)                                           \
156     do                                                                                  \
157     {                                                                                   \
158         if (!SetPtr(MEMBER, getProcAddress(#NAME)))                                     \
159         {                                                                               \
160             return egl::EglNotInitialized() << "Could not load EGL entry point " #NAME; \
161         }                                                                               \
162     } while (0)
163 
164     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->bindAPIPtr, eglBindAPI);
165     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->chooseConfigPtr, eglChooseConfig);
166     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->createContextPtr, eglCreateContext);
167     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->createPbufferSurfacePtr, eglCreatePbufferSurface);
168     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->createWindowSurfacePtr, eglCreateWindowSurface);
169     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->destroyContextPtr, eglDestroyContext);
170     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->destroySurfacePtr, eglDestroySurface);
171     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getConfigAttribPtr, eglGetConfigAttrib);
172     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getDisplayPtr, eglGetDisplay);
173     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getErrorPtr, eglGetError);
174     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->initializePtr, eglInitialize);
175     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->makeCurrentPtr, eglMakeCurrent);
176     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->queryStringPtr, eglQueryString);
177     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->querySurfacePtr, eglQuerySurface);
178     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->swapBuffersPtr, eglSwapBuffers);
179     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->terminatePtr, eglTerminate);
180 
181     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->bindTexImagePtr, eglBindTexImage);
182     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->releaseTexImagePtr, eglReleaseTexImage);
183     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->surfaceAttribPtr, eglSurfaceAttrib);
184     ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->swapIntervalPtr, eglSwapInterval);
185 
186     mEGLDisplay = mFnPtrs->getDisplayPtr(nativeDisplay);
187     if (mEGLDisplay == EGL_NO_DISPLAY)
188     {
189         return egl::EglNotInitialized() << "Failed to get system egl display";
190     }
191     if (mFnPtrs->initializePtr(mEGLDisplay, &majorVersion, &minorVersion) != EGL_TRUE)
192     {
193         return egl::Error(mFnPtrs->getErrorPtr(), "Failed to initialize system egl");
194     }
195     if (majorVersion < 1 || (majorVersion == 1 && minorVersion < 4))
196     {
197         return egl::EglNotInitialized() << "Unsupported EGL version (require at least 1.4).";
198     }
199     if (mFnPtrs->bindAPIPtr(EGL_OPENGL_ES_API) != EGL_TRUE)
200     {
201         return egl::Error(mFnPtrs->getErrorPtr(), "Failed to bind API in system egl");
202     }
203 
204     const char *extensions = queryString(EGL_EXTENSIONS);
205     if (!extensions)
206     {
207         return egl::Error(mFnPtrs->getErrorPtr(), "Faild to query extensions in system egl");
208     }
209     angle::SplitStringAlongWhitespace(extensions, &mExtensions);
210 
211     if (hasExtension("EGL_KHR_image_base"))
212     {
213         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->createImageKHRPtr, eglCreateImageKHR);
214         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->destroyImageKHRPtr, eglDestroyImageKHR);
215     }
216     if (hasExtension("EGL_KHR_fence_sync"))
217     {
218         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->createSyncKHRPtr, eglCreateSyncKHR);
219         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->destroySyncKHRPtr, eglDestroySyncKHR);
220         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->clientWaitSyncKHRPtr, eglClientWaitSyncKHR);
221         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getSyncAttribKHRPtr, eglGetSyncAttribKHR);
222     }
223     if (hasExtension("EGL_KHR_wait_sync"))
224     {
225         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->waitSyncKHRPtr, eglWaitSyncKHR);
226     }
227 
228     if (hasExtension("EGL_KHR_swap_buffers_with_damage"))
229     {
230         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->swapBuffersWithDamageKHRPtr, eglSwapBuffersWithDamageKHR);
231     }
232 
233     if (hasExtension("EGL_ANDROID_presentation_time"))
234     {
235         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->presentationTimeANDROIDPtr, eglPresentationTimeANDROID);
236     }
237 
238     if (hasExtension("EGL_ANDROID_blob_cache"))
239     {
240         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->setBlobCacheFuncsANDROIDPtr, eglSetBlobCacheFuncsANDROID);
241     }
242 
243     if (hasExtension("EGL_ANDROID_get_frame_timestamps"))
244     {
245         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getCompositorTimingSupportedANDROIDPtr,
246                                 eglGetCompositorTimingSupportedANDROID);
247         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getCompositorTimingANDROIDPtr,
248                                 eglGetCompositorTimingANDROID);
249         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getNextFrameIdANDROIDPtr, eglGetNextFrameIdANDROID);
250         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getFrameTimestampSupportedANDROIDPtr,
251                                 eglGetFrameTimestampSupportedANDROID);
252         ANGLE_GET_PROC_OR_ERROR(&mFnPtrs->getFrameTimestampsANDROIDPtr,
253                                 eglGetFrameTimestampsANDROID);
254     }
255 
256     // The native fence sync extension is a bit complicated. It's reported as present for ChromeOS,
257     // but Android currently doesn't report this extension even when it's present, and older devices
258     // may export a useless wrapper function. See crbug.com/775707 for details. In short, if the
259     // symbol is present and we're on Android N or newer, assume that it's usable even if the
260     // extension wasn't reported.
261     if (hasExtension("EGL_ANDROID_native_fence_sync") || GetAndroidSDKVersion() >= 24)
262     {
263         // Don't error trying to load this entry point.
264         if (SetPtr(&mFnPtrs->dupNativeFenceFDANDROIDPtr,
265                    getProcAddress("eglDupNativeFenceFDANDROID")) &&
266             !hasExtension("EGL_ANDROID_native_fence_sync"))
267         {
268             mExtensions.push_back("EGL_ANDROID_native_fence_sync");
269         }
270     }
271 
272 #undef ANGLE_GET_PROC_OR_ERROR
273 
274     return egl::NoError();
275 }
276 
terminate()277 egl::Error FunctionsEGL::terminate()
278 {
279     if (mFnPtrs->terminatePtr == nullptr || mFnPtrs->terminatePtr(mEGLDisplay) == EGL_TRUE)
280     {
281         mEGLDisplay = nullptr;
282         return egl::NoError();
283     }
284     return egl::Error(mFnPtrs->getErrorPtr());
285 }
286 
287 class FunctionsGLEGL : public FunctionsGL
288 {
289   public:
FunctionsGLEGL(const FunctionsEGL & egl)290     FunctionsGLEGL(const FunctionsEGL &egl) : mEGL(egl) {}
291 
~FunctionsGLEGL()292     ~FunctionsGLEGL() override {}
293 
294   private:
loadProcAddress(const std::string & function) const295     void *loadProcAddress(const std::string &function) const override
296     {
297         return mEGL.getProcAddress(function.c_str());
298     }
299 
300     const FunctionsEGL &mEGL;
301 };
302 
makeFunctionsGL(void) const303 FunctionsGL *FunctionsEGL::makeFunctionsGL(void) const
304 {
305     return new FunctionsGLEGL(*this);
306 }
307 
hasExtension(const char * extension) const308 bool FunctionsEGL::hasExtension(const char *extension) const
309 {
310     return std::find(mExtensions.begin(), mExtensions.end(), extension) != mExtensions.end();
311 }
312 
getDisplay() const313 EGLDisplay FunctionsEGL::getDisplay() const
314 {
315     return mEGLDisplay;
316 }
317 
getError() const318 EGLint FunctionsEGL::getError() const
319 {
320     return mFnPtrs->getErrorPtr();
321 }
322 
chooseConfig(EGLint const * attribList,EGLConfig * configs,EGLint configSize,EGLint * numConfig) const323 EGLBoolean FunctionsEGL::chooseConfig(EGLint const *attribList,
324                                       EGLConfig *configs,
325                                       EGLint configSize,
326                                       EGLint *numConfig) const
327 {
328     return mFnPtrs->chooseConfigPtr(mEGLDisplay, attribList, configs, configSize, numConfig);
329 }
330 
getConfigAttrib(EGLConfig config,EGLint attribute,EGLint * value) const331 EGLBoolean FunctionsEGL::getConfigAttrib(EGLConfig config, EGLint attribute, EGLint *value) const
332 {
333     return mFnPtrs->getConfigAttribPtr(mEGLDisplay, config, attribute, value);
334 }
335 
createContext(EGLConfig config,EGLContext share_context,EGLint const * attrib_list) const336 EGLContext FunctionsEGL::createContext(EGLConfig config,
337                                        EGLContext share_context,
338                                        EGLint const *attrib_list) const
339 {
340     return mFnPtrs->createContextPtr(mEGLDisplay, config, share_context, attrib_list);
341 }
342 
createPbufferSurface(EGLConfig config,const EGLint * attrib_list) const343 EGLSurface FunctionsEGL::createPbufferSurface(EGLConfig config, const EGLint *attrib_list) const
344 {
345     return mFnPtrs->createPbufferSurfacePtr(mEGLDisplay, config, attrib_list);
346 }
347 
createWindowSurface(EGLConfig config,EGLNativeWindowType win,const EGLint * attrib_list) const348 EGLSurface FunctionsEGL::createWindowSurface(EGLConfig config,
349                                              EGLNativeWindowType win,
350                                              const EGLint *attrib_list) const
351 {
352     return mFnPtrs->createWindowSurfacePtr(mEGLDisplay, config, win, attrib_list);
353 }
354 
destroyContext(EGLContext context) const355 EGLBoolean FunctionsEGL::destroyContext(EGLContext context) const
356 {
357     return mFnPtrs->destroyContextPtr(mEGLDisplay, context);
358 }
359 
destroySurface(EGLSurface surface) const360 EGLBoolean FunctionsEGL::destroySurface(EGLSurface surface) const
361 {
362     return mFnPtrs->destroySurfacePtr(mEGLDisplay, surface);
363 }
364 
makeCurrent(EGLSurface surface,EGLContext context) const365 EGLBoolean FunctionsEGL::makeCurrent(EGLSurface surface, EGLContext context) const
366 {
367     return mFnPtrs->makeCurrentPtr(mEGLDisplay, surface, surface, context);
368 }
369 
queryString(EGLint name) const370 char const *FunctionsEGL::queryString(EGLint name) const
371 {
372     return mFnPtrs->queryStringPtr(mEGLDisplay, name);
373 }
374 
querySurface(EGLSurface surface,EGLint attribute,EGLint * value) const375 EGLBoolean FunctionsEGL::querySurface(EGLSurface surface, EGLint attribute, EGLint *value) const
376 {
377     return mFnPtrs->querySurfacePtr(mEGLDisplay, surface, attribute, value);
378 }
379 
swapBuffers(EGLSurface surface) const380 EGLBoolean FunctionsEGL::swapBuffers(EGLSurface surface) const
381 {
382     return mFnPtrs->swapBuffersPtr(mEGLDisplay, surface);
383 }
384 
bindTexImage(EGLSurface surface,EGLint buffer) const385 EGLBoolean FunctionsEGL::bindTexImage(EGLSurface surface, EGLint buffer) const
386 {
387     return mFnPtrs->bindTexImagePtr(mEGLDisplay, surface, buffer);
388 }
389 
releaseTexImage(EGLSurface surface,EGLint buffer) const390 EGLBoolean FunctionsEGL::releaseTexImage(EGLSurface surface, EGLint buffer) const
391 {
392     return mFnPtrs->releaseTexImagePtr(mEGLDisplay, surface, buffer);
393 }
394 
surfaceAttrib(EGLSurface surface,EGLint attribute,EGLint value) const395 EGLBoolean FunctionsEGL::surfaceAttrib(EGLSurface surface, EGLint attribute, EGLint value) const
396 {
397     return mFnPtrs->surfaceAttribPtr(mEGLDisplay, surface, attribute, value);
398 }
399 
swapInterval(EGLint interval) const400 EGLBoolean FunctionsEGL::swapInterval(EGLint interval) const
401 {
402     return mFnPtrs->swapIntervalPtr(mEGLDisplay, interval);
403 }
404 
createImageKHR(EGLContext context,EGLenum target,EGLClientBuffer buffer,const EGLint * attrib_list) const405 EGLImageKHR FunctionsEGL::createImageKHR(EGLContext context,
406                                          EGLenum target,
407                                          EGLClientBuffer buffer,
408                                          const EGLint *attrib_list) const
409 {
410     return mFnPtrs->createImageKHRPtr(mEGLDisplay, context, target, buffer, attrib_list);
411 }
412 
destroyImageKHR(EGLImageKHR image) const413 EGLBoolean FunctionsEGL::destroyImageKHR(EGLImageKHR image) const
414 {
415     return mFnPtrs->destroyImageKHRPtr(mEGLDisplay, image);
416 }
417 
createSyncKHR(EGLenum type,const EGLint * attrib_list) const418 EGLSyncKHR FunctionsEGL::createSyncKHR(EGLenum type, const EGLint *attrib_list) const
419 {
420     return mFnPtrs->createSyncKHRPtr(mEGLDisplay, type, attrib_list);
421 }
422 
destroySyncKHR(EGLSyncKHR sync) const423 EGLBoolean FunctionsEGL::destroySyncKHR(EGLSyncKHR sync) const
424 {
425     return mFnPtrs->destroySyncKHRPtr(mEGLDisplay, sync);
426 }
427 
clientWaitSyncKHR(EGLSyncKHR sync,EGLint flags,EGLTimeKHR timeout) const428 EGLint FunctionsEGL::clientWaitSyncKHR(EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) const
429 {
430     return mFnPtrs->clientWaitSyncKHRPtr(mEGLDisplay, sync, flags, timeout);
431 }
432 
getSyncAttribKHR(EGLSyncKHR sync,EGLint attribute,EGLint * value) const433 EGLBoolean FunctionsEGL::getSyncAttribKHR(EGLSyncKHR sync, EGLint attribute, EGLint *value) const
434 {
435     return mFnPtrs->getSyncAttribKHRPtr(mEGLDisplay, sync, attribute, value);
436 }
437 
waitSyncKHR(EGLSyncKHR sync,EGLint flags) const438 EGLint FunctionsEGL::waitSyncKHR(EGLSyncKHR sync, EGLint flags) const
439 {
440     return mFnPtrs->waitSyncKHRPtr(mEGLDisplay, sync, flags);
441 }
442 
swapBuffersWithDamageKHR(EGLSurface surface,EGLint * rects,EGLint n_rects) const443 EGLBoolean FunctionsEGL::swapBuffersWithDamageKHR(EGLSurface surface,
444                                                   EGLint *rects,
445                                                   EGLint n_rects) const
446 {
447     return mFnPtrs->swapBuffersWithDamageKHRPtr(mEGLDisplay, surface, rects, n_rects);
448 }
449 
presentationTimeANDROID(EGLSurface surface,EGLnsecsANDROID time) const450 EGLBoolean FunctionsEGL::presentationTimeANDROID(EGLSurface surface, EGLnsecsANDROID time) const
451 {
452     return mFnPtrs->presentationTimeANDROIDPtr(mEGLDisplay, surface, time);
453 }
454 
setBlobCacheFuncsANDROID(EGLSetBlobFuncANDROID set,EGLGetBlobFuncANDROID get) const455 void FunctionsEGL::setBlobCacheFuncsANDROID(EGLSetBlobFuncANDROID set,
456                                             EGLGetBlobFuncANDROID get) const
457 {
458     return mFnPtrs->setBlobCacheFuncsANDROIDPtr(mEGLDisplay, set, get);
459 }
460 
getCompositorTimingSupportedANDROID(EGLSurface surface,EGLint name) const461 EGLBoolean FunctionsEGL::getCompositorTimingSupportedANDROID(EGLSurface surface, EGLint name) const
462 {
463     return mFnPtrs->getCompositorTimingSupportedANDROIDPtr(mEGLDisplay, surface, name);
464 }
465 
getCompositorTimingANDROID(EGLSurface surface,EGLint numTimestamps,const EGLint * names,EGLnsecsANDROID * values) const466 EGLBoolean FunctionsEGL::getCompositorTimingANDROID(EGLSurface surface,
467                                                     EGLint numTimestamps,
468                                                     const EGLint *names,
469                                                     EGLnsecsANDROID *values) const
470 {
471     return mFnPtrs->getCompositorTimingANDROIDPtr(mEGLDisplay, surface, numTimestamps, names,
472                                                   values);
473 }
474 
getNextFrameIdANDROID(EGLSurface surface,EGLuint64KHR * frameId) const475 EGLBoolean FunctionsEGL::getNextFrameIdANDROID(EGLSurface surface, EGLuint64KHR *frameId) const
476 {
477     return mFnPtrs->getNextFrameIdANDROIDPtr(mEGLDisplay, surface, frameId);
478 }
479 
getFrameTimestampSupportedANDROID(EGLSurface surface,EGLint timestamp) const480 EGLBoolean FunctionsEGL::getFrameTimestampSupportedANDROID(EGLSurface surface,
481                                                            EGLint timestamp) const
482 {
483     return mFnPtrs->getFrameTimestampSupportedANDROIDPtr(mEGLDisplay, surface, timestamp);
484 }
485 
getFrameTimestampsANDROID(EGLSurface surface,EGLuint64KHR frameId,EGLint numTimestamps,const EGLint * timestamps,EGLnsecsANDROID * values) const486 EGLBoolean FunctionsEGL::getFrameTimestampsANDROID(EGLSurface surface,
487                                                    EGLuint64KHR frameId,
488                                                    EGLint numTimestamps,
489                                                    const EGLint *timestamps,
490                                                    EGLnsecsANDROID *values) const
491 {
492     return mFnPtrs->getFrameTimestampsANDROIDPtr(mEGLDisplay, surface, frameId, numTimestamps,
493                                                  timestamps, values);
494 }
495 
dupNativeFenceFDANDROID(EGLSync sync) const496 EGLint FunctionsEGL::dupNativeFenceFDANDROID(EGLSync sync) const
497 {
498     return mFnPtrs->dupNativeFenceFDANDROIDPtr(mEGLDisplay, sync);
499 }
500 
501 }  // namespace rx
502