/*
-- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
++ * Copyright (c) 2021 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.
END_TEST;
}
- float inputTime = 0.6f;
+ int UtcDaliAnimationKeyFramesGetKeyFrameCountP(void)
+ {
+ TestApplication application;
+
+ KeyFrames keyFrames = KeyFrames::New();
+ keyFrames.Add(0.0f, Vector4(0.0f, 0.0f, 0.0f, 0.6f));
+ keyFrames.Add(0.6f, Vector4(0.0f, 0.0f, 0.0f, 0.3f));
+ keyFrames.Add(1.0f, Vector4(0.0f, 0.0f, 0.0f, 0.8f));
+
+ DALI_TEST_EQUALS(DevelKeyFrames::GetKeyFrameCount(keyFrames), 3, TEST_LOCATION);
+
+ END_TEST;
+ }
+
+ int UtcDaliAnimationKeyFramesGetKeyFrameP(void)
+ {
+ TestApplication application;
+
- float outputTime;
++ float inputTime = 0.6f;
+ Vector4 inputValue = Vector4(0.0f, 0.0f, 0.0f, 0.3f);
+
+ KeyFrames keyFrames = KeyFrames::New();
+ keyFrames.Add(0.0f, Vector4(0.0f, 0.0f, 0.0f, 0.6f));
+ keyFrames.Add(inputTime, inputValue);
+ keyFrames.Add(1.0f, Vector4(0.0f, 0.0f, 0.0f, 0.8f));
+
++ float outputTime;
+ Property::Value outputValue;
+
+ DevelKeyFrames::GetKeyFrame(keyFrames, 3, outputTime, outputValue);
+
+ DALI_TEST_EQUALS(outputValue.GetType(), Property::Type::NONE, TEST_LOCATION);
+
+ DevelKeyFrames::GetKeyFrame(keyFrames, 1, outputTime, outputValue);
+
+ DALI_TEST_EQUALS(outputTime, inputTime, TEST_LOCATION);
+ DALI_TEST_EQUALS(outputValue.GetType(), Property::Type::VECTOR4, TEST_LOCATION);
+ DALI_TEST_EQUALS(outputValue.Get<Vector4>(), inputValue, TEST_LOCATION);
+
+ END_TEST;
+ }
+
int UtcDaliAnimationAnimateBetweenActorColorAlphaP(void)
{
TestApplication application;
Actor actor = Actor::New();
application.GetScene().Add(actor);
-- const float durationSeconds(1.0f);
++ const float durationSeconds(1.0f);
const Vector3 targetPosition1(10.0f, 10.0f, 10.0f);
const Vector3 targetPosition2(20.0f, 20.0f, 20.0f);
--- /dev/null
-
+ /*
+ * Copyright (c) 2021 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+ // INTERNAL INCLUDES
+ #include <dali/devel-api/animation/key-frames-devel.h>
+ #include <dali/internal/event/animation/key-frames-impl.h>
+
+ namespace Dali
+ {
+ namespace DevelKeyFrames
+ {
+ std::size_t GetKeyFrameCount(KeyFrames keyFrames)
+ {
+ return GetImplementation(keyFrames).GetKeyFrameCount();
+ }
+
+ void GetKeyFrame(KeyFrames keyFrames, std::size_t index, float& time, Property::Value& value)
+ {
+ GetImplementation(keyFrames).GetKeyFrame(index, time, value);
+ }
+
+ } // namespace DevelKeyFrames
+
+ } // namespace Dali
: mRenderDataProvider(dataProvider),
mContext(nullptr),
mGeometry(geometry),
+ mProgramCache(nullptr),
mUniformIndexMap(),
- mAttributesLocation(),
+ mAttributeLocations(),
mUniformsHash(),
mStencilParameters(stencilParameters),
mBlendingOptions(),
mBlendingOptions.SetBlendColor(blendColor);
}
- void Renderer::Initialize(Context& context, Graphics::Controller& graphicsController)
-void Renderer::Initialize(Context& context, ProgramCache& programCache)
++void Renderer::Initialize(Context& context, Graphics::Controller& graphicsController, ProgramCache& programCache)
{
- mContext = &context;
- mProgramCache = &programCache;
+ mContext = &context;
+ mGraphicsController = &graphicsController;
++ mProgramCache = &programCache;
}
Renderer::~Renderer() = default;
/**
* Second-phase construction.
* This is called when the renderer is inside render thread
- * @param[in] context Context used by the renderer
+ * @param[in] context Context used by the renderer (To be removed)
+ * @param[in] graphicsController The graphics controller to use
+ * @param[in] programCache Cache of program objects
*/
- void Initialize(Context& context, Graphics::Controller& graphicsController);
- void Initialize(Context& context, ProgramCache& programCache);
++ void Initialize(Context& context, Graphics::Controller& graphicsController, ProgramCache& programCache);
/**
* Destructor