#define TEST_GL_ABSTRACTION_H
/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
"aBoneIndices" // ATTRIB_BONE_INDICES
};
-class DALI_IMPORT_API TestGlAbstraction: public Dali::Integration::GlAbstraction
+class DALI_CORE_API TestGlAbstraction: public Dali::Integration::GlAbstraction
{
public:
TestGlAbstraction();
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 )
return mCheckFramebufferStatusResult;
}
- inline GLenum CheckFramebufferColorAttachment()
+ inline GLuint CheckFramebufferColorAttachmentCount()
{
- return mFramebufferColorAttached;
+ return mFramebufferColorAttachmentCount;
}
inline GLenum CheckFramebufferDepthAttachment()
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)
paramName<<"texture["<<i<<"]";
namedParams[paramName.str()] = ToString(textures[i]);
mDeletedTextureIds.push_back(textures[i]);
+ mNumGeneratedTextures--;
}
out << "]";
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::FrameBuffer::MAX_COLOR_ATTACHMENTS))
{
- mFramebufferColorAttached = true;
+ uint8_t mask = 1 << (attachment - GL_COLOR_ATTACHMENT0);
+ if ((mFrameBufferColorStatus & mask) == 0)
+ {
+ mFrameBufferColorStatus |= mask;
+ ++mFramebufferColorAttachmentCount;
+ }
}
}
{
*(textures+i) = ++mLastAutoTextureIdUsed;
}
+ mNumGeneratedTextures++;
}
TraceCallStack::NamedParams namedParams;
mTextureTrace.PushCall("GenTextures", out.str(), namedParams);
}
+ inline GLuint GetLastGenTextureId()
+ {
+ return mLastAutoTextureIdUsed;
+ }
+ inline GLuint GetNumGeneratedTextures()
+ {
+ return mNumGeneratedTextures;
+ }
+
inline void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
{
}
mScissorParams.y = y;
mScissorParams.width = width;
mScissorParams.height = height;
+
+ std::stringstream out;
+ out << x << ", " << y << ", " << width << ", " << height;
+ TraceCallStack::NamedParams namedParams;
+ namedParams["x"] = ToString( x );
+ namedParams["y"] = ToString( y );
+ namedParams["width"] = ToString( width );
+ namedParams["height"] = ToString( height );
+ mScissorTrace.PushCall( "Scissor", out.str(), namedParams );
}
inline void ShaderBinary(GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
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 */
inline void ResetStencilFunctionCallStack() { mStencilFunctionTrace.Reset(); }
inline TraceCallStack& GetStencilFunctionTrace() { return mStencilFunctionTrace; }
+ //Methods for Scissor verification
+ inline void EnableScissorCallTrace(bool enable) { mScissorTrace.Enable(enable); }
+ inline void ResetScissorCallStack() { mScissorTrace.Reset(); }
+ inline TraceCallStack& GetScissorTrace() { return mScissorTrace; }
+
//Methods for Uniform function verification
inline void EnableSetUniformCallTrace(bool enable) { mSetUniformTrace.Enable(enable); }
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 <typename T>
inline bool GetUniformValue( const char* name, T& value ) const
{
GLenum mActiveTextureUnit;
GLenum mCheckFramebufferStatusResult;
GLint mFramebufferStatus;
- GLenum mFramebufferColorAttached;
GLenum mFramebufferDepthAttached;
GLenum mFramebufferStencilAttached;
+ GLuint mFramebufferColorAttachmentCount;
+ GLuint mFrameBufferColorStatus;
GLint mNumBinaryFormats;
GLint mBinaryFormats;
GLint mProgramBinaryLength;
ShaderSourceMap mShaderSources;
GLuint mLastShaderCompiled;
GLbitfield mLastClearBitMask;
+ Vector4 mLastClearColor;
unsigned int mClearCount;
Vector4 mLastBlendColor;
// Data for manipulating the IDs returned by GenTextures
GLuint mLastAutoTextureIdUsed;
+ GLuint mNumGeneratedTextures;
std::vector<GLuint> mNextTextureIds;
std::vector<GLuint> mDeletedTextureIds;
std::vector<GLuint> mBoundTextures;
TraceCallStack mDrawTrace;
TraceCallStack mDepthFunctionTrace;
TraceCallStack mStencilFunctionTrace;
+ TraceCallStack mScissorTrace;
TraceCallStack mSetUniformTrace;
+ TraceCallStack mViewportTrace;
// Shaders & Uniforms
GLuint mLastShaderIdUsed;