Merge "Text - Stop destroying the text renderer when text decoration is updated....
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-gl-abstraction.h
1 #ifndef __TEST_GL_ABSTRACTION_H__
2 #define __TEST_GL_ABSTRACTION_H__
3
4 /*
5  * Copyright (c) 2014 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 <sstream>
23 #include <string>
24 #include <cstring>
25 #include <map>
26 #include <cstdio>
27 #include <cstring> // for strcmp
28
29 // INTERNAL INCLUDES
30 #include <dali/public-api/dali-core.h>
31 #include <dali/integration-api/core.h>
32 #include <dali/integration-api/gl-abstraction.h>
33 #include <dali/integration-api/gl-defines.h>
34 #include "test-trace-call-stack.h"
35
36 namespace Dali
37 {
38
39 static const unsigned int MAX_ATTRIBUTE_CACHE_SIZE = 64;
40 static const char *mStdAttribs[MAX_ATTRIBUTE_CACHE_SIZE] =
41 {
42     "aPosition",    // ATTRIB_POSITION
43     "aNormal",      // ATTRIB_NORMAL
44     "aTexCoord",    // ATTRIB_TEXCOORD
45     "aColor",       // ATTRIB_COLOR
46     "aBoneWeights", // ATTRIB_BONE_WEIGHTS
47     "aBoneIndices"  // ATTRIB_BONE_INDICES
48 };
49
50 class DALI_IMPORT_API TestGlAbstraction: public Dali::Integration::GlAbstraction
51 {
52 public:
53   TestGlAbstraction();
54   ~TestGlAbstraction();
55   void Initialize();
56
57   void PreRender();
58   void PostRender();
59
60   /* OpenGL ES 2.0 */
61
62   inline void ActiveTexture( GLenum textureUnit )
63   {
64     mActiveTextureUnit = textureUnit - GL_TEXTURE0;
65   }
66
67   inline GLenum GetActiveTextureUnit() const
68   {
69     return mActiveTextureUnit + GL_TEXTURE0;
70   }
71
72   inline void AttachShader( GLuint program, GLuint shader )
73   {
74     std::stringstream out;
75     out << program << ", " << shader;
76
77     TraceCallStack::NamedParams namedParams;
78     namedParams["program"] = ToString(program);
79     namedParams["shader"] = ToString(shader);
80     mShaderTrace.PushCall("AttachShader", out.str(), namedParams);
81   }
82
83   inline void BindAttribLocation( GLuint program, GLuint index, const char* name )
84   {
85   }
86
87   inline void BindBuffer( GLenum target, GLuint buffer )
88   {
89   }
90
91   inline void BindFramebuffer( GLenum target, GLuint framebuffer )
92   {
93     //Add 010 bit;
94     mFramebufferStatus |= 2;
95   }
96
97   inline void BindRenderbuffer( GLenum target, GLuint renderbuffer )
98   {
99   }
100
101   /**
102    * This method can be used by test cases, to query the texture IDs that have been bound by BindTexture.
103    * @return A vector containing the IDs that were bound.
104    */
105   inline const std::vector<GLuint>& GetBoundTextures() const
106   {
107     return mBoundTextures;
108   }
109
110   /**
111    * Query the texture IDs that have been bound with BindTexture, with a specific active texture unit.
112    * @param[in] activeTextureUnit The specific active texture unit.
113    * @return A vector containing the IDs that were bound.
114    */
115   inline const std::vector<GLuint>& GetBoundTextures( GLuint activeTextureUnit ) const
116   {
117     return mActiveTextures[ activeTextureUnit - GL_TEXTURE0 ].mBoundTextures;
118   }
119
120   /**
121    * This method can be used by test cases, to clear the record of texture IDs that have been bound by BindTexture.
122    */
123   inline void ClearBoundTextures()
124   {
125     mBoundTextures.clear();
126
127     for( unsigned int i=0; i<MIN_TEXTURE_UNIT_LIMIT; ++i )
128     {
129       mActiveTextures[ i ].mBoundTextures.clear();
130     }
131   }
132
133   inline void BindTexture( GLenum target, GLuint texture )
134   {
135     // Record the bound textures for future checks
136     if( texture )
137     {
138       mBoundTextures.push_back( texture );
139
140       if( mActiveTextureUnit < MIN_TEXTURE_UNIT_LIMIT )
141       {
142         mActiveTextures[ mActiveTextureUnit ].mBoundTextures.push_back( texture );
143       }
144     }
145
146     std::stringstream out;
147     out << target << ", " << texture;
148
149     TraceCallStack::NamedParams namedParams;
150     namedParams["target"] = ToString(target);
151     namedParams["texture"] = ToString(texture);
152
153     mTextureTrace.PushCall("BindTexture", out.str(), namedParams);
154   }
155
156   inline void BlendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
157   {
158     mLastBlendColor.r = red;
159     mLastBlendColor.g = green;
160     mLastBlendColor.b = blue;
161     mLastBlendColor.a = alpha;
162   }
163
164   inline const Vector4& GetLastBlendColor() const
165   {
166     return mLastBlendColor;
167   }
168
169   inline void BlendEquation( GLenum mode )
170   {
171     mLastBlendEquationRgb   = mode;
172     mLastBlendEquationAlpha = mode;
173   }
174
175   inline void BlendEquationSeparate( GLenum modeRgb, GLenum modeAlpha )
176   {
177     mLastBlendEquationRgb   = modeRgb;
178     mLastBlendEquationAlpha = modeAlpha;
179   }
180
181   inline GLenum GetLastBlendEquationRgb() const
182   {
183     return mLastBlendEquationRgb;
184   }
185
186   inline GLenum GetLastBlendEquationAlpha() const
187   {
188     return mLastBlendEquationAlpha;
189   }
190
191   inline void BlendFunc(GLenum sfactor, GLenum dfactor)
192   {
193     mLastBlendFuncSrcRgb = sfactor;
194     mLastBlendFuncDstRgb = dfactor;
195     mLastBlendFuncSrcAlpha = sfactor;
196     mLastBlendFuncDstAlpha = dfactor;
197   }
198
199   inline void BlendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
200   {
201     mLastBlendFuncSrcRgb = srcRGB;
202     mLastBlendFuncDstRgb = dstRGB;
203     mLastBlendFuncSrcAlpha = srcAlpha;
204     mLastBlendFuncDstAlpha = dstAlpha;
205   }
206
207   inline GLenum GetLastBlendFuncSrcRgb() const
208   {
209     return mLastBlendFuncSrcRgb;
210   }
211
212   inline GLenum GetLastBlendFuncDstRgb() const
213   {
214     return mLastBlendFuncDstRgb;
215   }
216
217   inline GLenum GetLastBlendFuncSrcAlpha() const
218   {
219     return mLastBlendFuncSrcAlpha;
220   }
221
222   inline GLenum GetLastBlendFuncDstAlpha() const
223   {
224     return mLastBlendFuncDstAlpha;
225   }
226
227   inline void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage)
228   {
229      mBufferDataCalls.push_back(size);
230   }
231
232   inline void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
233   {
234      mBufferSubDataCalls.push_back(size);
235   }
236
237   inline GLenum CheckFramebufferStatus(GLenum target)
238   {
239     //If it has the three last bits set to 1 - 111, then the three minimum functions to create a
240     //Framebuffer texture have been called
241     if( mFramebufferStatus == 7 )
242     {
243       return GL_FRAMEBUFFER_COMPLETE;
244     }
245
246     return mCheckFramebufferStatusResult;
247   }
248
249   inline GLenum CheckFramebufferColorAttachment()
250   {
251     return mFramebufferColorAttached;
252   }
253
254   inline GLenum CheckFramebufferDepthAttachment()
255   {
256     return mFramebufferDepthAttached;
257   }
258
259   inline GLenum CheckFramebufferStencilAttachment()
260   {
261     return mFramebufferStencilAttached;
262   }
263
264   inline void Clear(GLbitfield mask)
265   {
266     mClearCount++;
267     mLastClearBitMask = mask;
268   }
269
270   inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
271   {
272   }
273
274   inline void ClearDepthf(GLclampf depth)
275   {
276   }
277
278   inline void ClearStencil(GLint s)
279   {
280   }
281
282   inline void ColorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
283   {
284   }
285
286   inline void CompileShader(GLuint shader)
287   {
288     std::stringstream out;
289     out << shader;
290     TraceCallStack::NamedParams namedParams;
291     namedParams["shader"] = ToString(shader);
292
293     mShaderTrace.PushCall("CompileShader", out.str(), namedParams);
294   }
295
296   inline void CompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
297   {
298     std::stringstream out;
299     out << target<<", "<<level<<", "<<width << ", " << height;
300
301     TraceCallStack::NamedParams namedParams;
302     namedParams["target"] = ToString(target);
303     namedParams["level"] = ToString(level);
304     namedParams["internalformat"] = ToString(internalformat);
305     namedParams["width"] = ToString(width);
306     namedParams["height"] = ToString(height);
307     namedParams["border"] = ToString(border);
308     namedParams["size"] = ToString(imageSize);
309
310     mTextureTrace.PushCall("CompressedTexImage2D", out.str(), namedParams);
311   }
312
313   inline void CompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
314   {
315     std::stringstream out;
316     out << target << ", "<<level <<", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
317
318     TraceCallStack::NamedParams namedParams;
319     namedParams["target"] = ToString(target);
320     namedParams["level"] = ToString(level);
321     namedParams["xoffset"] = ToString(xoffset);
322     namedParams["yoffset"] = ToString(yoffset);
323     namedParams["width"] = ToString(width);
324     namedParams["height"] = ToString(height);
325     mTextureTrace.PushCall("CompressedTexSubImage2D", out.str(), namedParams);
326   }
327
328   inline void CopyTexImage2D(GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
329   {
330   }
331
332   inline void CopyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
333   {
334   }
335
336   inline GLuint CreateProgram(void)
337   {
338     mShaderTrace.PushCall("CreateProgram", "");
339
340     ++mLastProgramIdUsed;
341     mUniforms[mLastProgramIdUsed] = UniformIDMap();
342     return mLastProgramIdUsed;
343   }
344
345   inline GLuint CreateShader(GLenum type)
346   {
347     std::stringstream out;
348     out << type;
349
350     TraceCallStack::NamedParams namedParams;
351     namedParams["type"] = ToString(type);
352     mShaderTrace.PushCall("CreateShader", out.str(), namedParams);
353
354     return ++mLastShaderIdUsed;
355   }
356
357   inline void CullFace(GLenum mode)
358   {
359     std::stringstream out;
360     out << mode;
361
362     TraceCallStack::NamedParams namedParams;
363     namedParams["program"] = ToString(mode);
364
365     mCullFaceTrace.PushCall("CullFace", out.str(), namedParams);
366   }
367
368   inline void DeleteBuffers(GLsizei n, const GLuint* buffers)
369   {
370   }
371
372   inline void DeleteFramebuffers(GLsizei n, const GLuint* framebuffers)
373   {
374   }
375
376   inline void DeleteProgram(GLuint program)
377   {
378     std::stringstream out;
379     out << program;
380
381     TraceCallStack::NamedParams namedParams;
382     namedParams["program"] = ToString(program);
383
384     mShaderTrace.PushCall("DeleteProgram", out.str(), namedParams);
385   }
386
387   inline void DeleteRenderbuffers(GLsizei n, const GLuint* renderbuffers)
388   {
389   }
390
391   inline void DeleteShader(GLuint shader)
392   {
393     std::stringstream out;
394     out << shader;
395
396     TraceCallStack::NamedParams namedParams;
397     namedParams["shader"] = ToString(shader);
398
399     mShaderTrace.PushCall("DeleteShader", out.str(), namedParams);
400   }
401
402   inline void DeleteTextures(GLsizei n, const GLuint* textures)
403   {
404     std::stringstream out;
405     out << n << ", " << textures << " = [";
406
407     TraceCallStack::NamedParams namedParams;
408
409     for(GLsizei i=0; i<n; i++)
410     {
411       out << textures[i] << ", ";
412       std::stringstream paramName;
413       paramName<<"texture["<<i<<"]";
414       namedParams[paramName.str()] = ToString(textures[i]);
415       mDeletedTextureIds.push_back(textures[i]);
416     }
417     out << "]";
418
419     mTextureTrace.PushCall("DeleteTextures", out.str(), namedParams);
420   }
421
422   inline bool CheckNoTexturesDeleted()
423   {
424     return mDeletedTextureIds.size() == 0;
425   }
426
427   inline bool CheckTextureDeleted( GLuint textureId )
428   {
429     bool found = false;
430
431     for(std::vector<GLuint>::iterator iter=mDeletedTextureIds.begin(); iter != mDeletedTextureIds.end(); ++iter)
432     {
433       if(*iter == textureId)
434       {
435         found = true;
436         break;
437       }
438     }
439     return found;
440   }
441
442   inline void ClearDeletedTextures()
443   {
444     mDeletedTextureIds.clear();
445   }
446
447   inline void DepthFunc(GLenum func)
448   {
449     std::stringstream out;
450     out << func;
451
452     TraceCallStack::NamedParams namedParams;
453     namedParams["func"] = ToString(func);
454
455     mDepthFunctionTrace.PushCall("DepthFunc", out.str(), namedParams);
456   }
457
458   inline void DepthMask(GLboolean flag)
459   {
460   }
461
462   inline void DepthRangef(GLclampf zNear, GLclampf zFar)
463   {
464   }
465
466   inline void DetachShader(GLuint program, GLuint shader)
467   {
468     std::stringstream out;
469     out << program << ", " << shader;
470     TraceCallStack::NamedParams namedParams;
471     namedParams["program"] = ToString(program);
472     namedParams["shader"] = ToString(shader);
473     mShaderTrace.PushCall("DetachShader", out.str(), namedParams);
474   }
475
476   inline void Disable(GLenum cap)
477   {
478     std::stringstream out;
479     out << cap;
480     TraceCallStack::NamedParams namedParams;
481     namedParams["cap"] = ToString(cap);
482     mEnableDisableTrace.PushCall("Disable", out.str(), namedParams);
483   }
484
485   inline void DisableVertexAttribArray(GLuint index)
486   {
487     SetVertexAttribArray( index, false );
488   }
489
490   inline void DrawArrays(GLenum mode, GLint first, GLsizei count)
491   {
492     std::stringstream out;
493     out << mode << ", " << first << ", " << count;
494     TraceCallStack::NamedParams namedParams;
495     namedParams["mode"] = ToString(mode);
496     namedParams["first"] = ToString(first);
497     namedParams["count"] = ToString(count);
498     mDrawTrace.PushCall("DrawArrays", out.str(), namedParams);
499   }
500
501   inline void DrawElements(GLenum mode, GLsizei count, GLenum type, const void* indices)
502   {
503     std::stringstream out;
504     out << mode << ", " << count << ", " << type << ", indices";
505
506     TraceCallStack::NamedParams namedParams;
507     namedParams["mode"] = ToString(mode);
508     namedParams["count"] = ToString(count);
509     namedParams["type"] = ToString(type);
510     // Skip void pointers - are they of any use?
511     mDrawTrace.PushCall("DrawElements", out.str(), namedParams);
512   }
513
514   inline void Enable(GLenum cap)
515   {
516     std::stringstream out;
517     out << cap;
518     TraceCallStack::NamedParams namedParams;
519     namedParams["cap"] = ToString(cap);
520     mEnableDisableTrace.PushCall("Enable", out.str(), namedParams);
521   }
522
523   inline void EnableVertexAttribArray(GLuint index)
524   {
525     SetVertexAttribArray( index, true);
526   }
527
528   inline void Finish(void)
529   {
530   }
531
532   inline void Flush(void)
533   {
534   }
535
536   inline void FramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
537   {
538     if (attachment == GL_DEPTH_ATTACHMENT)
539     {
540       mFramebufferDepthAttached = true;
541     }
542     else if (attachment == GL_STENCIL_ATTACHMENT)
543     {
544       mFramebufferStencilAttached = true;
545     }
546   }
547
548   inline void FramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
549   {
550     //Add 100 bit;
551     mFramebufferStatus |= 4;
552
553     //We check 4 attachment colors
554     if ((attachment == GL_COLOR_ATTACHMENT0) || (attachment == GL_COLOR_ATTACHMENT1) || (attachment == GL_COLOR_ATTACHMENT2)  || (attachment == GL_COLOR_ATTACHMENT4))
555     {
556       mFramebufferColorAttached = true;
557     }
558   }
559
560   inline void FrontFace(GLenum mode)
561   {
562   }
563
564   inline void GenBuffers(GLsizei n, GLuint* buffers)
565   {
566     // avoids an assert in GpuBuffers
567     *buffers = 1u;
568   }
569
570   inline void GenerateMipmap(GLenum target)
571   {
572     std::stringstream out;
573     out<<target;
574     TraceCallStack::NamedParams namedParams;
575     namedParams["target"] = ToString(target);
576
577     mTextureTrace.PushCall("GenerateMipmap", out.str(), namedParams);
578   }
579
580   inline void GenFramebuffers(GLsizei n, GLuint* framebuffers)
581   {
582     for( int i = 0; i < n; i++ )
583     {
584       framebuffers[i] = i + 1;
585     }
586
587     //Add 001 bit, this function needs to be called the first one in the chain
588     mFramebufferStatus = 1;
589   }
590
591   inline void GenRenderbuffers(GLsizei n, GLuint* renderbuffers)
592   {
593     for( int i = 0; i < n; i++ )
594     {
595       renderbuffers[i] = i + 1;
596     }
597   }
598
599   /**
600    * This method can be used by test cases, to manipulate the texture IDs generated by GenTextures.
601    * @param[in] ids A vector containing the next IDs to be generated
602    */
603   inline void SetNextTextureIds( const std::vector<GLuint>& ids )
604   {
605     mNextTextureIds = ids;
606   }
607
608   inline const std::vector<GLuint>& GetNextTextureIds()
609   {
610     return mNextTextureIds;
611   }
612
613   inline void GenTextures(GLsizei count, GLuint* textures)
614   {
615     for( int i=0; i<count; ++i )
616     {
617       if( !mNextTextureIds.empty() )
618       {
619         *(textures+i) = mNextTextureIds[0];
620         mNextTextureIds.erase( mNextTextureIds.begin() );
621       }
622       else
623       {
624         *(textures+i) = ++mLastAutoTextureIdUsed;
625       }
626     }
627
628     TraceCallStack::NamedParams namedParams;
629     namedParams["count"] = ToString(count);
630
631     std::stringstream out;
632     for(int i=0; i<count; i++)
633     {
634       out << textures[i];
635       if(i<count-1)
636       {
637         out << ", ";
638       }
639       std::ostringstream oss;
640       oss<<"indices["<<i<<"]";
641       namedParams[oss.str()] = ToString(textures[i]);
642     }
643
644     mTextureTrace.PushCall("GenTextures", out.str(), namedParams);
645   }
646
647   inline void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
648   {
649   }
650
651   inline void GetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
652   {
653     switch(index)
654     {
655       case 0:
656         *length = snprintf(name, bufsize, "sTexture");
657         *type = GL_SAMPLER_2D;
658         *size = 1;
659         break;
660       case 1:
661         *length = snprintf(name, bufsize, "sEffect");
662         *type = GL_SAMPLER_2D;
663         *size = 1;
664         break;
665       case 2:
666         *length = snprintf(name, bufsize, "sGloss");
667         *type = GL_SAMPLER_2D;
668         *size = 1;
669         break;
670       default:
671         break;
672     }
673   }
674
675   inline void GetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
676   {
677   }
678
679   inline int  GetAttribLocation(GLuint program, const char* name)
680   {
681     std::string attribName(name);
682
683     for( unsigned int i = 0; i < ATTRIB_TYPE_LAST; ++i )
684     {
685       if( mStdAttribs[i] == attribName )
686       {
687         return i;
688       }
689     }
690
691     // 0 is a valid location
692     return 0;
693   }
694
695   inline void GetBooleanv(GLenum pname, GLboolean* params)
696   {
697   }
698
699   inline void GetBufferParameteriv(GLenum target, GLenum pname, GLint* params)
700   {
701   }
702
703   inline GLenum GetError(void)
704   {
705     return mGetErrorResult;
706   }
707
708   inline void GetFloatv(GLenum pname, GLfloat* params)
709   {
710   }
711
712   inline void GetFramebufferAttachmentParameteriv(GLenum target, GLenum attachment, GLenum pname, GLint* params)
713   {
714   }
715
716   inline void GetIntegerv(GLenum pname, GLint* params)
717   {
718     switch( pname )
719     {
720       case GL_MAX_TEXTURE_SIZE:
721         *params = 2048;
722         break;
723       case GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS:
724         *params = 8;
725         break;
726       case GL_NUM_PROGRAM_BINARY_FORMATS_OES:
727         *params = mNumBinaryFormats;
728         break;
729       case GL_PROGRAM_BINARY_FORMATS_OES:
730         *params = mBinaryFormats;
731         break;
732     }
733   }
734
735   inline void GetProgramiv(GLuint program, GLenum pname, GLint* params)
736   {
737     switch( pname )
738     {
739       case GL_LINK_STATUS:
740         *params = mLinkStatus;
741         break;
742       case GL_PROGRAM_BINARY_LENGTH_OES:
743         *params = mProgramBinaryLength;
744         break;
745       case GL_ACTIVE_UNIFORMS:
746         *params = mNumberOfActiveUniforms;
747         break;
748       case GL_ACTIVE_UNIFORM_MAX_LENGTH:
749         *params = 100;
750         break;
751     }
752   }
753
754   inline void GetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
755   {
756   }
757
758   inline void GetRenderbufferParameteriv(GLenum target, GLenum pname, GLint* params)
759   {
760   }
761
762   inline void GetShaderiv(GLuint shader, GLenum pname, GLint* params)
763   {
764     switch( pname ) {
765       case GL_COMPILE_STATUS:
766         *params = mCompileStatus;
767         break;
768     }
769   }
770
771   inline void GetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
772   {
773   }
774
775   inline void GetShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
776   {
777   }
778
779   inline const GLubyte* GetString(GLenum name)
780   {
781     return mGetStringResult;
782   }
783
784   inline void GetTexParameterfv(GLenum target, GLenum pname, GLfloat* params)
785   {
786   }
787
788   inline void GetTexParameteriv(GLenum target, GLenum pname, GLint* params)
789   {
790   }
791
792   inline void GetUniformfv(GLuint program, GLint location, GLfloat* params)
793   {
794   }
795
796   inline void GetUniformiv(GLuint program, GLint location, GLint* params)
797   {
798   }
799
800   inline GLint GetUniformLocation(GLuint program, const char* name)
801   {
802     ProgramUniformMap::iterator it = mUniforms.find(program);
803     if( it == mUniforms.end() )
804     {
805       // Not a valid program ID
806       mGetErrorResult = GL_INVALID_OPERATION;
807       return -1;
808     }
809
810     UniformIDMap& uniformIDs = it->second;
811     UniformIDMap::iterator it2 = uniformIDs.find( name );
812     if( it2 == uniformIDs.end() )
813     {
814       // Uniform not found, so add it...
815       uniformIDs[name] = ++mLastUniformIdUsed;
816       return mLastUniformIdUsed;
817     }
818
819     return it2->second;
820   }
821
822   inline void GetVertexAttribfv(GLuint index, GLenum pname, GLfloat* params)
823   {
824   }
825
826   inline void GetVertexAttribiv(GLuint index, GLenum pname, GLint* params)
827   {
828   }
829
830   inline void GetVertexAttribPointerv(GLuint index, GLenum pname, void** pointer)
831   {
832   }
833
834   inline void Hint(GLenum target, GLenum mode)
835   {
836   }
837
838   inline GLboolean IsBuffer(GLuint buffer)
839   {
840     return mIsBufferResult;
841   }
842
843   inline GLboolean IsEnabled(GLenum cap)
844   {
845     return mIsEnabledResult;
846   }
847
848   inline GLboolean IsFramebuffer(GLuint framebuffer)
849   {
850     return mIsFramebufferResult;
851   }
852
853   inline GLboolean IsProgram(GLuint program)
854   {
855     return mIsProgramResult;
856   }
857
858   inline GLboolean IsRenderbuffer(GLuint renderbuffer)
859   {
860     return mIsRenderbufferResult;
861   }
862
863   inline GLboolean IsShader(GLuint shader)
864   {
865     return mIsShaderResult;
866   }
867
868   inline GLboolean IsTexture(GLuint texture)
869   {
870     return mIsTextureResult;
871   }
872
873   inline void LineWidth(GLfloat width)
874   {
875   }
876
877   inline void LinkProgram(GLuint program)
878   {
879     std::stringstream out;
880     out << program;
881
882     TraceCallStack::NamedParams namedParams;
883     namedParams["program"] = ToString(program);
884     mShaderTrace.PushCall("LinkProgram", out.str(), namedParams);
885
886     mNumberOfActiveUniforms=3;
887     GetUniformLocation(program, "sTexture");
888     GetUniformLocation(program, "sEffect");
889     GetUniformLocation(program, "sGloss");
890   }
891
892   inline void PixelStorei(GLenum pname, GLint param)
893   {
894   }
895
896   inline void PolygonOffset(GLfloat factor, GLfloat units)
897   {
898   }
899
900   inline void ReadPixels(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
901   {
902   }
903
904   inline void ReleaseShaderCompiler(void)
905   {
906   }
907
908   inline void RenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
909   {
910   }
911
912   inline void SampleCoverage(GLclampf value, GLboolean invert)
913   {
914   }
915
916   inline void Scissor(GLint x, GLint y, GLsizei width, GLsizei height)
917   {
918     mScissorParams.x = x;
919     mScissorParams.y = y;
920     mScissorParams.width = width;
921     mScissorParams.height = height;
922   }
923
924   inline void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
925   {
926   }
927
928   inline void ShaderSource(GLuint shader, GLsizei count, const char** string, const GLint* length)
929   {
930     std::string stringBuilder;
931     for(int i = 0; i < count; ++i)
932     {
933       stringBuilder += string[i];
934     }
935     mShaderSources[shader] = stringBuilder;
936     mLastShaderCompiled = shader;
937   }
938
939   inline void GetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
940   {
941     const std::string shaderSource = mShaderSources[shader];
942     if( static_cast<int>(shaderSource.length()) < bufsize )
943     {
944       strcpy(source, shaderSource.c_str());
945       *length = shaderSource.length();
946     }
947     else
948     {
949       *length = bufsize -1;
950       strncpy(source, shaderSource.c_str(), *length);
951       source[*length] = 0x0;
952     }
953   }
954
955   inline std::string GetShaderSource(GLuint shader)
956   {
957     return mShaderSources[shader];
958   }
959
960   inline void StencilFunc(GLenum func, GLint ref, GLuint mask)
961   {
962   }
963
964   inline void StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
965   {
966   }
967
968   inline void StencilMask(GLuint mask)
969   {
970   }
971
972   inline void StencilMaskSeparate(GLenum face, GLuint mask)
973   {
974   }
975
976   inline void StencilOp(GLenum fail, GLenum zfail, GLenum zpass)
977   {
978   }
979
980   inline void StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
981   {
982   }
983
984   inline void TexImage2D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
985   {
986     std::stringstream out;
987     out << target<<", "<<level<<", "<<width << ", " << height;
988
989     TraceCallStack::NamedParams namedParams;
990     namedParams["target"] = ToString(target);
991     namedParams["level"] = ToString(level);
992     namedParams["internalformat"] = ToString(internalformat);
993     namedParams["width"] = ToString(width);
994     namedParams["height"] = ToString(height);
995     namedParams["border"] = ToString(border);
996     namedParams["format"] = ToString(format);
997     namedParams["type"] = ToString(type);
998
999     mTextureTrace.PushCall("TexImage2D", out.str(), namedParams);
1000   }
1001
1002   inline void TexParameterf(GLenum target, GLenum pname, GLfloat param)
1003   {
1004     std::stringstream out;
1005     out << target << ", " << pname << ", " << param;
1006
1007     TraceCallStack::NamedParams namedParams;
1008     namedParams["target"] = ToString(target);
1009     namedParams["pname"] = ToString(pname);
1010     namedParams["param"] = ToString(param);
1011
1012     mTexParamaterTrace.PushCall("TexParameterf", out.str(), namedParams);
1013   }
1014
1015   inline void TexParameterfv(GLenum target, GLenum pname, const GLfloat* params)
1016   {
1017     std::stringstream out;
1018     out << target << ", " << pname << ", " << params[0];
1019
1020     TraceCallStack::NamedParams namedParams;
1021     namedParams["target"] = ToString(target);
1022     namedParams["pname"] = ToString(pname);
1023     namedParams["params[0]"] = ToString(params[0]);
1024
1025     mTexParamaterTrace.PushCall("TexParameterfv", out.str(), namedParams);
1026   }
1027
1028   inline void TexParameteri(GLenum target, GLenum pname, GLint param)
1029   {
1030     std::stringstream out;
1031     out << target << ", " << pname << ", " << param;
1032     TraceCallStack::NamedParams namedParams;
1033     namedParams["target"] = ToString(target);
1034     namedParams["pname"] = ToString(pname);
1035     namedParams["param"] = ToString(param);
1036     mTexParamaterTrace.PushCall("TexParameteri", out.str(), namedParams);
1037   }
1038
1039   inline void TexParameteriv(GLenum target, GLenum pname, const GLint* params)
1040   {
1041     std::stringstream out;
1042     out << target << ", " << pname << ", " << params[0];
1043     TraceCallStack::NamedParams namedParams;
1044     namedParams["target"] = ToString(target);
1045     namedParams["pname"] = ToString(pname);
1046     namedParams["params[0]"] = ToString(params[0]);
1047     mTexParamaterTrace.PushCall("TexParameteriv", out.str(), namedParams);
1048   }
1049
1050   inline void TexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
1051   {
1052     std::stringstream out;
1053     out << target << ", "<<level <<", " << xoffset << ", " << yoffset << ", " << width << ", " << height;
1054
1055     TraceCallStack::NamedParams namedParams;
1056     namedParams["target"] = ToString(target);
1057     namedParams["level"] = ToString(level);
1058     namedParams["xoffset"] = ToString(xoffset);
1059     namedParams["yoffset"] = ToString(yoffset);
1060     namedParams["width"] = ToString(width);
1061     namedParams["height"] = ToString(height);
1062     mTextureTrace.PushCall("TexSubImage2D", out.str(), namedParams);
1063   }
1064
1065   inline void Uniform1f(GLint location, GLfloat x)
1066   {
1067     if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, x ) )
1068     {
1069       mGetErrorResult = GL_INVALID_OPERATION;
1070     }
1071   }
1072
1073   inline void Uniform1fv(GLint location, GLsizei count, const GLfloat* v)
1074   {
1075     for( int i = 0; i < count; ++i )
1076     {
1077       if( ! mProgramUniforms1f.SetUniformValue( mCurrentProgram, location, v[i] ) )
1078       {
1079         mGetErrorResult = GL_INVALID_OPERATION;
1080         break;
1081       }
1082     }
1083   }
1084
1085   inline void Uniform1i(GLint location, GLint x)
1086   {
1087     if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram, location, x ) )
1088     {
1089       mGetErrorResult = GL_INVALID_OPERATION;
1090     }
1091   }
1092
1093   inline void Uniform1iv(GLint location, GLsizei count, const GLint* v)
1094   {
1095     for( int i = 0; i < count; ++i )
1096     {
1097       if( ! mProgramUniforms1i.SetUniformValue( mCurrentProgram,
1098                                                  location,
1099                                                  v[i] ) )
1100       {
1101         mGetErrorResult = GL_INVALID_OPERATION;
1102         break;
1103       }
1104     }
1105   }
1106
1107   inline void Uniform2f(GLint location, GLfloat x, GLfloat y)
1108   {
1109     if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
1110                                                location,
1111                                                Vector2( x, y ) ) )
1112     {
1113       mGetErrorResult = GL_INVALID_OPERATION;
1114     }
1115   }
1116
1117   inline void Uniform2fv(GLint location, GLsizei count, const GLfloat* v)
1118   {
1119     for( int i = 0; i < count; ++i )
1120     {
1121       if( ! mProgramUniforms2f.SetUniformValue( mCurrentProgram,
1122                                                  location,
1123                                                  Vector2( v[2*i], v[2*i+1] ) ) )
1124       {
1125         mGetErrorResult = GL_INVALID_OPERATION;
1126         break;
1127       }
1128     }
1129   }
1130
1131   inline void Uniform2i(GLint location, GLint x, GLint y)
1132   {
1133   }
1134
1135   inline void Uniform2iv(GLint location, GLsizei count, const GLint* v)
1136   {
1137   }
1138
1139   inline void Uniform3f(GLint location, GLfloat x, GLfloat y, GLfloat z)
1140   {
1141     if( ! mProgramUniforms3f.SetUniformValue( mCurrentProgram,
1142                                                location,
1143                                                Vector3( x, y, z ) ) )
1144     {
1145       mGetErrorResult = GL_INVALID_OPERATION;
1146     }
1147   }
1148
1149   inline void Uniform3fv(GLint location, GLsizei count, const GLfloat* v)
1150   {
1151     for( int i = 0; i < count; ++i )
1152     {
1153       if( ! mProgramUniforms3f.SetUniformValue(
1154           mCurrentProgram,
1155           location,
1156           Vector3( v[3*i], v[3*i+1], v[3*i+2] ) ) )
1157       {
1158         mGetErrorResult = GL_INVALID_OPERATION;
1159         break;
1160       }
1161     }
1162   }
1163
1164   inline void Uniform3i(GLint location, GLint x, GLint y, GLint z)
1165   {
1166   }
1167
1168   inline void Uniform3iv(GLint location, GLsizei count, const GLint* v)
1169   {
1170   }
1171
1172   inline void Uniform4f(GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1173   {
1174     if( ! mProgramUniforms4f.SetUniformValue( mCurrentProgram,
1175                                               location,
1176                                               Vector4( x, y, z, w ) ) )
1177     {
1178       mGetErrorResult = GL_INVALID_OPERATION;
1179     }
1180   }
1181
1182   inline void Uniform4fv(GLint location, GLsizei count, const GLfloat* v)
1183   {
1184     for( int i = 0; i < count; ++i )
1185     {
1186       if( ! mProgramUniforms4f.SetUniformValue(
1187           mCurrentProgram,
1188           location,
1189           Vector4( v[4*i], v[4*i+1], v[4*i+2], v[4*i+3] ) ) )
1190       {
1191         mGetErrorResult = GL_INVALID_OPERATION;
1192         break;
1193       }
1194     }
1195   }
1196
1197   inline void Uniform4i(GLint location, GLint x, GLint y, GLint z, GLint w)
1198   {
1199   }
1200
1201   inline void Uniform4iv(GLint location, GLsizei count, const GLint* v)
1202   {
1203   }
1204
1205   inline void UniformMatrix2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1206   {
1207   }
1208
1209   inline void UniformMatrix3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1210   {
1211     for( int i = 0; i < count; ++i )
1212     {
1213       if( ! mProgramUniformsMat3.SetUniformValue(
1214             mCurrentProgram,
1215             location,
1216             Matrix3( value[0], value[1], value[2], value[3], value[4], value[5], value[6], value[7], value[8] ) ) )
1217       {
1218         mGetErrorResult = GL_INVALID_OPERATION;
1219         break;
1220       }
1221     }
1222   }
1223
1224   inline void UniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1225   {
1226     for( int i = 0; i < count; ++i )
1227     {
1228       if( ! mProgramUniformsMat4.SetUniformValue(
1229           mCurrentProgram,
1230           location,
1231           Matrix( value ) ) )
1232       {
1233         mGetErrorResult = GL_INVALID_OPERATION;
1234         break;
1235       }
1236     }
1237   }
1238
1239   inline void UseProgram(GLuint program)
1240   {
1241     mCurrentProgram = program;
1242   }
1243
1244   inline void ValidateProgram(GLuint program)
1245   {
1246   }
1247
1248   inline void VertexAttrib1f(GLuint indx, GLfloat x)
1249   {
1250   }
1251
1252   inline void VertexAttrib1fv(GLuint indx, const GLfloat* values)
1253   {
1254   }
1255
1256   inline void VertexAttrib2f(GLuint indx, GLfloat x, GLfloat y)
1257   {
1258   }
1259
1260   inline void VertexAttrib2fv(GLuint indx, const GLfloat* values)
1261   {
1262   }
1263
1264   inline void VertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z)
1265   {
1266   }
1267
1268   inline void VertexAttrib3fv(GLuint indx, const GLfloat* values)
1269   {
1270   }
1271
1272   inline void VertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
1273   {
1274   }
1275
1276   inline void VertexAttrib4fv(GLuint indx, const GLfloat* values)
1277   {
1278   }
1279
1280   inline void VertexAttribPointer(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
1281   {
1282   }
1283
1284   inline void Viewport(GLint x, GLint y, GLsizei width, GLsizei height)
1285   {
1286   }
1287
1288   /* OpenGL ES 3.0 */
1289
1290   inline void ReadBuffer(GLenum mode)
1291   {
1292   }
1293
1294   inline void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
1295   {
1296   }
1297
1298   inline void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
1299   {
1300   }
1301
1302   inline 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)
1303   {
1304   }
1305
1306   inline void CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
1307   {
1308   }
1309
1310   inline void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
1311   {
1312   }
1313
1314   inline 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)
1315   {
1316   }
1317
1318   inline void GenQueries(GLsizei n, GLuint* ids)
1319   {
1320   }
1321
1322   inline void DeleteQueries(GLsizei n, const GLuint* ids)
1323   {
1324   }
1325
1326   inline GLboolean IsQuery(GLuint id)
1327   {
1328     return false;
1329   }
1330
1331   inline void BeginQuery(GLenum target, GLuint id)
1332   {
1333   }
1334
1335   inline void EndQuery(GLenum target)
1336   {
1337   }
1338
1339   inline void GetQueryiv(GLenum target, GLenum pname, GLint* params)
1340   {
1341   }
1342
1343   inline void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
1344   {
1345   }
1346
1347   inline GLboolean UnmapBuffer(GLenum target)
1348   {
1349     return false;
1350   }
1351
1352   inline void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
1353   {
1354   }
1355
1356   inline void DrawBuffers(GLsizei n, const GLenum* bufs)
1357   {
1358   }
1359
1360   inline void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1361   {
1362   }
1363
1364   inline void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1365   {
1366   }
1367
1368   inline void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1369   {
1370   }
1371
1372   inline void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1373   {
1374   }
1375
1376   inline void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1377   {
1378   }
1379
1380   inline void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
1381   {
1382   }
1383
1384   inline void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
1385   {
1386   }
1387
1388   inline void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
1389   {
1390   }
1391
1392   inline void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
1393   {
1394   }
1395
1396   inline GLvoid* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
1397   {
1398     return NULL;
1399   }
1400
1401   inline void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
1402   {
1403   }
1404
1405   inline void BindVertexArray(GLuint array)
1406   {
1407   }
1408
1409   inline void DeleteVertexArrays(GLsizei n, const GLuint* arrays)
1410   {
1411   }
1412
1413   inline void GenVertexArrays(GLsizei n, GLuint* arrays)
1414   {
1415   }
1416
1417   inline GLboolean IsVertexArray(GLuint array)
1418   {
1419     return false;
1420   }
1421
1422   inline void GetIntegeri_v(GLenum target, GLuint index, GLint* data)
1423   {
1424   }
1425
1426   inline void BeginTransformFeedback(GLenum primitiveMode)
1427   {
1428   }
1429
1430   inline void EndTransformFeedback(void)
1431   {
1432   }
1433
1434   inline void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
1435   {
1436   }
1437
1438   inline void BindBufferBase(GLenum target, GLuint index, GLuint buffer)
1439   {
1440   }
1441
1442   inline void TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
1443   {
1444   }
1445
1446   inline void GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
1447   {
1448   }
1449
1450   inline void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
1451   {
1452   }
1453
1454   inline void GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
1455   {
1456   }
1457
1458   inline void GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
1459   {
1460   }
1461
1462   inline void VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
1463   {
1464   }
1465
1466   inline void VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
1467   {
1468   }
1469
1470   inline void VertexAttribI4iv(GLuint index, const GLint* v)
1471   {
1472   }
1473
1474   inline void VertexAttribI4uiv(GLuint index, const GLuint* v)
1475   {
1476   }
1477
1478   inline void GetUniformuiv(GLuint program, GLint location, GLuint* params)
1479   {
1480   }
1481
1482   inline GLint GetFragDataLocation(GLuint program, const GLchar *name)
1483   {
1484     return -1;
1485   }
1486
1487   inline void Uniform1ui(GLint location, GLuint v0)
1488   {
1489   }
1490
1491   inline void Uniform2ui(GLint location, GLuint v0, GLuint v1)
1492   {
1493   }
1494
1495   inline void Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
1496   {
1497   }
1498
1499   inline void Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
1500   {
1501   }
1502
1503   inline void Uniform1uiv(GLint location, GLsizei count, const GLuint* value)
1504   {
1505   }
1506
1507   inline void Uniform2uiv(GLint location, GLsizei count, const GLuint* value)
1508   {
1509   }
1510
1511   inline void Uniform3uiv(GLint location, GLsizei count, const GLuint* value)
1512   {
1513   }
1514
1515   inline void Uniform4uiv(GLint location, GLsizei count, const GLuint* value)
1516   {
1517   }
1518
1519   inline void ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value)
1520   {
1521   }
1522
1523   inline void ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value)
1524   {
1525   }
1526
1527   inline void ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value)
1528   {
1529   }
1530
1531   inline void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
1532   {
1533   }
1534
1535   inline const GLubyte* GetStringi(GLenum name, GLuint index)
1536   {
1537     return NULL;
1538   }
1539
1540   inline void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
1541   {
1542   }
1543
1544   inline void GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices)
1545   {
1546   }
1547
1548   inline void GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
1549   {
1550   }
1551
1552   inline GLuint GetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
1553   {
1554     return GL_INVALID_INDEX;
1555   }
1556
1557   inline void GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
1558   {
1559   }
1560
1561   inline void GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
1562   {
1563   }
1564
1565   inline void UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
1566   {
1567   }
1568
1569   inline void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
1570   {
1571   }
1572
1573   inline void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount)
1574   {
1575   }
1576
1577   inline GLsync FenceSync(GLenum condition, GLbitfield flags)
1578   {
1579     return NULL;
1580   }
1581
1582   inline GLboolean IsSync(GLsync sync)
1583   {
1584     return false;
1585   }
1586
1587   inline void DeleteSync(GLsync sync)
1588   {
1589   }
1590
1591   inline GLenum ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1592   {
1593     return 0;
1594   }
1595
1596   inline void WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1597   {
1598   }
1599
1600   inline void GetInteger64v(GLenum pname, GLint64* params)
1601   {
1602   }
1603
1604   inline void GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
1605   {
1606   }
1607
1608   inline void GetInteger64i_v(GLenum target, GLuint index, GLint64* data)
1609   {
1610   }
1611
1612   inline void GetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
1613   {
1614   }
1615
1616   inline void GenSamplers(GLsizei count, GLuint* samplers)
1617   {
1618   }
1619
1620   inline void DeleteSamplers(GLsizei count, const GLuint* samplers)
1621   {
1622   }
1623
1624   inline GLboolean IsSampler(GLuint sampler)
1625   {
1626     return false;
1627   }
1628
1629   inline void BindSampler(GLuint unit, GLuint sampler)
1630   {
1631   }
1632
1633   inline void SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
1634   {
1635   }
1636
1637   inline void SamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
1638   {
1639   }
1640
1641   inline void SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
1642   {
1643   }
1644
1645   inline void SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
1646   {
1647   }
1648
1649   inline void GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
1650   {
1651   }
1652
1653   inline void GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
1654   {
1655   }
1656
1657   inline void VertexAttribDivisor(GLuint index, GLuint divisor)
1658   {
1659   }
1660
1661   inline void BindTransformFeedback(GLenum target, GLuint id)
1662   {
1663   }
1664
1665   inline void DeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
1666   {
1667   }
1668
1669   inline void GenTransformFeedbacks(GLsizei n, GLuint* ids)
1670   {
1671   }
1672
1673   inline GLboolean IsTransformFeedback(GLuint id)
1674   {
1675     return false;
1676   }
1677
1678   inline void PauseTransformFeedback(void)
1679   {
1680   }
1681
1682   inline void ResumeTransformFeedback(void)
1683   {
1684   }
1685
1686   inline void GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
1687   {
1688     mGetProgramBinaryCalled = true;
1689   }
1690
1691   inline void ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
1692   {
1693   }
1694
1695   inline void ProgramParameteri(GLuint program, GLenum pname, GLint value)
1696   {
1697   }
1698
1699   inline void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
1700   {
1701   }
1702
1703   inline void InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
1704   {
1705   }
1706
1707   inline void TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
1708   {
1709   }
1710
1711   inline void TexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
1712   {
1713   }
1714
1715   inline void GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
1716   {
1717   }
1718
1719 public: // TEST FUNCTIONS
1720   inline void SetCompileStatus( GLuint value ) { mCompileStatus = value; }
1721   inline void SetLinkStatus( GLuint value ) { mLinkStatus = value; }
1722   inline void SetGetAttribLocationResult(  int result) { mGetAttribLocationResult = result; }
1723   inline void SetGetErrorResult(  GLenum result) { mGetErrorResult = result; }
1724   inline void SetGetStringResult(  GLubyte* result) { mGetStringResult = result; }
1725   inline void SetIsBufferResult(  GLboolean result) { mIsBufferResult = result; }
1726   inline void SetIsEnabledResult(  GLboolean result) { mIsEnabledResult = result; }
1727   inline void SetIsFramebufferResult(  GLboolean result) { mIsFramebufferResult = result; }
1728   inline void SetIsProgramResult(  GLboolean result) { mIsProgramResult = result; }
1729   inline void SetIsRenderbufferResult(  GLboolean result) { mIsRenderbufferResult = result; }
1730   inline void SetIsShaderResult(  GLboolean result) { mIsShaderResult = result; }
1731   inline void SetIsTextureResult(  GLboolean result) { mIsTextureResult = result; }
1732   inline void SetCheckFramebufferStatusResult(  GLenum result) { mCheckFramebufferStatusResult = result; }
1733   inline void SetNumBinaryFormats( GLint numFormats ) { mNumBinaryFormats = numFormats; }
1734   inline void SetBinaryFormats( GLint binaryFormats ) { mBinaryFormats = binaryFormats; }
1735   inline void SetProgramBinaryLength( GLint length ) { mProgramBinaryLength = length; }
1736
1737   inline bool GetVertexAttribArrayState(GLuint index)
1738   {
1739     if( index >= MAX_ATTRIBUTE_CACHE_SIZE )
1740     {
1741       // out of range
1742       return false;
1743     }
1744     return mVertexAttribArrayState[ index ];
1745   }
1746   inline void ClearVertexAttribArrayChanged() {  mVertexAttribArrayChanged = false; }
1747   inline bool GetVertexAttribArrayChanged()  { return mVertexAttribArrayChanged; }
1748
1749   //Methods for CullFace verification
1750   inline void EnableCullFaceCallTrace(bool enable) { mCullFaceTrace.Enable(enable); }
1751   inline void ResetCullFaceCallStack() { mCullFaceTrace.Reset(); }
1752   inline TraceCallStack& GetCullFaceTrace() { return mCullFaceTrace; }
1753
1754   //Methods for Enable/Disable call verification
1755   inline void EnableEnableDisableCallTrace(bool enable) { mEnableDisableTrace.Enable(enable); }
1756   inline void ResetEnableDisableCallStack() { mEnableDisableTrace.Reset(); }
1757   inline TraceCallStack& GetEnableDisableTrace() { return mEnableDisableTrace; }
1758
1759   //Methods for Shader verification
1760   inline void EnableShaderCallTrace(bool enable) { mShaderTrace.Enable(enable); }
1761   inline void ResetShaderCallStack() { mShaderTrace.Reset(); }
1762   inline TraceCallStack& GetShaderTrace() { return mShaderTrace; }
1763
1764   //Methods for Texture verification
1765   inline void EnableTextureCallTrace(bool enable) { mTextureTrace.Enable(enable); }
1766   inline void ResetTextureCallStack() { mTextureTrace.Reset(); }
1767   inline TraceCallStack& GetTextureTrace() { return mTextureTrace; }
1768
1769   //Methods for Texture verification
1770   inline void EnableTexParameterCallTrace(bool enable) { mTexParamaterTrace.Enable(enable); }
1771   inline void ResetTexParameterCallStack() { mTexParamaterTrace.Reset(); }
1772   inline TraceCallStack& GetTexParameterTrace() { return mTexParamaterTrace; }
1773
1774   //Methods for Draw verification
1775   inline void EnableDrawCallTrace(bool enable) { mDrawTrace.Enable(enable); }
1776   inline void ResetDrawCallStack() { mDrawTrace.Reset(); }
1777   inline TraceCallStack& GetDrawTrace() { return mDrawTrace; }
1778
1779   //Methods for Depth function verification
1780   inline void EnableDepthFunctionCallTrace(bool enable) { mDepthFunctionTrace.Enable(enable); }
1781   inline void ResetDepthFunctionCallStack() { mDepthFunctionTrace.Reset(); }
1782   inline TraceCallStack& GetDepthFunctionTrace() { return mDepthFunctionTrace; }
1783
1784   template <typename T>
1785   inline bool GetUniformValue( const char* name, T& value ) const
1786   {
1787     for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
1788           program_it != mUniforms.end();
1789           ++program_it )
1790     {
1791       const UniformIDMap &uniformIDs = program_it->second;
1792
1793       UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
1794       if( uniform_it != uniformIDs.end() )
1795       {
1796         // found one matching uniform name, lets check the value...
1797         GLuint programId = program_it->first;
1798         GLint uniformId = uniform_it->second;
1799
1800         const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
1801         return mProgramUniforms.GetUniformValue( programId, uniformId, value );
1802       }
1803     }
1804     return false;
1805   }
1806
1807
1808   template <typename T>
1809   inline bool CheckUniformValue( const char* name, const T& value ) const
1810   {
1811     for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
1812           program_it != mUniforms.end();
1813           ++program_it )
1814     {
1815       const UniformIDMap &uniformIDs = program_it->second;
1816
1817       UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
1818       if( uniform_it != uniformIDs.end() )
1819       {
1820         // found one matching uniform name, lets check the value...
1821         GLuint programId = program_it->first;
1822         GLint uniformId = uniform_it->second;
1823
1824         const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
1825         if( mProgramUniforms.CheckUniformValue( programId, uniformId, value ) )
1826         {
1827           // the value matches
1828           return true;
1829         }
1830       }
1831     }
1832
1833     fprintf(stderr, "Not found, printing possible values:\n" );
1834     for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
1835           program_it != mUniforms.end();
1836           ++program_it )
1837     {
1838       const UniformIDMap &uniformIDs = program_it->second;
1839
1840       UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
1841       if( uniform_it != uniformIDs.end() )
1842       {
1843         // found one matching uniform name, lets check the value...
1844         GLuint programId = program_it->first;
1845         GLint uniformId = uniform_it->second;
1846
1847         const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( value );
1848         T origValue;
1849         if ( mProgramUniforms.GetUniformValue(programId, uniformId, origValue) )
1850         {
1851           std::stringstream out;
1852           out << uniform_it->first << ": " << origValue;
1853           fprintf(stderr, "%s\n", out.str().c_str() );
1854         }
1855       }
1856     }
1857     return false;
1858   }
1859
1860   template <typename T>
1861   inline bool GetUniformValue( GLuint programId, GLuint uniformId, T& outValue) const
1862   {
1863     const ProgramUniformValue<T> &mProgramUniforms = GetProgramUniformsForType( outValue );
1864     return mProgramUniforms.GetUniformValue( programId, uniformId, outValue );
1865   }
1866
1867   inline bool GetUniformIds( const char* name, GLuint& programId, GLuint& uniformId ) const
1868   {
1869     for( ProgramUniformMap::const_iterator program_it = mUniforms.begin();
1870           program_it != mUniforms.end();
1871           ++program_it )
1872     {
1873       const UniformIDMap &uniformIDs = program_it->second;
1874
1875       UniformIDMap::const_iterator uniform_it = uniformIDs.find( name );
1876       if( uniform_it != uniformIDs.end() )
1877       {
1878         programId = program_it->first;
1879         uniformId = uniform_it->second;
1880         return true;
1881       }
1882     }
1883     return false;
1884   }
1885
1886   inline GLuint GetLastShaderCompiled() const
1887   {
1888     return mLastShaderCompiled;
1889   }
1890
1891   inline GLuint GetLastProgramCreated() const
1892   {
1893     return mLastProgramIdUsed;
1894   }
1895
1896   inline GLbitfield GetLastClearMask() const
1897   {
1898     return mLastClearBitMask;
1899   }
1900
1901   enum AttribType
1902   {
1903     ATTRIB_UNKNOWN = -1,
1904     ATTRIB_POSITION,
1905     ATTRIB_NORMAL,
1906     ATTRIB_TEXCOORD,
1907     ATTRIB_COLOR,
1908     ATTRIB_BONE_WEIGHTS,
1909     ATTRIB_BONE_INDICES,
1910     ATTRIB_TYPE_LAST
1911   };
1912
1913   struct ScissorParams
1914   {
1915     GLint x;
1916     GLint y;
1917     GLsizei width;
1918     GLsizei height;
1919
1920     ScissorParams() : x( 0 ), y( 0 ), width( 0 ), height( 0 ) { }
1921   };
1922
1923   // Methods to check scissor tests
1924   inline const ScissorParams& GetScissorParams() const { return mScissorParams; }
1925
1926   inline bool GetProgramBinaryCalled() const { return mGetProgramBinaryCalled; }
1927
1928   inline unsigned int GetClearCountCalled() const { return mClearCount; }
1929
1930   typedef std::vector<size_t> BufferDataCalls;
1931   inline const BufferDataCalls& GetBufferDataCalls() const { return mBufferDataCalls; }
1932   inline void ResetBufferDataCalls() { mBufferDataCalls.clear(); }
1933
1934   typedef std::vector<size_t> BufferSubDataCalls;
1935   inline const BufferSubDataCalls& GetBufferSubDataCalls() const { return mBufferSubDataCalls; }
1936   inline void ResetBufferSubDataCalls() { mBufferSubDataCalls.clear(); }
1937
1938 private:
1939   GLuint     mCurrentProgram;
1940   GLuint     mCompileStatus;
1941   BufferDataCalls mBufferDataCalls;
1942   BufferSubDataCalls mBufferSubDataCalls;
1943   GLuint     mLinkStatus;
1944   GLint      mNumberOfActiveUniforms;
1945   GLint      mGetAttribLocationResult;
1946   GLenum     mGetErrorResult;
1947   GLubyte*   mGetStringResult;
1948   GLboolean  mIsBufferResult;
1949   GLboolean  mIsEnabledResult;
1950   GLboolean  mIsFramebufferResult;
1951   GLboolean  mIsProgramResult;
1952   GLboolean  mIsRenderbufferResult;
1953   GLboolean  mIsShaderResult;
1954   GLboolean  mIsTextureResult;
1955   GLenum     mActiveTextureUnit;
1956   GLenum     mCheckFramebufferStatusResult;
1957   GLint      mFramebufferStatus;
1958   GLenum     mFramebufferColorAttached;
1959   GLenum     mFramebufferDepthAttached;
1960   GLenum     mFramebufferStencilAttached;
1961   GLint      mNumBinaryFormats;
1962   GLint      mBinaryFormats;
1963   GLint      mProgramBinaryLength;
1964   bool       mVertexAttribArrayState[MAX_ATTRIBUTE_CACHE_SIZE];
1965   bool       mVertexAttribArrayChanged;                            // whether the vertex attrib array has been changed
1966   bool       mGetProgramBinaryCalled;
1967   typedef std::map< GLuint, std::string> ShaderSourceMap;
1968   ShaderSourceMap mShaderSources;
1969   GLuint     mLastShaderCompiled;
1970   GLbitfield mLastClearBitMask;
1971   unsigned int mClearCount;
1972
1973   Vector4 mLastBlendColor;
1974   GLenum  mLastBlendEquationRgb;
1975   GLenum  mLastBlendEquationAlpha;
1976   GLenum  mLastBlendFuncSrcRgb;
1977   GLenum  mLastBlendFuncDstRgb;
1978   GLenum  mLastBlendFuncSrcAlpha;
1979   GLenum  mLastBlendFuncDstAlpha;
1980
1981   // Data for manipulating the IDs returned by GenTextures
1982   GLuint mLastAutoTextureIdUsed;
1983   std::vector<GLuint> mNextTextureIds;
1984   std::vector<GLuint> mDeletedTextureIds;
1985   std::vector<GLuint> mBoundTextures;
1986
1987   struct ActiveTextureType
1988   {
1989     std::vector<GLuint> mBoundTextures;
1990   };
1991
1992   ActiveTextureType mActiveTextures[ MIN_TEXTURE_UNIT_LIMIT ];
1993
1994   TraceCallStack mCullFaceTrace;
1995   TraceCallStack mEnableDisableTrace;
1996   TraceCallStack mShaderTrace;
1997   TraceCallStack mTextureTrace;
1998   TraceCallStack mTexParamaterTrace;
1999   TraceCallStack mDrawTrace;
2000   TraceCallStack mDepthFunctionTrace;
2001
2002   // Shaders & Uniforms
2003   GLuint mLastShaderIdUsed;
2004   GLuint mLastProgramIdUsed;
2005   GLuint mLastUniformIdUsed;
2006   typedef std::map< std::string, GLint > UniformIDMap;
2007   typedef std::map< GLuint, UniformIDMap > ProgramUniformMap;
2008   ProgramUniformMap mUniforms;
2009
2010   template <typename T>
2011   struct ProgramUniformValue : public std::map< GLuint, std::map< GLint, T > >
2012   {
2013   public:
2014     typedef std::map< GLint, T > UniformValueMap;
2015     typedef std::map< GLuint, UniformValueMap > Map;
2016
2017     bool SetUniformValue( GLuint program, GLuint uniform, const T& value )
2018     {
2019       if( program == 0 )
2020       {
2021         return false;
2022       }
2023
2024       typename Map::iterator it = Map::find( program );
2025       if( it == Map::end() )
2026       {
2027         // if its the first uniform for this program add it
2028         std::pair< typename Map::iterator, bool > result =
2029             Map::insert( typename Map::value_type( program, UniformValueMap() ) );
2030         it = result.first;
2031       }
2032
2033       UniformValueMap& uniforms = it->second;
2034       uniforms[uniform] = value;
2035
2036       return true;
2037     }
2038
2039     bool CheckUniformValue( GLuint program, GLuint uniform, const T& value ) const
2040     {
2041       T uniformValue;
2042       if ( GetUniformValue( program, uniform, uniformValue ) )
2043       {
2044         return value == uniformValue;
2045       }
2046
2047       return false;
2048     }
2049
2050     bool GetUniformValue( GLuint program, GLuint uniform, T& value ) const
2051     {
2052       if( program == 0 )
2053       {
2054         return false;
2055       }
2056
2057       typename Map::const_iterator it = Map::find( program );
2058       if( it == Map::end() )
2059       {
2060         // Uniform values always initialised as 0
2061         value = GetZero();
2062         return true;
2063       }
2064
2065       const UniformValueMap& uniforms = it->second;
2066       typename UniformValueMap::const_iterator it2 = uniforms.find( uniform );
2067       if( it2 == uniforms.end() )
2068       {
2069         // Uniform values always initialised as 0
2070         value = GetZero();
2071         return true;
2072       }
2073       value = it2->second;
2074
2075       return true;
2076     }
2077
2078     T GetZero() const;
2079   };
2080   ProgramUniformValue<int> mProgramUniforms1i;
2081   ProgramUniformValue<float> mProgramUniforms1f;
2082   ProgramUniformValue<Vector2> mProgramUniforms2f;
2083   ProgramUniformValue<Vector3> mProgramUniforms3f;
2084   ProgramUniformValue<Vector4> mProgramUniforms4f;
2085   ProgramUniformValue<Matrix> mProgramUniformsMat4;
2086   ProgramUniformValue<Matrix3> mProgramUniformsMat3;
2087
2088   inline const ProgramUniformValue<int>& GetProgramUniformsForType( const int ) const
2089   {
2090     return mProgramUniforms1i;
2091   }
2092   inline const ProgramUniformValue<float>& GetProgramUniformsForType( const float ) const
2093   {
2094     return mProgramUniforms1f;
2095   }
2096   inline const ProgramUniformValue<Vector2>& GetProgramUniformsForType( const Vector2& ) const
2097   {
2098     return mProgramUniforms2f;
2099   }
2100   inline const ProgramUniformValue<Vector3>& GetProgramUniformsForType( const Vector3& ) const
2101   {
2102     return mProgramUniforms3f;
2103   }
2104   inline const ProgramUniformValue<Vector4>& GetProgramUniformsForType( const Vector4& ) const
2105   {
2106     return mProgramUniforms4f;
2107   }
2108   inline const ProgramUniformValue<Matrix>& GetProgramUniformsForType( const Matrix& ) const
2109   {
2110     return mProgramUniformsMat4;
2111   }
2112   inline const ProgramUniformValue<Matrix3>& GetProgramUniformsForType( const Matrix3& ) const
2113   {
2114     return mProgramUniformsMat3;
2115   }
2116   inline void SetVertexAttribArray(GLuint index, bool state)
2117   {
2118     if( index >= MAX_ATTRIBUTE_CACHE_SIZE )
2119     {
2120       // out of range
2121       return;
2122     }
2123     mVertexAttribArrayState[ index ] = state;
2124     mVertexAttribArrayChanged = true;
2125   }
2126
2127   ScissorParams mScissorParams;
2128 };
2129
2130 template <>
2131 inline int TestGlAbstraction::ProgramUniformValue<int>::GetZero() const
2132 {
2133   return 0;
2134 }
2135
2136 template <>
2137 inline float TestGlAbstraction::ProgramUniformValue<float>::GetZero() const
2138 {
2139   return 0.0f;
2140 }
2141
2142 template <>
2143 inline Vector2 TestGlAbstraction::ProgramUniformValue<Vector2>::GetZero() const
2144 {
2145   return Vector2::ZERO;
2146 }
2147
2148 template <>
2149 inline Vector3 TestGlAbstraction::ProgramUniformValue<Vector3>::GetZero() const
2150 {
2151   return Vector3::ZERO;
2152 }
2153
2154 template <>
2155 inline Vector4 TestGlAbstraction::ProgramUniformValue<Vector4>::GetZero() const
2156 {
2157   return Vector4::ZERO;
2158 }
2159
2160 template <>
2161 inline Matrix TestGlAbstraction::ProgramUniformValue<Matrix>::GetZero() const
2162 {
2163   return Matrix();
2164 }
2165
2166 template <>
2167 inline Matrix3 TestGlAbstraction::ProgramUniformValue<Matrix3>::GetZero() const
2168 {
2169   return Matrix3( Matrix() );
2170 }
2171
2172 } // namespace Dali
2173
2174 bool BlendEnabled(const Dali::TraceCallStack& callStack);
2175 bool BlendDisabled(const Dali::TraceCallStack& callStack);
2176
2177
2178
2179
2180 #endif // __TEST_GL_ES_H__