X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git;a=blobdiff_plain;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-gl-abstraction.h;h=9f458fc06a796a3444cca33671776b579543441a;hp=c68573b03af0f01786ab5fac32a829ebbe308c23;hb=610495b8647d1a25c98bf0773ccc0dd6d1996263;hpb=1cf23834278cfe07a5078738d8498ad851b7b226 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 c68573b..9f458fc 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 @@ -2,7 +2,7 @@ #define TEST_GL_ABSTRACTION_H /* - * Copyright (c) 2018 Samsung Electronics Co., Ltd. + * Copyright (c) 2020 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,6 +29,7 @@ // INTERNAL INCLUDES #include +#include #include #include #include @@ -59,6 +60,10 @@ public: void PreRender(); void PostRender(); + bool IsSurfacelessContextSupported() const; + + bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const; + /* OpenGL ES 2.0 */ inline void ActiveTexture( GLenum textureUnit ) @@ -248,9 +253,9 @@ public: return mCheckFramebufferStatusResult; } - inline GLenum CheckFramebufferColorAttachment() + inline GLuint CheckFramebufferColorAttachmentCount() { - return mFramebufferColorAttached; + return mFramebufferColorAttachmentCount; } inline GLenum CheckFramebufferDepthAttachment() @@ -271,6 +276,15 @@ public: inline void ClearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha) { + mLastClearColor.r = red; + mLastClearColor.g = green; + mLastClearColor.b = blue; + mLastClearColor.a = alpha; + } + + inline const Vector4& GetLastClearColor() const + { + return mLastClearColor; } inline void ClearDepthf(GLclampf depth) @@ -571,9 +585,14 @@ public: mFramebufferStatus |= 4; //We check 4 attachment colors - if ((attachment == GL_COLOR_ATTACHMENT0) || (attachment == GL_COLOR_ATTACHMENT1) || (attachment == GL_COLOR_ATTACHMENT2) || (attachment == GL_COLOR_ATTACHMENT4)) + if ((attachment >= GL_COLOR_ATTACHMENT0) && (attachment < GL_COLOR_ATTACHMENT0 + Dali::DevelFrameBuffer::MAX_COLOR_ATTACHMENTS)) { - mFramebufferColorAttached = true; + uint8_t mask = 1 << (attachment - GL_COLOR_ATTACHMENT0); + if ((mFrameBufferColorStatus & mask) == 0) + { + mFrameBufferColorStatus |= mask; + ++mFramebufferColorAttachmentCount; + } } } @@ -1432,6 +1451,10 @@ public: inline void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) { + std::string commaString(", "); + std::string params( std::to_string(x) + commaString + std::to_string(y) + commaString + std::to_string(width) + commaString + std::to_string(height) ); + + mViewportTrace.PushCall("Viewport", params); } /* OpenGL ES 3.0 */ @@ -1970,6 +1993,11 @@ public: // TEST FUNCTIONS inline void ResetSetUniformCallStack() { mSetUniformTrace.Reset(); } inline TraceCallStack& GetSetUniformTrace() { return mSetUniformTrace; } + //Methods for Viewport verification + inline void EnableViewportCallTrace(bool enable) { mViewportTrace.Enable(enable); } + inline void ResetViewportCallStack() { mViewportTrace.Reset(); } + inline TraceCallStack& GetViewportTrace() { return mViewportTrace; } + template inline bool GetUniformValue( const char* name, T& value ) const { @@ -2156,9 +2184,10 @@ private: GLenum mActiveTextureUnit; GLenum mCheckFramebufferStatusResult; GLint mFramebufferStatus; - GLenum mFramebufferColorAttached; GLenum mFramebufferDepthAttached; GLenum mFramebufferStencilAttached; + GLuint mFramebufferColorAttachmentCount; + GLuint mFrameBufferColorStatus; GLint mNumBinaryFormats; GLint mBinaryFormats; GLint mProgramBinaryLength; @@ -2169,6 +2198,7 @@ private: ShaderSourceMap mShaderSources; GLuint mLastShaderCompiled; GLbitfield mLastClearBitMask; + Vector4 mLastClearColor; unsigned int mClearCount; Vector4 mLastBlendColor; @@ -2205,6 +2235,7 @@ private: TraceCallStack mStencilFunctionTrace; TraceCallStack mScissorTrace; TraceCallStack mSetUniformTrace; + TraceCallStack mViewportTrace; // Shaders & Uniforms GLuint mLastShaderIdUsed;