END_TEST;
}
+
+int UtcDaliRenderTaskFinishMissingImage(void)
+{
+ TestApplication application;
+
+ // Previously we had bugs where not having a resource ID would cause render-tasks to wait forever
+ tet_infoline("Testing RenderTask::SignalFinished() when an ImageActor has no Image set");
+
+ Stage stage = Stage::GetCurrent();
+
+ BufferImage image = BufferImage::New( 10, 10 );
+ ImageActor rootActor = ImageActor::New( image );
+ rootActor.SetSize( 10, 10 );
+ stage.Add( rootActor );
+
+ ImageActor actorWithMissingImage = ImageActor::New( Image() );
+ actorWithMissingImage.SetSize( 10, 10 );
+ stage.Add( actorWithMissingImage );
+
+ RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
+ RenderTask newTask = taskList.CreateTask();
+ newTask.SetInputEnabled( false );
+ newTask.SetClearColor( Vector4( 0.f, 0.f, 0.f, 0.f ) );
+ newTask.SetClearEnabled( true );
+ newTask.SetExclusive( true );
+ newTask.SetRefreshRate( RenderTask::REFRESH_ONCE );
+
+ bool finished = false;
+ RenderTaskFinished renderTaskFinished( finished );
+ newTask.FinishedSignal().Connect( &application, renderTaskFinished );
+
+ // 1 render to process render task, then 1 before finished msg is sent from update to the event thread.
+ application.SendNotification();
+ application.Render();
+ application.Render();
+
+ application.SendNotification();
+ DALI_TEST_CHECK( finished );
+
+ END_TEST;
+}
ATTACHMENT_LOG_FMT(Debug::General, " textureid: %d)\n", textureId);
mTextureId = textureId;
- mFinishedResourceAcquisition = false;
+
+ // Loading is essentially finished if we don't have a resource ID
+ mFinishedResourceAcquisition = ( 0 == mTextureId );
if( mImageRenderer )
{
DALI_LOG_TRACE_METHOD_FMT(gImageAttachmentLogFilter, "this:%p", this);
bool ready = false;
- // The metadata is used by IsFullyOpaque(), below.
- mBitmapMetadata = resourceManager.GetBitmapMetadata( mTextureId );
+ if( 0 != mTextureId )
+ {
+ // The metadata is used by IsFullyOpaque(), below.
+ mBitmapMetadata = resourceManager.GetBitmapMetadata( mTextureId );
- CompleteStatusManager& completeStatusManager = mSceneController->GetCompleteStatusManager();
- CompleteStatusManager::CompleteState status = completeStatusManager.GetStatus( mTextureId );
+ CompleteStatusManager& completeStatusManager = mSceneController->GetCompleteStatusManager();
+ CompleteStatusManager::CompleteState status = completeStatusManager.GetStatus( mTextureId );
- switch( status )
- {
- case CompleteStatusManager::NOT_READY:
+ switch( status )
{
- ready = false;
+ case CompleteStatusManager::NOT_READY:
+ {
+ ready = false;
+
+ if( mBitmapMetadata.GetIsFramebuffer() )
+ {
+ ready = true;
+ }
+ mFinishedResourceAcquisition = false;
+ FollowTracker( mTextureId );
+ }
+ break;
- if( mBitmapMetadata.GetIsFramebuffer() )
+ case CompleteStatusManager::COMPLETE:
{
ready = true;
+ mFinishedResourceAcquisition = true;
}
- mFinishedResourceAcquisition = false;
- FollowTracker( mTextureId );
- }
- break;
-
- case CompleteStatusManager::COMPLETE:
- {
- ready = true;
- mFinishedResourceAcquisition = true;
- }
- break;
+ break;
- case CompleteStatusManager::NEVER:
- {
- ready = false;
- mFinishedResourceAcquisition = true;
+ case CompleteStatusManager::NEVER:
+ {
+ ready = false;
+ mFinishedResourceAcquisition = true;
+ }
+ break;
}
- break;
+ }
+ else
+ {
+ // Loading is essentially finished if we don't have a resource ID
+ mFinishedResourceAcquisition = true;
}
ATTACHMENT_LOG_FMT(Debug::General, " ObjName:%s finished:%s ready:%s \n",
{
CompleteState readiness = CompleteStatusManager::NOT_READY;
- TrackedResourcesIter iter = mTrackedResources.find(id);
- if( iter != mTrackedResources.end() )
+ if( 0 != id )
{
- if( iter->second->IsComplete() )
+ TrackedResourcesIter iter = mTrackedResources.find(id);
+ if( iter != mTrackedResources.end() )
+ {
+ if( iter->second->IsComplete() )
+ {
+ readiness = CompleteStatusManager::COMPLETE;
+ }
+ }
+ else if( mResourceManager.IsResourceLoaded(id) )
{
readiness = CompleteStatusManager::COMPLETE;
}
+ else if( mResourceManager.IsResourceLoadFailed(id) )
+ {
+ readiness = CompleteStatusManager::NEVER;
+ }
}
- else if( mResourceManager.IsResourceLoaded(id) )
+ else
{
+ // Loading is essentially finished if we don't have a resource ID
readiness = CompleteStatusManager::COMPLETE;
}
- else if( mResourceManager.IsResourceLoadFailed(id) )
- {
- readiness = CompleteStatusManager::NEVER;
- }
TRACKER_LOG_FMT(Debug::General, "id:%d = %s\n", id, (readiness==CompleteStatusManager::COMPLETE)?"COMPLETE":((readiness==CompleteStatusManager::NEVER)?"NEVER":"NOT_READY"));