END_TEST;
}
-int utcDaliActorPartialUpdateAnimation(void)
+int utcDaliActorPartialUpdateAnimation01(void)
{
TestApplication application(
TestApplication::DEFAULT_SURFACE_WIDTH,
END_TEST;
}
+int utcDaliActorPartialUpdateAnimation02(void)
+{
+ TestApplication application(
+ TestApplication::DEFAULT_SURFACE_WIDTH,
+ TestApplication::DEFAULT_SURFACE_HEIGHT,
+ TestApplication::DEFAULT_HORIZONTAL_DPI,
+ TestApplication::DEFAULT_VERTICAL_DPI,
+ true,
+ true);
+
+ tet_infoline("Check the damaged area with partial update and animation delay");
+
+ TraceCallStack& drawTrace = application.GetGlAbstraction().GetDrawTrace();
+ drawTrace.Enable(true);
+ drawTrace.Reset();
+
+ Actor actor = CreateRenderableActor();
+ actor.SetProperty(Actor::Property::ANCHOR_POINT, AnchorPoint::TOP_LEFT);
+ actor.SetProperty(Actor::Property::SIZE, Vector3(16.0f, 16.0f, 0.0f));
+ application.GetScene().Add(actor);
+
+ std::vector<Rect<int>> damagedRects;
+ Rect<int> clippingRect;
+
+ application.SendNotification();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ // Aligned by 16
+ clippingRect = Rect<int>(0, 784, 32, 32); // in screen coordinates, includes 1 last frames updates
+ DirtyRectChecker(damagedRects, {clippingRect}, true, TEST_LOCATION);
+
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Make an animation
+ Renderer renderer = actor.GetRendererAt(0);
+ Animation animation = Animation::New(1.0f);
+ animation.AnimateTo(Property(renderer, DevelRenderer::Property::OPACITY), 0.5f, TimePeriod(0.5f, 0.5f));
+ animation.SetLoopCount(3);
+ animation.Play();
+
+ application.SendNotification();
+
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Delay time
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(TestApplication::RENDER_FRAME_INTERVAL, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+ clippingRect = Rect<int>(0, 784, 32, 32);
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Started animation
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(500, nullptr, damagedRects);
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Delay time
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(500, nullptr, damagedRects);
+
+ // The property is reset to base value. Should be updated
+ DALI_TEST_EQUALS(damagedRects.size(), 1, TEST_LOCATION);
+
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ // Next render during delay time
+ damagedRects.clear();
+ application.PreRenderWithPartialUpdate(50, nullptr, damagedRects);
+
+ // Should not be updated
+ DALI_TEST_EQUALS(damagedRects.size(), 0, TEST_LOCATION);
+
+ application.RenderWithPartialUpdate(damagedRects, clippingRect);
+
+ END_TEST;
+}
+
int utcDaliActorPartialUpdateChangeVisibility(void)
{
TestApplication application(
mAnimationPlaying(false),
mEnabled(true),
mConnectedToSceneGraph(false),
- mAutoReverseEnabled(false)
+ mAutoReverseEnabled(false),
+ mDelayed(false)
{
}
}
/**
+ * Sets whether the animator is delayed or not.
+ * @param delayed True if the animator is delayed.
+ */
+ void SetDelayed(bool delayed)
+ {
+ if(delayed != mDelayed)
+ {
+ if(mPropertyOwner)
+ {
+ mPropertyOwner->SetUpdated(true);
+ }
+ mDelayed = delayed;
+ }
+ }
+
+ /**
* Set the alpha function for an animator.
* @param [in] alphaFunc The alpha function to apply to the animation progress.
*/
DoUpdate(bufferIndex, bake, alpha, blendPoint);
mCurrentProgress = progress;
+ mDelayed = false;
}
/**
bool mEnabled : 1; ///< Animator is "enabled" while its target object is valid and on the stage.
bool mConnectedToSceneGraph : 1; ///< True if ConnectToSceneGraph() has been called in update-thread.
bool mAutoReverseEnabled : 1;
+ bool mDelayed : 1; ///< True if the animator is in delayed state
};
/**
}
// Undefined
- AnimatorTransformProperty() = delete;
- AnimatorTransformProperty(const AnimatorTransformProperty&) = delete;
+ AnimatorTransformProperty() = delete;
+ AnimatorTransformProperty(const AnimatorTransformProperty&) = delete;
AnimatorTransformProperty& operator=(const AnimatorTransformProperty&) = delete;
protected: