2 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #include "test-gl-abstraction.h"
23 TestGlAbstraction::TestGlAbstraction()
28 TestGlAbstraction::~TestGlAbstraction() {}
30 void TestGlAbstraction::Initialize()
33 mCompileStatus = GL_TRUE;
34 mLinkStatus = GL_TRUE;
35 mNumberOfActiveUniforms = 0;
36 mGetAttribLocationResult = 0;
38 mGetStringResult = NULL;
41 mIsFramebufferResult = 0;
43 mIsRenderbufferResult = 0;
46 mActiveTextureUnit = 0;
47 mCheckFramebufferStatusResult = 0;
48 mFramebufferStatus = 0;
49 mFramebufferDepthAttached = 0;
50 mFramebufferStencilAttached = 0;
51 mFramebufferColorAttachmentCount = 0;
52 mFrameBufferColorStatus = 0;
53 mNumBinaryFormats = 0;
55 mProgramBinaryLength = 0;
57 mVertexAttribArrayChanged = false;
58 mGetProgramBinaryCalled = false;
60 mLastShaderCompiled = 0;
61 mLastClearBitMask = 0;
62 mLastClearColor = Color::TRANSPARENT;
65 mLastBlendEquationRgb = 0;
66 mLastBlendEquationAlpha = 0;
67 mLastBlendFuncSrcRgb = 0;
68 mLastBlendFuncDstRgb = 0;
69 mLastBlendFuncSrcAlpha = 0;
70 mLastBlendFuncDstAlpha = 0;
71 mLastAutoTextureIdUsed = 0;
72 mNumGeneratedTextures = 0;
73 mLastShaderIdUsed = 0;
74 mLastProgramIdUsed = 0;
75 mLastUniformIdUsed = 0;
76 mLastDepthMask = false;
79 mProgramUniforms1i.clear();
80 mProgramUniforms1f.clear();
81 mProgramUniforms2f.clear();
82 mProgramUniforms3f.clear();
83 mProgramUniforms4f.clear();
85 mCullFaceTrace.Reset();
86 mDepthFunctionTrace.Reset();
87 mEnableDisableTrace.Reset();
89 mStencilFunctionTrace.Reset();
90 mScissorTrace.Reset();
91 mTextureTrace.Reset();
92 mTexParamaterTrace.Reset();
95 for( unsigned int i=0; i<MAX_ATTRIBUTE_CACHE_SIZE; ++i )
97 mVertexAttribArrayState[i] = false;
101 void TestGlAbstraction::PreRender()
105 void TestGlAbstraction::PostRender()
109 bool TestGlAbstraction::IsSurfacelessContextSupported() const
114 bool TestGlAbstraction::TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
116 return ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
121 bool BlendEnabled(const Dali::TraceCallStack& callStack)
123 std::stringstream out;
125 bool blendEnabled = callStack.FindMethodAndParams( "Enable", out.str() );
129 bool BlendDisabled(const Dali::TraceCallStack& callStack)
131 std::stringstream out;
133 bool blendEnabled = callStack.FindMethodAndParams( "Disable", out.str() );