X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-gl-abstraction.h;h=1fe97c16ef5ae66d5bfe6a22067811bdc4bef161;hb=2bba426880bd73a3b763623a3b32c3bd23b7dd90;hp=516b3661757cd7311a348e8901388e2b9ef3757e;hpb=b1794535bb9e63b0706dcbd92af82a13962b51c4;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h index 516b366..1fe97c1 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h @@ -19,11 +19,12 @@ */ // EXTERNAL INCLUDES -#include // fprintf #include #include -#include // for strcpy, strncpy +#include #include +#include +#include // for strcmp // INTERNAL INCLUDES #include @@ -54,7 +55,7 @@ public: void Initialize(); void PreRender(); - void PostRender(unsigned int timeDelta); + void PostRender(); /* OpenGL ES 2.0 */ @@ -85,6 +86,8 @@ public: inline void BindFramebuffer( GLenum target, GLuint framebuffer ) { + //Add 010 bit; + mFramebufferStatus |= 2; } inline void BindRenderbuffer( GLenum target, GLuint renderbuffer ) @@ -214,19 +217,45 @@ public: inline void BufferData(GLenum target, GLsizeiptr size, const void* data, GLenum usage) { + mBufferDataCalls.push_back(size); } inline void BufferSubData(GLenum target, GLintptr offset, GLsizeiptr size, const void* data) { + mBufferSubDataCalls.push_back(size); } inline GLenum CheckFramebufferStatus(GLenum target) { + //If it has the three last bits set to 1 - 111, then the three minimum functions to create a + //Framebuffer texture have been called + if( mFramebufferStatus == 7 ) + { + return GL_FRAMEBUFFER_COMPLETE; + } + return mCheckFramebufferStatusResult; } + inline GLenum CheckFramebufferColorAttachment() + { + return mFramebufferColorAttached; + } + + inline GLenum CheckFramebufferDepthAttachment() + { + return mFramebufferDepthAttached; + } + + inline GLenum CheckFramebufferStencilAttachment() + { + return mFramebufferStencilAttached; + } + inline void Clear(GLbitfield mask) { + mClearCount++; + mLastClearBitMask = mask; } inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) @@ -322,11 +351,11 @@ public: inline void DeleteTextures(GLsizei n, const GLuint* textures) { std::stringstream out; - out << n << ", " << textures << " = [" ; + out << n << ", " << textures << " = ["; for(GLsizei i=0; ifirst << ": " << origValue; - fprintf(stderr, "%s", out.str().c_str() ); + fprintf(stderr, "%s\n", out.str().c_str() ); } } } @@ -1649,8 +1736,6 @@ public: // TEST FUNCTIONS return false; } - - inline GLuint GetLastShaderCompiled() const { return mLastShaderCompiled; @@ -1661,6 +1746,11 @@ public: // TEST FUNCTIONS return mLastProgramIdUsed; } + inline GLbitfield GetLastClearMask() const + { + return mLastClearBitMask; + } + enum AttribType { ATTRIB_UNKNOWN = -1, @@ -1686,10 +1776,25 @@ public: // TEST FUNCTIONS // Methods to check scissor tests inline const ScissorParams& GetScissorParams() const { return mScissorParams; } + inline bool GetProgramBinaryCalled() const { return mGetProgramBinaryCalled; } + + inline unsigned int GetClearCountCalled() const { return mClearCount; } + + typedef std::vector BufferDataCalls; + inline const BufferDataCalls& GetBufferDataCalls() const { return mBufferDataCalls; } + inline void ResetBufferDataCalls() { mBufferDataCalls.clear(); } + + typedef std::vector BufferSubDataCalls; + inline const BufferSubDataCalls& GetBufferSubDataCalls() const { return mBufferSubDataCalls; } + inline void ResetBufferSubDataCalls() { mBufferSubDataCalls.clear(); } + private: GLuint mCurrentProgram; GLuint mCompileStatus; + BufferDataCalls mBufferDataCalls; + BufferSubDataCalls mBufferSubDataCalls; GLuint mLinkStatus; + GLint mNumberOfActiveUniforms; GLint mGetAttribLocationResult; GLenum mGetErrorResult; GLubyte* mGetStringResult; @@ -1702,14 +1807,21 @@ private: GLboolean mIsTextureResult; GLenum mActiveTextureUnit; GLenum mCheckFramebufferStatusResult; + GLint mFramebufferStatus; + GLenum mFramebufferColorAttached; + GLenum mFramebufferDepthAttached; + GLenum mFramebufferStencilAttached; GLint mNumBinaryFormats; GLint mBinaryFormats; GLint mProgramBinaryLength; bool mVertexAttribArrayState[MAX_ATTRIBUTE_CACHE_SIZE]; bool mVertexAttribArrayChanged; // whether the vertex attrib array has been changed + bool mGetProgramBinaryCalled; typedef std::map< GLuint, std::string> ShaderSourceMap; ShaderSourceMap mShaderSources; GLuint mLastShaderCompiled; + GLbitfield mLastClearBitMask; + unsigned int mClearCount; Vector4 mLastBlendColor; GLenum mLastBlendEquationRgb; @@ -1733,6 +1845,7 @@ private: ActiveTextureType mActiveTextures[ MIN_TEXTURE_UNIT_LIMIT ]; TraceCallStack mCullFaceTrace; + TraceCallStack mEnableDisableTrace; TraceCallStack mShaderTrace; TraceCallStack mTextureTrace; TraceCallStack mTexParamaterTrace;