2ba344aee11d500f2ae96e1cb804e2e20c88919c
[platform/core/uifw/dali-adaptor.git] / dali / internal / graphics / gles / gl-implementation.h
1 #ifndef DALI_INTERNAL_GL_IMPLEMENTATION_H
2 #define DALI_INTERNAL_GL_IMPLEMENTATION_H
3
4 /*
5  * Copyright (c) 2022 Samsung Electronics Co., Ltd.
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18  *
19  */
20
21 // EXTERNAL INCLUDES
22 #include <GLES2/gl2.h>
23 #include <GLES2/gl2ext.h>
24 #include <dali/devel-api/threading/conditional-wait.h>
25 #include <dali/integration-api/gl-abstraction.h>
26 #include <dali/internal/graphics/common/egl-include.h>
27 #include <dali/public-api/common/vector-wrapper.h>
28 #include <cstdlib>
29 #include <cstring>
30 #include <memory>
31
32 // INTERNAL INCLUDES
33 #include <dali/internal/graphics/gles/gl-extensions-support.h>
34 #include <dali/internal/graphics/gles/gles-abstraction.h>
35 #include <dali/internal/graphics/gles/gles2-implementation.h>
36 #include <dali/internal/graphics/gles/gles3-implementation.h>
37
38 namespace Dali
39 {
40 namespace Internal
41 {
42 namespace Adaptor
43 {
44 namespace
45 {
46 static constexpr int32_t     INITIAL_GLES_VERSION                         = 30;
47 static constexpr int32_t     GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED = 32;
48 static constexpr const char* LEGACY_SHADING_LANGUAGE_VERSION              = "100";
49
50 static constexpr const char* DEFAULT_SAMPLER_TYPE = "sampler2D";
51
52 static constexpr const char* FRAGMENT_SHADER_ADVANCED_BLEND_EQUATION_PREFIX =
53   "#ifdef GL_KHR_blend_equation_advanced\n"
54   "#extension GL_KHR_blend_equation_advanced : enable\n"
55   "#endif\n"
56
57   "#if defined(GL_KHR_blend_equation_advanced) || __VERSION__>=320\n"
58   "  layout(blend_support_all_equations) out;\n"
59   "#endif\n";
60
61 static constexpr const char* FRAGMENT_SHADER_OUTPUT_COLOR_STRING =
62   "out mediump vec4 fragColor;\n";
63
64 static constexpr const char* OES_EGL_IMAGE_EXTERNAL_STRING = "#extension GL_OES_EGL_image_external:require\n";
65
66 static constexpr const char* OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3 = "#extension GL_OES_EGL_image_external_essl3:require\n";
67
68 } // namespace
69
70 /**
71  * GlImplementation is a concrete implementation for GlAbstraction.
72  * The class provides an OpenGL-ES 2.0 or 3.0 implementation.
73  * The class is provided when creating the Integration::Core object.
74  */
75 class GlImplementation : public Dali::Integration::GlAbstraction
76 {
77 public:
78   GlImplementation()
79   : mGlExtensionSupportedCacheList(),
80     mContextCreatedWaitCondition(),
81     mMaxTextureSize(0),
82     mMaxTextureSamples(0),
83     mVertexShaderPrefix(""),
84     mGlesVersion(INITIAL_GLES_VERSION),
85     mShadingLanguageVersion(100),
86     mShadingLanguageVersionCached(false),
87     mIsSurfacelessContextSupported(false),
88     mIsContextCreated(false)
89   {
90     mImpl.reset(new Gles3Implementation());
91   }
92
93   virtual ~GlImplementation()
94   {
95   }
96
97   void PreRender() override
98   {
99     /* Do nothing in main implementation */
100   }
101
102   void PostRender() override
103   {
104     /* Do nothing in main implementation */
105   }
106
107   void ContextCreated()
108   {
109     glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mMaxTextureSize);
110
111     // Only change gles version for the device that support above gles 3.0.
112     if(mGlesVersion >= INITIAL_GLES_VERSION)
113     {
114       GLint majorVersion, minorVersion;
115       glGetIntegerv(GL_MAJOR_VERSION, &majorVersion);
116       glGetIntegerv(GL_MINOR_VERSION, &minorVersion);
117       mGlesVersion = majorVersion * 10 + minorVersion;
118     }
119
120     if(mGlesVersion >= GLES_VERSION_SUPPORT_BLEND_EQUATION_ADVANCED)
121     {
122       SetIsAdvancedBlendEquationSupported(true);
123     }
124
125     if(mGlExtensionSupportedCacheList.NeedFullCheck())
126     {
127       // fully check gl extensions if we miss some extension supported
128       mGlExtensionSupportedCacheList.EnsureGlExtensionSupportedCheck();
129     }
130
131     if(IsMultisampledRenderToTextureSupported())
132     {
133       glGetIntegerv(GL_MAX_SAMPLES_EXT, &mMaxTextureSamples);
134     }
135
136     if(!mShadingLanguageVersionCached)
137     {
138       std::istringstream shadingLanguageVersionStream(reinterpret_cast<const char*>(glGetString(GL_SHADING_LANGUAGE_VERSION)));
139       std::string        token;
140       uint32_t           tokenCount = 0;
141       while(std::getline(shadingLanguageVersionStream, token, ' '))
142       {
143         if(tokenCount == 3 && token == "ES")
144         {
145           std::getline(shadingLanguageVersionStream, token, '.');
146           mShadingLanguageVersion = std::atoi(token.c_str());
147           mShadingLanguageVersion *= 100;
148           std::getline(shadingLanguageVersionStream, token, '.');
149           mShadingLanguageVersion += std::atoi(token.c_str());
150           break;
151         }
152         tokenCount++;
153       }
154     }
155
156     {
157       ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
158       mIsContextCreated = true;
159       mContextCreatedWaitCondition.Notify(lock);
160     }
161   }
162
163   void SetGlesVersion(const int32_t glesVersion)
164   {
165     if(mGlesVersion / 10 != glesVersion / 10)
166     {
167       mGlesVersion = glesVersion;
168       if(mGlesVersion >= 30)
169       {
170         mImpl.reset(new Gles3Implementation());
171       }
172       else
173       {
174         mImpl.reset(new Gles2Implementation());
175       }
176     }
177   }
178
179   void SetIsSurfacelessContextSupported(const bool isSupported)
180   {
181     mIsSurfacelessContextSupported = isSupported;
182   }
183
184   bool IsSurfacelessContextSupported() const override
185   {
186     return mIsSurfacelessContextSupported;
187   }
188
189   void SetIsAdvancedBlendEquationSupported(const bool isSupported)
190   {
191     mGlExtensionSupportedCacheList.SetSupported(GlExtensionCache::GlExtensionCheckerType::BLEND_EQUATION_ADVANCED, isSupported);
192   }
193
194   bool IsAdvancedBlendEquationSupported()
195   {
196     ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
197
198     const auto type = GlExtensionCache::GlExtensionCheckerType::BLEND_EQUATION_ADVANCED;
199     if(!mIsContextCreated && !mGlExtensionSupportedCacheList.GetCached(type))
200     {
201       mContextCreatedWaitCondition.Wait(lock);
202     }
203     return mGlExtensionSupportedCacheList.GetSupported(type);
204   }
205
206   void SetIsMultisampledRenderToTextureSupported(const bool isSupported)
207   {
208     mGlExtensionSupportedCacheList.SetSupported(GlExtensionCache::GlExtensionCheckerType::MULTISAMPLED_RENDER_TO_TEXTURE, isSupported);
209   }
210
211   bool IsMultisampledRenderToTextureSupported()
212   {
213     ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
214
215     const auto type = GlExtensionCache::GlExtensionCheckerType::MULTISAMPLED_RENDER_TO_TEXTURE;
216     if(!mIsContextCreated && !mGlExtensionSupportedCacheList.GetCached(type))
217     {
218       mContextCreatedWaitCondition.Wait(lock);
219     }
220     return mGlExtensionSupportedCacheList.GetSupported(type);
221   }
222
223   bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation)
224   {
225     switch(blendEquation)
226     {
227       case DevelBlendEquation::ADD:
228       case DevelBlendEquation::SUBTRACT:
229       case DevelBlendEquation::REVERSE_SUBTRACT:
230       {
231         return true;
232       }
233       case DevelBlendEquation::MIN:
234       case DevelBlendEquation::MAX:
235       {
236         return (GetGlesVersion() >= 30);
237       }
238       case DevelBlendEquation::MULTIPLY:
239       case DevelBlendEquation::SCREEN:
240       case DevelBlendEquation::OVERLAY:
241       case DevelBlendEquation::DARKEN:
242       case DevelBlendEquation::LIGHTEN:
243       case DevelBlendEquation::COLOR_DODGE:
244       case DevelBlendEquation::COLOR_BURN:
245       case DevelBlendEquation::HARD_LIGHT:
246       case DevelBlendEquation::SOFT_LIGHT:
247       case DevelBlendEquation::DIFFERENCE:
248       case DevelBlendEquation::EXCLUSION:
249       case DevelBlendEquation::HUE:
250       case DevelBlendEquation::SATURATION:
251       case DevelBlendEquation::COLOR:
252       case DevelBlendEquation::LUMINOSITY:
253       {
254         return IsAdvancedBlendEquationSupported();
255       }
256
257       default:
258       {
259         return false;
260       }
261     }
262
263     return false;
264   }
265
266   std::string GetShaderVersionPrefix()
267   {
268     if(mShaderVersionPrefix == "")
269     {
270       mShaderVersionPrefix = "#version " + std::to_string(GetShadingLanguageVersion());
271       if(GetShadingLanguageVersion() < 300)
272       {
273         mShaderVersionPrefix += "\n";
274       }
275       else
276       {
277         mShaderVersionPrefix += " es\n";
278       }
279     }
280     return mShaderVersionPrefix;
281   }
282
283   std::string GetVertexShaderPrefix()
284   {
285     if(mVertexShaderPrefix == "")
286     {
287       mVertexShaderPrefix = GetShaderVersionPrefix();
288
289       if(GetShadingLanguageVersion() < 300)
290       {
291         mVertexShaderPrefix += "#define INPUT attribute\n";
292         mVertexShaderPrefix += "#define OUTPUT varying\n";
293       }
294       else
295       {
296         mVertexShaderPrefix += "#define INPUT in\n";
297         mVertexShaderPrefix += "#define OUTPUT out\n";
298       }
299     }
300     return mVertexShaderPrefix;
301   }
302
303   std::string GetFragmentShaderPrefix()
304   {
305     if(mFragmentShaderPrefix == "")
306     {
307       mFragmentShaderPrefix = GetShaderVersionPrefix();
308
309       if(GetShadingLanguageVersion() < 300)
310       {
311         mFragmentShaderPrefix += "#define INPUT varying\n";
312         mFragmentShaderPrefix += "#define OUT_COLOR gl_FragColor\n";
313         mFragmentShaderPrefix += "#define TEXTURE texture2D\n";
314       }
315       else
316       {
317         mFragmentShaderPrefix += "#define INPUT in\n";
318         mFragmentShaderPrefix += "#define OUT_COLOR fragColor\n";
319         mFragmentShaderPrefix += "#define TEXTURE texture\n";
320
321         if(IsAdvancedBlendEquationSupported())
322         {
323           mFragmentShaderPrefix += FRAGMENT_SHADER_ADVANCED_BLEND_EQUATION_PREFIX;
324         }
325
326         mFragmentShaderPrefix += FRAGMENT_SHADER_OUTPUT_COLOR_STRING;
327       }
328     }
329     return mFragmentShaderPrefix;
330   }
331
332   bool TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const override
333   {
334     bool convert = ((imageGlFormat == GL_RGB) && (textureGlFormat == GL_RGBA));
335     if(mGlesVersion >= 30)
336     {
337       // Don't convert manually from RGB to RGBA if GLES >= 3.0 and a sub-image is uploaded.
338       convert = (convert && !isSubImage);
339     }
340     return convert;
341   }
342
343   int GetMaxTextureSize()
344   {
345     ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
346     if(!mIsContextCreated)
347     {
348       mContextCreatedWaitCondition.Wait(lock);
349     }
350     return mMaxTextureSize;
351   }
352
353   int GetMaxTextureSamples()
354   {
355     ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
356     if(!mIsContextCreated)
357     {
358       mContextCreatedWaitCondition.Wait(lock);
359     }
360     return mMaxTextureSamples;
361   }
362
363   int GetGlesVersion()
364   {
365     ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
366     if(!mIsContextCreated)
367     {
368       mContextCreatedWaitCondition.Wait(lock);
369     }
370     return mGlesVersion;
371   }
372
373   void SetShadingLanguageVersion(int shadingLanguageVersion)
374   {
375     mShadingLanguageVersion       = shadingLanguageVersion;
376     mShadingLanguageVersionCached = true;
377   }
378
379   int GetShadingLanguageVersion()
380   {
381     ConditionalWait::ScopedLock lock(mContextCreatedWaitCondition);
382     if(!mIsContextCreated && !mShadingLanguageVersionCached)
383     {
384       mContextCreatedWaitCondition.Wait(lock);
385     }
386     return mShadingLanguageVersion;
387   }
388
389   bool ApplyNativeFragmentShader(std::string& shader, const char* customSamplerType)
390   {
391     bool        modified        = false;
392     std::string versionString   = "#version";
393     size_t      versionPosition = shader.find(versionString);
394     if(versionPosition != std::string::npos)
395     {
396       std::string extensionString;
397       size_t      shadingLanguageVersionPosition = shader.find_first_not_of(" \t", versionPosition + versionString.length());
398       if(shadingLanguageVersionPosition != std::string::npos &&
399          shader.substr(shadingLanguageVersionPosition, 3) == LEGACY_SHADING_LANGUAGE_VERSION)
400       {
401         extensionString = OES_EGL_IMAGE_EXTERNAL_STRING;
402       }
403       else
404       {
405         extensionString = OES_EGL_IMAGE_EXTERNAL_STRING_ESSL3;
406       }
407
408       if(shader.find(extensionString) == std::string::npos)
409       {
410         modified                 = true;
411         size_t extensionPosition = shader.find_first_of("\n", versionPosition) + 1;
412         shader.insert(extensionPosition, extensionString);
413       }
414     }
415     else
416     {
417       if(shader.find(OES_EGL_IMAGE_EXTERNAL_STRING) == std::string::npos)
418       {
419         modified = true;
420         shader   = OES_EGL_IMAGE_EXTERNAL_STRING + shader;
421       }
422     }
423
424     if(shader.find(customSamplerType) == std::string::npos)
425     {
426       size_t pos = shader.find(DEFAULT_SAMPLER_TYPE);
427       if(pos != std::string::npos)
428       {
429         modified = true;
430         shader.replace(pos, strlen(DEFAULT_SAMPLER_TYPE), customSamplerType);
431       }
432     }
433
434     return modified;
435   }
436
437   /* OpenGL ES 2.0 */
438
439   void ActiveTexture(GLenum texture) override
440   {
441     glActiveTexture(texture);
442   }
443
444   void AttachShader(GLuint program, GLuint shader) override
445   {
446     glAttachShader(program, shader);
447   }
448
449   void BindAttribLocation(GLuint program, GLuint index, const char* name) override
450   {
451     glBindAttribLocation(program, index, name);
452   }
453
454   void BindBuffer(GLenum target, GLuint buffer) override
455   {
456     glBindBuffer(target, buffer);
457   }
458
459   void BindFramebuffer(GLenum target, GLuint framebuffer) override
460   {
461     glBindFramebuffer(target, framebuffer);
462   }
463
464   void BindRenderbuffer(GLenum target, GLuint renderbuffer) override
465   {
466     glBindRenderbuffer(target, renderbuffer);
467   }
468
469   void BindTexture(GLenum target, GLuint texture) override
470   {
471     glBindTexture(target, texture);
472   }
473
474   void BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) override
475   {
476     glBlendColor(red, green, blue, alpha);
477   }
478
479   void BlendEquation(GLenum mode) override
480   {
481     glBlendEquation(mode);
482   }
483
484   void BlendEquationSeparate(GLenum modeRGB, GLenum modeAlpha) override
485   {
486     glBlendEquationSeparate(modeRGB, modeAlpha);
487   }
488
489   void BlendFunc(GLenum sfactor, GLenum dfactor) override
490   {
491     glBlendFunc(sfactor, dfactor);
492   }
493
494   void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) override
495   {
496     glBlendFuncSeparate(srcRGB, dstRGB, srcAlpha, dstAlpha);
497   }
498
499   void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage) override
500   {
501     glBufferData(target, size, data, usage);
502   }
503
504   void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data) override
505   {
506     glBufferSubData(target, offset, size, data);
507   }
508
509   GLenum CheckFramebufferStatus(GLenum target) override
510   {
511     return glCheckFramebufferStatus(target);
512   }
513
514   void Clear(GLbitfield mask) override
515   {
516     glClear(mask);
517   }
518
519   void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) override
520   {
521     glClearColor(red, green, blue, alpha);
522   }
523
524   void ClearDepthf(GLclampf depth) override
525   {
526     glClearDepthf(depth);
527   }
528
529   void ClearStencil(GLint s) override
530   {
531     glClearStencil(s);
532   }
533
534   void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha) override
535   {
536     glColorMask(red, green, blue, alpha);
537   }
538
539   void CompileShader(GLuint shader) override
540   {
541     glCompileShader(shader);
542   }
543
544   void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data) override
545   {
546     glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data);
547   }
548
549   void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data) override
550   {
551     glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data);
552   }
553
554   void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border) override
555   {
556     glCopyTexImage2D(target, level, internalformat, x, y, width, height, border);
557   }
558
559   void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) override
560   {
561     glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height);
562   }
563
564   GLuint CreateProgram(void) override
565   {
566     return glCreateProgram();
567   }
568
569   GLuint CreateShader(GLenum type) override
570   {
571     return glCreateShader(type);
572   }
573
574   void CullFace(GLenum mode) override
575   {
576     glCullFace(mode);
577   }
578
579   void DeleteBuffers(GLsizei n, const GLuint* buffers) override
580   {
581     glDeleteBuffers(n, buffers);
582   }
583
584   void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers) override
585   {
586     glDeleteFramebuffers(n, framebuffers);
587   }
588
589   void DeleteProgram(GLuint program) override
590   {
591     glDeleteProgram(program);
592   }
593
594   void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers) override
595   {
596     glDeleteRenderbuffers(n, renderbuffers);
597   }
598
599   void DeleteShader(GLuint shader) override
600   {
601     glDeleteShader(shader);
602   }
603
604   void DeleteTextures(GLsizei n, const GLuint* textures) override
605   {
606     glDeleteTextures(n, textures);
607   }
608
609   void DepthFunc(GLenum func) override
610   {
611     glDepthFunc(func);
612   }
613
614   void DepthMask(GLboolean flag) override
615   {
616     glDepthMask(flag);
617   }
618
619   void DepthRangef(GLclampf zNear, GLclampf zFar) override
620   {
621     glDepthRangef(zNear, zFar);
622   }
623
624   void DetachShader(GLuint program, GLuint shader) override
625   {
626     glDetachShader(program, shader);
627   }
628
629   void Disable(GLenum cap) override
630   {
631     glDisable(cap);
632   }
633
634   void DisableVertexAttribArray(GLuint index) override
635   {
636     glDisableVertexAttribArray(index);
637   }
638
639   void DrawArrays(GLenum mode, GLint first, GLsizei count) override
640   {
641     glDrawArrays(mode, first, count);
642   }
643
644   void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices) override
645   {
646     glDrawElements(mode, count, type, indices);
647   }
648
649   void Enable(GLenum cap) override
650   {
651     glEnable(cap);
652   }
653
654   void EnableVertexAttribArray(GLuint index) override
655   {
656     glEnableVertexAttribArray(index);
657   }
658
659   void Finish(void) override
660   {
661     glFinish();
662   }
663
664   void Flush(void) override
665   {
666     glFlush();
667   }
668
669   void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) override
670   {
671     glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
672   }
673
674   void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) override
675   {
676     glFramebufferTexture2D(target, attachment, textarget, texture, level);
677   }
678
679   void FrontFace(GLenum mode) override
680   {
681     glFrontFace(mode);
682   }
683
684   void GenBuffers(GLsizei n, GLuint* buffers) override
685   {
686     glGenBuffers(n, buffers);
687   }
688
689   void GenerateMipmap(GLenum target) override
690   {
691     glGenerateMipmap(target);
692   }
693
694   void GenFramebuffers(GLsizei n, GLuint* framebuffers) override
695   {
696     glGenFramebuffers(n, framebuffers);
697   }
698
699   void GenRenderbuffers(GLsizei n, GLuint* renderbuffers) override
700   {
701     glGenRenderbuffers(n, renderbuffers);
702   }
703
704   void GenTextures(GLsizei n, GLuint* textures) override
705   {
706     glGenTextures(n, textures);
707   }
708
709   void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) override
710   {
711     glGetActiveAttrib(program, index, bufsize, length, size, type, name);
712   }
713
714   void GetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) override
715   {
716     glGetActiveUniform(program, index, bufsize, length, size, type, name);
717   }
718
719   void GetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) override
720   {
721     glGetAttachedShaders(program, maxcount, count, shaders);
722   }
723
724   int GetAttribLocation(GLuint program, const char* name) override
725   {
726     return glGetAttribLocation(program, name);
727   }
728
729   void GetBooleanv(GLenum pname, GLboolean* params) override
730   {
731     glGetBooleanv(pname, params);
732   }
733
734   void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params) override
735   {
736     glGetBufferParameteriv(target, pname, params);
737   }
738
739   GLenum GetError(void) override
740   {
741     return glGetError();
742   }
743
744   void GetFloatv(GLenum pname, GLfloat* params) override
745   {
746     glGetFloatv(pname, params);
747   }
748
749   void GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params) override
750   {
751     glGetFramebufferAttachmentParameteriv(target, attachment, pname, params);
752   }
753
754   void GetIntegerv(GLenum pname, GLint* params) override
755   {
756     glGetIntegerv(pname, params);
757   }
758
759   void GetProgramiv(GLuint program, GLenum pname, GLint* params) override
760   {
761     glGetProgramiv(program, pname, params);
762   }
763
764   void GetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog) override
765   {
766     glGetProgramInfoLog(program, bufsize, length, infolog);
767   }
768
769   void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params) override
770   {
771     glGetRenderbufferParameteriv(target, pname, params);
772   }
773
774   void GetShaderiv(GLuint shader, GLenum pname, GLint* params) override
775   {
776     glGetShaderiv(shader, pname, params);
777   }
778
779   void GetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog) override
780   {
781     glGetShaderInfoLog(shader, bufsize, length, infolog);
782   }
783
784   void GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision) override
785   {
786     glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision);
787   }
788
789   void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source) override
790   {
791     glGetShaderSource(shader, bufsize, length, source);
792   }
793
794   const GLubyte* GetString(GLenum name) override
795   {
796     return glGetString(name);
797   }
798
799   void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params) override
800   {
801     glGetTexParameterfv(target, pname, params);
802   }
803
804   void GetTexParameteriv(GLenum target, GLenum pname, GLint* params) override
805   {
806     glGetTexParameteriv(target, pname, params);
807   }
808
809   void GetUniformfv(GLuint program, GLint location, GLfloat* params) override
810   {
811     glGetUniformfv(program, location, params);
812   }
813
814   void GetUniformiv(GLuint program, GLint location, GLint* params) override
815   {
816     glGetUniformiv(program, location, params);
817   }
818
819   int GetUniformLocation(GLuint program, const char* name) override
820   {
821     return glGetUniformLocation(program, name);
822   }
823
824   void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params) override
825   {
826     glGetVertexAttribfv(index, pname, params);
827   }
828
829   void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params) override
830   {
831     glGetVertexAttribiv(index, pname, params);
832   }
833
834   void GetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer) override
835   {
836     glGetVertexAttribPointerv(index, pname, pointer);
837   }
838
839   void Hint(GLenum target, GLenum mode) override
840   {
841     glHint(target, mode);
842   }
843
844   GLboolean IsBuffer(GLuint buffer) override
845   {
846     return glIsBuffer(buffer);
847   }
848
849   GLboolean IsEnabled(GLenum cap) override
850   {
851     return glIsEnabled(cap);
852   }
853
854   GLboolean IsFramebuffer(GLuint framebuffer) override
855   {
856     return glIsFramebuffer(framebuffer);
857   }
858
859   GLboolean IsProgram(GLuint program) override
860   {
861     return glIsProgram(program);
862   }
863
864   GLboolean IsRenderbuffer(GLuint renderbuffer) override
865   {
866     return glIsRenderbuffer(renderbuffer);
867   }
868
869   GLboolean IsShader(GLuint shader) override
870   {
871     return glIsShader(shader);
872   }
873
874   GLboolean IsTexture(GLuint texture) override
875   {
876     return glIsTexture(texture);
877   }
878
879   void LineWidth(GLfloat width) override
880   {
881     glLineWidth(width);
882   }
883
884   void LinkProgram(GLuint program) override
885   {
886     glLinkProgram(program);
887   }
888
889   void PixelStorei(GLenum pname, GLint param) override
890   {
891     glPixelStorei(pname, param);
892   }
893
894   void PolygonOffset(GLfloat factor, GLfloat units) override
895   {
896     glPolygonOffset(factor, units);
897   }
898
899   void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels) override
900   {
901     glReadPixels(x, y, width, height, format, type, pixels);
902   }
903
904   void ReleaseShaderCompiler(void) override
905   {
906     glReleaseShaderCompiler();
907   }
908
909   void RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) override
910   {
911     glRenderbufferStorage(target, internalformat, width, height);
912   }
913
914   void SampleCoverage(GLclampf value, GLboolean invert) override
915   {
916     glSampleCoverage(value, invert);
917   }
918
919   void Scissor(GLint x, GLint y, GLsizei width, GLsizei height) override
920   {
921     glScissor(x, y, width, height);
922   }
923
924   void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length) override
925   {
926     glShaderBinary(n, shaders, binaryformat, binary, length);
927   }
928
929   void ShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length) override
930   {
931     glShaderSource(shader, count, string, length);
932   }
933
934   void StencilFunc(GLenum func, GLint ref, GLuint mask) override
935   {
936     glStencilFunc(func, ref, mask);
937   }
938
939   void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) override
940   {
941     glStencilFuncSeparate(face, func, ref, mask);
942   }
943
944   void StencilMask(GLuint mask) override
945   {
946     glStencilMask(mask);
947   }
948
949   void StencilMaskSeparate(GLenum face, GLuint mask) override
950   {
951     glStencilMaskSeparate(face, mask);
952   }
953
954   void StencilOp(GLenum fail, GLenum zfail, GLenum zpass) override
955   {
956     glStencilOp(fail, zfail, zpass);
957   }
958
959   void StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) override
960   {
961     glStencilOpSeparate(face, fail, zfail, zpass);
962   }
963
964   void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels) override
965   {
966     glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels);
967   }
968
969   void TexParameterf(GLenum target, GLenum pname, GLfloat param) override
970   {
971     glTexParameterf(target, pname, param);
972   }
973
974   void TexParameterfv(GLenum target, GLenum pname, const GLfloat* params) override
975   {
976     glTexParameterfv(target, pname, params);
977   }
978
979   void TexParameteri(GLenum target, GLenum pname, GLint param) override
980   {
981     glTexParameteri(target, pname, param);
982   }
983
984   void TexParameteriv(GLenum target, GLenum pname, const GLint* params) override
985   {
986     glTexParameteriv(target, pname, params);
987   }
988
989   void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels) override
990   {
991     glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels);
992   }
993
994   void Uniform1f(GLint location, GLfloat x) override
995   {
996     glUniform1f(location, x);
997   }
998
999   void Uniform1fv(GLint location, GLsizei count, const GLfloat* v) override
1000   {
1001     glUniform1fv(location, count, v);
1002   }
1003
1004   void Uniform1i(GLint location, GLint x) override
1005   {
1006     glUniform1i(location, x);
1007   }
1008
1009   void Uniform1iv(GLint location, GLsizei count, const GLint* v) override
1010   {
1011     glUniform1iv(location, count, v);
1012   }
1013
1014   void Uniform2f(GLint location, GLfloat x, GLfloat y) override
1015   {
1016     glUniform2f(location, x, y);
1017   }
1018
1019   void Uniform2fv(GLint location, GLsizei count, const GLfloat* v) override
1020   {
1021     glUniform2fv(location, count, v);
1022   }
1023
1024   void Uniform2i(GLint location, GLint x, GLint y) override
1025   {
1026     glUniform2i(location, x, y);
1027   }
1028
1029   void Uniform2iv(GLint location, GLsizei count, const GLint* v) override
1030   {
1031     glUniform2iv(location, count, v);
1032   }
1033
1034   void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z) override
1035   {
1036     glUniform3f(location, x, y, z);
1037   }
1038
1039   void Uniform3fv(GLint location, GLsizei count, const GLfloat* v) override
1040   {
1041     glUniform3fv(location, count, v);
1042   }
1043
1044   void Uniform3i(GLint location, GLint x, GLint y, GLint z) override
1045   {
1046     glUniform3i(location, x, y, z);
1047   }
1048
1049   void Uniform3iv(GLint location, GLsizei count, const GLint* v) override
1050   {
1051     glUniform3iv(location, count, v);
1052   }
1053
1054   void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) override
1055   {
1056     glUniform4f(location, x, y, z, w);
1057   }
1058
1059   void Uniform4fv(GLint location, GLsizei count, const GLfloat* v) override
1060   {
1061     glUniform4fv(location, count, v);
1062   }
1063
1064   void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w) override
1065   {
1066     glUniform4i(location, x, y, z, w);
1067   }
1068
1069   void Uniform4iv(GLint location, GLsizei count, const GLint* v) override
1070   {
1071     glUniform4iv(location, count, v);
1072   }
1073
1074   void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1075   {
1076     glUniformMatrix2fv(location, count, transpose, value);
1077   }
1078
1079   void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1080   {
1081     glUniformMatrix3fv(location, count, transpose, value);
1082   }
1083
1084   void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1085   {
1086     glUniformMatrix4fv(location, count, transpose, value);
1087   }
1088
1089   void UseProgram(GLuint program) override
1090   {
1091     glUseProgram(program);
1092   }
1093
1094   void ValidateProgram(GLuint program) override
1095   {
1096     glValidateProgram(program);
1097   }
1098
1099   void VertexAttrib1f(GLuint indx, GLfloat x) override
1100   {
1101     glVertexAttrib1f(indx, x);
1102   }
1103
1104   void VertexAttrib1fv(GLuint indx, const GLfloat* values) override
1105   {
1106     glVertexAttrib1fv(indx, values);
1107   }
1108
1109   void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y) override
1110   {
1111     glVertexAttrib2f(indx, x, y);
1112   }
1113
1114   void VertexAttrib2fv(GLuint indx, const GLfloat* values) override
1115   {
1116     glVertexAttrib2fv(indx, values);
1117   }
1118
1119   void VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z) override
1120   {
1121     glVertexAttrib3f(indx, x, y, z);
1122   }
1123
1124   void VertexAttrib3fv(GLuint indx, const GLfloat* values) override
1125   {
1126     glVertexAttrib3fv(indx, values);
1127   }
1128
1129   void VertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w) override
1130   {
1131     glVertexAttrib4f(indx, x, y, z, w);
1132   }
1133
1134   void VertexAttrib4fv(GLuint indx, const GLfloat* values) override
1135   {
1136     glVertexAttrib4fv(indx, values);
1137   }
1138
1139   void VertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr) override
1140   {
1141     glVertexAttribPointer(indx, size, type, normalized, stride, ptr);
1142   }
1143
1144   void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override
1145   {
1146     glViewport(x, y, width, height);
1147   }
1148
1149   /* OpenGL ES 3.0 */
1150
1151   void ReadBuffer(GLenum mode) override
1152   {
1153     mImpl->ReadBuffer(mode);
1154   }
1155
1156   void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices) override
1157   {
1158     mImpl->DrawRangeElements(mode, start, end, count, type, indices);
1159   }
1160
1161   void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels) override
1162   {
1163     mImpl->TexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels);
1164   }
1165
1166   void TexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels) override
1167   {
1168     mImpl->TexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels);
1169   }
1170
1171   void CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height) override
1172   {
1173     mImpl->CopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height);
1174   }
1175
1176   void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data) override
1177   {
1178     mImpl->CompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data);
1179   }
1180
1181   void CompressedTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data) override
1182   {
1183     mImpl->CompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
1184   }
1185
1186   void GenQueries(GLsizei n, GLuint* ids) override
1187   {
1188     mImpl->GenQueries(n, ids);
1189   }
1190
1191   void DeleteQueries(GLsizei n, const GLuint* ids) override
1192   {
1193     mImpl->DeleteQueries(n, ids);
1194   }
1195
1196   GLboolean IsQuery(GLuint id) override
1197   {
1198     return mImpl->IsQuery(id);
1199   }
1200
1201   void BeginQuery(GLenum target, GLuint id) override
1202   {
1203     mImpl->BeginQuery(target, id);
1204   }
1205
1206   void EndQuery(GLenum target) override
1207   {
1208     mImpl->EndQuery(target);
1209   }
1210
1211   void GetQueryiv(GLenum target, GLenum pname, GLint* params) override
1212   {
1213     mImpl->GetQueryiv(target, pname, params);
1214   }
1215
1216   void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params) override
1217   {
1218     mImpl->GetQueryObjectuiv(id, pname, params);
1219   }
1220
1221   GLboolean UnmapBuffer(GLenum target) override
1222   {
1223     return mImpl->UnmapBuffer(target);
1224   }
1225
1226   void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params) override
1227   {
1228     mImpl->GetBufferPointerv(target, pname, params);
1229   }
1230
1231   void DrawBuffers(GLsizei n, const GLenum* bufs) override
1232   {
1233     mImpl->DrawBuffers(n, bufs);
1234   }
1235
1236   void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1237   {
1238     mImpl->UniformMatrix2x3fv(location, count, transpose, value);
1239   }
1240
1241   void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1242   {
1243     mImpl->UniformMatrix3x2fv(location, count, transpose, value);
1244   }
1245
1246   void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1247   {
1248     mImpl->UniformMatrix2x4fv(location, count, transpose, value);
1249   }
1250
1251   void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1252   {
1253     mImpl->UniformMatrix4x2fv(location, count, transpose, value);
1254   }
1255
1256   void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1257   {
1258     mImpl->UniformMatrix3x4fv(location, count, transpose, value);
1259   }
1260
1261   void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value) override
1262   {
1263     mImpl->UniformMatrix4x3fv(location, count, transpose, value);
1264   }
1265
1266   void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) override
1267   {
1268     mImpl->BlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
1269   }
1270
1271   void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height) override
1272   {
1273     mImpl->RenderbufferStorageMultisample(target, samples, internalformat, width, height);
1274   }
1275
1276   void FramebufferTexture2DMultisample(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples) override
1277   {
1278     mImpl->FramebufferTexture2DMultisample(target, attachment, textarget, texture, level, samples);
1279   }
1280
1281   void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer) override
1282   {
1283     mImpl->FramebufferTextureLayer(target, attachment, texture, level, layer);
1284   }
1285
1286   GLvoid* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access) override
1287   {
1288     return mImpl->MapBufferRange(target, offset, length, access);
1289   }
1290
1291   void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length) override
1292   {
1293     mImpl->FlushMappedBufferRange(target, offset, length);
1294   }
1295
1296   void BindVertexArray(GLuint array) override
1297   {
1298     mImpl->BindVertexArray(array);
1299   }
1300
1301   void DeleteVertexArrays(GLsizei n, const GLuint* arrays) override
1302   {
1303     mImpl->DeleteVertexArrays(n, arrays);
1304   }
1305
1306   void GenVertexArrays(GLsizei n, GLuint* arrays) override
1307   {
1308     mImpl->GenVertexArrays(n, arrays);
1309   }
1310
1311   GLboolean IsVertexArray(GLuint array) override
1312   {
1313     return mImpl->IsVertexArray(array);
1314   }
1315
1316   void GetIntegeri_v(GLenum target, GLuint index, GLint* data) override
1317   {
1318     mImpl->GetIntegeri_v(target, index, data);
1319   }
1320
1321   void BeginTransformFeedback(GLenum primitiveMode) override
1322   {
1323     mImpl->BeginTransformFeedback(primitiveMode);
1324   }
1325
1326   void EndTransformFeedback(void) override
1327   {
1328     mImpl->EndTransformFeedback();
1329   }
1330
1331   void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size) override
1332   {
1333     mImpl->BindBufferRange(target, index, buffer, offset, size);
1334   }
1335
1336   void BindBufferBase(GLenum target, GLuint index, GLuint buffer) override
1337   {
1338     mImpl->BindBufferBase(target, index, buffer);
1339   }
1340
1341   void TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode) override
1342   {
1343     mImpl->TransformFeedbackVaryings(program, count, varyings, bufferMode);
1344   }
1345
1346   void GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name) override
1347   {
1348     mImpl->GetTransformFeedbackVarying(program, index, bufSize, length, size, type, name);
1349   }
1350
1351   void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) override
1352   {
1353     mImpl->VertexAttribIPointer(index, size, type, stride, pointer);
1354   }
1355
1356   void GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params) override
1357   {
1358     mImpl->GetVertexAttribIiv(index, pname, params);
1359   }
1360
1361   void GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params) override
1362   {
1363     mImpl->GetVertexAttribIuiv(index, pname, params);
1364   }
1365
1366   void VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w) override
1367   {
1368     mImpl->VertexAttribI4i(index, x, y, z, w);
1369   }
1370
1371   void VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w) override
1372   {
1373     mImpl->VertexAttribI4ui(index, x, y, z, w);
1374   }
1375
1376   void VertexAttribI4iv(GLuint index, const GLint* v) override
1377   {
1378     mImpl->VertexAttribI4iv(index, v);
1379   }
1380
1381   void VertexAttribI4uiv(GLuint index, const GLuint* v) override
1382   {
1383     mImpl->VertexAttribI4uiv(index, v);
1384   }
1385
1386   void GetUniformuiv(GLuint program, GLint location, GLuint* params) override
1387   {
1388     mImpl->GetUniformuiv(program, location, params);
1389   }
1390
1391   GLint GetFragDataLocation(GLuint program, const GLchar* name) override
1392   {
1393     return mImpl->GetFragDataLocation(program, name);
1394   }
1395
1396   void Uniform1ui(GLint location, GLuint v0) override
1397   {
1398     mImpl->Uniform1ui(location, v0);
1399   }
1400
1401   void Uniform2ui(GLint location, GLuint v0, GLuint v1) override
1402   {
1403     mImpl->Uniform2ui(location, v0, v1);
1404   }
1405
1406   void Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2) override
1407   {
1408     mImpl->Uniform3ui(location, v0, v1, v2);
1409   }
1410
1411   void Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3) override
1412   {
1413     mImpl->Uniform4ui(location, v0, v1, v2, v3);
1414   }
1415
1416   void Uniform1uiv(GLint location, GLsizei count, const GLuint* value) override
1417   {
1418     mImpl->Uniform1uiv(location, count, value);
1419   }
1420
1421   void Uniform2uiv(GLint location, GLsizei count, const GLuint* value) override
1422   {
1423     mImpl->Uniform2uiv(location, count, value);
1424   }
1425
1426   void Uniform3uiv(GLint location, GLsizei count, const GLuint* value) override
1427   {
1428     mImpl->Uniform3uiv(location, count, value);
1429   }
1430
1431   void Uniform4uiv(GLint location, GLsizei count, const GLuint* value) override
1432   {
1433     mImpl->Uniform4uiv(location, count, value);
1434   }
1435
1436   void ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value) override
1437   {
1438     mImpl->ClearBufferiv(buffer, drawbuffer, value);
1439   }
1440
1441   void ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value) override
1442   {
1443     mImpl->ClearBufferuiv(buffer, drawbuffer, value);
1444   }
1445
1446   void ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value) override
1447   {
1448     mImpl->ClearBufferfv(buffer, drawbuffer, value);
1449   }
1450
1451   void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) override
1452   {
1453     mImpl->ClearBufferfi(buffer, drawbuffer, depth, stencil);
1454   }
1455
1456   const GLubyte* GetStringi(GLenum name, GLuint index) override
1457   {
1458     return mImpl->GetStringi(name, index);
1459   }
1460
1461   void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size) override
1462   {
1463     mImpl->CopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size);
1464   }
1465
1466   void GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices) override
1467   {
1468     mImpl->GetUniformIndices(program, uniformCount, uniformNames, uniformIndices);
1469   }
1470
1471   void GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params) override
1472   {
1473     mImpl->GetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params);
1474   }
1475
1476   GLuint GetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName) override
1477   {
1478     return mImpl->GetUniformBlockIndex(program, uniformBlockName);
1479   }
1480
1481   void GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params) override
1482   {
1483     mImpl->GetActiveUniformBlockiv(program, uniformBlockIndex, pname, params);
1484   }
1485
1486   void GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName) override
1487   {
1488     mImpl->GetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName);
1489   }
1490
1491   void UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding) override
1492   {
1493     mImpl->UniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding);
1494   }
1495
1496   void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount) override
1497   {
1498     mImpl->DrawArraysInstanced(mode, first, count, instanceCount);
1499   }
1500
1501   void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount) override
1502   {
1503     mImpl->DrawElementsInstanced(mode, count, type, indices, instanceCount);
1504   }
1505
1506   GLsync FenceSync(GLenum condition, GLbitfield flags) override
1507   {
1508     return mImpl->FenceSync(condition, flags);
1509   }
1510
1511   GLboolean IsSync(GLsync sync) override
1512   {
1513     return mImpl->IsSync(sync);
1514   }
1515
1516   void DeleteSync(GLsync sync) override
1517   {
1518     mImpl->DeleteSync(sync);
1519   }
1520
1521   GLenum ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) override
1522   {
1523     return mImpl->ClientWaitSync(sync, flags, timeout);
1524   }
1525
1526   void WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout) override
1527   {
1528     mImpl->WaitSync(sync, flags, timeout);
1529   }
1530
1531   void GetInteger64v(GLenum pname, GLint64* params) override
1532   {
1533     mImpl->GetInteger64v(pname, params);
1534   }
1535
1536   void GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values) override
1537   {
1538     mImpl->GetSynciv(sync, pname, bufSize, length, values);
1539   }
1540
1541   void GetInteger64i_v(GLenum target, GLuint index, GLint64* data) override
1542   {
1543     mImpl->GetInteger64i_v(target, index, data);
1544   }
1545
1546   void GetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params) override
1547   {
1548     mImpl->GetBufferParameteri64v(target, pname, params);
1549   }
1550
1551   void GenSamplers(GLsizei count, GLuint* samplers) override
1552   {
1553     mImpl->GenSamplers(count, samplers);
1554   }
1555
1556   void DeleteSamplers(GLsizei count, const GLuint* samplers) override
1557   {
1558     mImpl->DeleteSamplers(count, samplers);
1559   }
1560
1561   GLboolean IsSampler(GLuint sampler) override
1562   {
1563     return mImpl->IsSampler(sampler);
1564   }
1565
1566   void BindSampler(GLuint unit, GLuint sampler) override
1567   {
1568     mImpl->BindSampler(unit, sampler);
1569   }
1570
1571   void SamplerParameteri(GLuint sampler, GLenum pname, GLint param) override
1572   {
1573     mImpl->SamplerParameteri(sampler, pname, param);
1574   }
1575
1576   void SamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param) override
1577   {
1578     mImpl->SamplerParameteriv(sampler, pname, param);
1579   }
1580
1581   void SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) override
1582   {
1583     mImpl->SamplerParameterf(sampler, pname, param);
1584   }
1585
1586   void SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param) override
1587   {
1588     mImpl->SamplerParameterfv(sampler, pname, param);
1589   }
1590
1591   void GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params) override
1592   {
1593     mImpl->GetSamplerParameteriv(sampler, pname, params);
1594   }
1595
1596   void GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params) override
1597   {
1598     mImpl->GetSamplerParameterfv(sampler, pname, params);
1599   }
1600
1601   void VertexAttribDivisor(GLuint index, GLuint divisor) override
1602   {
1603     mImpl->VertexAttribDivisor(index, divisor);
1604   }
1605
1606   void BindTransformFeedback(GLenum target, GLuint id) override
1607   {
1608     mImpl->BindTransformFeedback(target, id);
1609   }
1610
1611   void DeleteTransformFeedbacks(GLsizei n, const GLuint* ids) override
1612   {
1613     mImpl->DeleteTransformFeedbacks(n, ids);
1614   }
1615
1616   void GenTransformFeedbacks(GLsizei n, GLuint* ids) override
1617   {
1618     mImpl->GenTransformFeedbacks(n, ids);
1619   }
1620
1621   GLboolean IsTransformFeedback(GLuint id) override
1622   {
1623     return mImpl->IsTransformFeedback(id);
1624   }
1625
1626   void PauseTransformFeedback(void) override
1627   {
1628     mImpl->PauseTransformFeedback();
1629   }
1630
1631   void ResumeTransformFeedback(void) override
1632   {
1633     mImpl->ResumeTransformFeedback();
1634   }
1635
1636   void GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary) override
1637   {
1638     mImpl->GetProgramBinary(program, bufSize, length, binaryFormat, binary);
1639   }
1640
1641   void ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length) override
1642   {
1643     mImpl->ProgramBinary(program, binaryFormat, binary, length);
1644   }
1645
1646   void ProgramParameteri(GLuint program, GLenum pname, GLint value) override
1647   {
1648     mImpl->ProgramParameteri(program, pname, value);
1649   }
1650
1651   void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments) override
1652   {
1653     mImpl->InvalidateFramebuffer(target, numAttachments, attachments);
1654   }
1655
1656   void InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height) override
1657   {
1658     mImpl->InvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height);
1659   }
1660
1661   void TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) override
1662   {
1663     mImpl->TexStorage2D(target, levels, internalformat, width, height);
1664   }
1665
1666   void TexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) override
1667   {
1668     mImpl->TexStorage3D(target, levels, internalformat, width, height, depth);
1669   }
1670
1671   void GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params) override
1672   {
1673     mImpl->GetInternalformativ(target, internalformat, pname, bufSize, params);
1674   }
1675
1676   void BlendBarrier(void)
1677   {
1678     if(mGlExtensionSupportedCacheList.GetSupported(GlExtensionCache::GlExtensionCheckerType::BLEND_EQUATION_ADVANCED))
1679     {
1680       mImpl->BlendBarrier();
1681     }
1682   }
1683
1684 private:
1685   std::unique_ptr<GlesAbstraction> mImpl;
1686
1687   GlExtensionCache::GlExtensionSupportedCacheList mGlExtensionSupportedCacheList;
1688
1689   ConditionalWait mContextCreatedWaitCondition;
1690   GLint           mMaxTextureSize;
1691   GLint           mMaxTextureSamples;
1692   std::string     mShaderVersionPrefix;
1693   std::string     mVertexShaderPrefix;
1694   std::string     mFragmentShaderPrefix;
1695   int32_t         mGlesVersion;
1696   int32_t         mShadingLanguageVersion;
1697   bool            mShadingLanguageVersionCached;
1698   bool            mIsSurfacelessContextSupported;
1699   bool            mIsContextCreated;
1700 };
1701
1702 } // namespace Adaptor
1703
1704 } // namespace Internal
1705
1706 } // namespace Dali
1707
1708 #endif // DALI_INTERNAL_GL_IMPLEMENTATION_H