2 * Copyright (c) 2020 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"
22 TestGlAbstraction::TestGlAbstraction()
27 TestGlAbstraction::~TestGlAbstraction()
31 void TestGlAbstraction::Initialize()
34 mCompileStatus = GL_TRUE;
35 mLinkStatus = GL_TRUE;
36 mNumberOfActiveUniforms = 0;
37 mGetAttribLocationResult = 0;
39 mGetStringResult = NULL;
42 mIsFramebufferResult = 0;
44 mIsRenderbufferResult = 0;
47 mActiveTextureUnit = 0;
48 mCheckFramebufferStatusResult = 0;
49 mFramebufferStatus = 0;
50 mFramebufferDepthAttached = 0;
51 mFramebufferStencilAttached = 0;
52 mFramebufferColorAttachmentCount = 0;
53 mFrameBufferColorStatus = 0;
54 mNumBinaryFormats = 0;
56 mProgramBinaryLength = 0;
58 mVertexAttribArrayChanged = false;
59 mGetProgramBinaryCalled = false;
61 mLastShaderCompiled = 0;
62 mLastClearBitMask = 0;
63 mLastClearColor = Color::TRANSPARENT;
66 mLastBlendEquationRgb = 0;
67 mLastBlendEquationAlpha = 0;
68 mLastBlendFuncSrcRgb = 0;
69 mLastBlendFuncDstRgb = 0;
70 mLastBlendFuncSrcAlpha = 0;
71 mLastBlendFuncDstAlpha = 0;
72 mLastAutoTextureIdUsed = 0;
73 mNumGeneratedTextures = 0;
74 mLastShaderIdUsed = 0;
75 mLastProgramIdUsed = 0;
76 mLastUniformIdUsed = 0;
77 mLastDepthMask = false;
80 mProgramUniforms1i.clear();
81 mProgramUniforms1f.clear();
82 mProgramUniforms2f.clear();
83 mProgramUniforms3f.clear();
84 mProgramUniforms4f.clear();
86 mCullFaceTrace.Reset();
87 mDepthFunctionTrace.Reset();
88 mEnableDisableTrace.Reset();
90 mStencilFunctionTrace.Reset();
91 mScissorTrace.Reset();
92 mTextureTrace.Reset();
93 mTexParamaterTrace.Reset();
96 for(unsigned int i = 0; i < MAX_ATTRIBUTE_CACHE_SIZE; ++i)
98 mVertexAttribArrayState[i] = false;
102 void TestGlAbstraction::PreRender()
106 void TestGlAbstraction::PostRender()
110 bool TestGlAbstraction::IsSurfacelessContextSupported() const
115 bool TestGlAbstraction::TextureRequiresConverting(const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage) const
117 return ((imageGlFormat == GL_RGB) && (textureGlFormat == GL_RGBA));
122 bool BlendEnabled(const Dali::TraceCallStack& callStack)
124 std::stringstream out;
126 bool blendEnabled = callStack.FindMethodAndParams("Enable", out.str());
130 bool BlendDisabled(const Dali::TraceCallStack& callStack)
132 std::stringstream out;
134 bool blendEnabled = callStack.FindMethodAndParams("Disable", out.str());