Fix incorrect calc of GetHeightForWidth in TextLabel
[platform/core/uifw/dali-toolkit.git] / automated-tests / src / dali-toolkit / dali-toolkit-test-utils / test-graphics-program.cpp
index 1b23380..8f2e0c7 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
 
 namespace Dali
 {
-TestGraphicsProgram::TestGraphicsProgram(TestGlAbstraction& gl, const Graphics::ProgramCreateInfo& createInfo, Property::Array& vertexFormats)
+TestGraphicsProgramImpl::TestGraphicsProgramImpl(TestGlAbstraction& gl, const Graphics::ProgramCreateInfo& createInfo, Property::Array& vertexFormats, std::vector<UniformData>& customUniforms)
 : mGl(gl),
+  mId(gl.CreateProgram()),
   mCreateInfo(createInfo),
-  mReflection(gl, vertexFormats)
+  mReflection(gl, mId, vertexFormats, createInfo, customUniforms)
 {
-  mId = 0;//mGl.CreateProgram();
+  // Ensure active sampler uniforms are set
+  mGl.SetCustomUniforms(customUniforms);
+
+  // Don't need to re-register uniforms in GL side - now done in creation of mReflection.
+  // Was previously done in mGl.LinkProgram(mId);
 }
 
-bool TestGraphicsProgram::GetParameter(uint32_t parameterId, void* outData )
+bool TestGraphicsProgramImpl::GetParameter(uint32_t parameterId, void* outData)
 {
   reinterpret_cast<uint32_t*>(outData)[0] = mId;
   return true;
 }
 
-
+TestGraphicsProgram::TestGraphicsProgram(TestGraphicsProgramImpl* impl)
+{
+  mImpl = impl;
+}
 
 } // namespace Dali