Change-Id: Ie1bfd1aa3c745bc445b4b1c1bcd7cbf6af8cb10b
mDelayTime(0),
mDroppedFrames(0),
mFrameRate( 60.0f ),
mDelayTime(0),
mDroppedFrames(0),
mFrameRate( 60.0f ),
mNeedDroppedFrames(false),
mEventThreadCallback( new EventThreadCallback( MakeCallback( this, &VectorAnimationRenderer::OnTriggered ) ) )
{
mNeedDroppedFrames(false),
mEventThreadCallback( new EventThreadCallback( MakeCallback( this, &VectorAnimationRenderer::OnTriggered ) ) )
{
{
// Change total frame number for test
mTotalFrameNumber = 200;
{
// Change total frame number for test
mTotalFrameNumber = 200;
bool Render( uint32_t frameNumber )
{
bool Render( uint32_t frameNumber )
{
{
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<int32_t>(mDelayTime)));
{
std::this_thread::sleep_for(std::chrono::milliseconds(static_cast<int32_t>(mDelayTime)));
+ mTestFrameDrop = false;
mNeedDroppedFrames = true;
}
else if(mNeedDroppedFrames)
mNeedDroppedFrames = true;
}
else if(mNeedDroppedFrames)
uint32_t mDelayTime;
uint32_t mDroppedFrames;
float mFrameRate;
uint32_t mDelayTime;
uint32_t mDroppedFrames;
float mFrameRate;
bool mNeedDroppedFrames;
Dali::VectorAnimationRenderer::UploadCompletedSignalType mUploadCompletedSignal;
std::unique_ptr< EventThreadCallback > mEventThreadCallback;
bool mNeedDroppedFrames;
Dali::VectorAnimationRenderer::UploadCompletedSignalType mUploadCompletedSignal;
std::unique_ptr< EventThreadCallback > mEventThreadCallback;
Property::Map attributes;
DevelControl::DoAction(actor, DummyControl::Property::TEST_VISUAL, Dali::Toolkit::DevelAnimatedVectorImageVisual::Action::PLAY, attributes);
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);
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);
DALI_TEST_EQUALS(Test::WaitForEventThreadTrigger(1), true, TEST_LOCATION);
uint32_t frames = Test::VectorAnimationRenderer::GetDroppedFrames();
DALI_TEST_CHECK(frames >= 9);
uint32_t frames = Test::VectorAnimationRenderer::GetDroppedFrames();
DALI_TEST_CHECK(frames >= 9);