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