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