From 5c6aa1a649aed44e7eb062d195b7e8b2429a3d24 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Tue, 29 Jun 2021 17:48:59 +0900 Subject: [PATCH] (Vector) Fix random tc failure Change-Id: Ie1bfd1aa3c745bc445b4b1c1bcd7cbf6af8cb10b --- .../toolkit-vector-animation-renderer.cpp | 7 +++++-- .../src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp | 9 +++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp index 33a27b5..2ccf2c1 100755 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp @@ -52,6 +52,7 @@ public: mDelayTime(0), mDroppedFrames(0), mFrameRate( 60.0f ), + mTestFrameDrop(false), mNeedDroppedFrames(false), mEventThreadCallback( new EventThreadCallback( MakeCallback( this, &VectorAnimationRenderer::OnTriggered ) ) ) { @@ -79,6 +80,7 @@ public: { // Change total frame number for test mTotalFrameNumber = 200; + mTestFrameDrop = true; } return true; } @@ -112,10 +114,10 @@ public: bool Render( uint32_t frameNumber ) { - if(mDelayTime != 0) + if(mTestFrameDrop) { std::this_thread::sleep_for(std::chrono::milliseconds(static_cast(mDelayTime))); - mDelayTime = 0; + mTestFrameDrop = false; mNeedDroppedFrames = true; } else if(mNeedDroppedFrames) @@ -199,6 +201,7 @@ public: uint32_t mDelayTime; uint32_t mDroppedFrames; float mFrameRate; + bool mTestFrameDrop; bool mNeedDroppedFrames; Dali::VectorAnimationRenderer::UploadCompletedSignalType mUploadCompletedSignal; std::unique_ptr< EventThreadCallback > mEventThreadCallback; diff --git a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp index d2be632..4c5bdad 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-AnimatedVectorImageVisual.cpp @@ -1596,18 +1596,19 @@ int UtcDaliAnimatedVectorImageVisualFrameDrops(void) Property::Map attributes; DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes); + // Make delay to drop frames + Test::VectorAnimationRenderer::DelayRendering(170); // longer than 16.6 * 10frames + application.SendNotification(); application.Render(); // Trigger count is 1 - render the first frame DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION); - // Make delay to drop frames - Test::VectorAnimationRenderer::DelayRendering(170); // longer than 16.6 * 10frames - - // Check dropped frame + // Wait for calculating frame drops DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION); + // Check dropped frame uint32_t frames = Test::VectorAnimationRenderer::GetDroppedFrames(); DALI_TEST_CHECK(frames >= 9); -- 2.7.4