#include <dali/internal/update/render-tasks/scene-graph-render-task-debug.h>
-namespace
-{
-const unsigned int NUM_FRAMES_BEFORE_NOTIFY_FINISHED(3);
-const unsigned int COUNTDOWN_COMPLETE(-1);
-} // anonymous namespace
-
namespace Dali
{
namespace Internal
}
}
-Node* RenderTask::GetCameraNode() const
-{
- return mCameraNode;
-}
-
void RenderTask::SetFrameBufferId( unsigned int resourceId )
{
if ( mFrameBufferResourceId != resourceId )
return mClearEnabled;
}
+void RenderTask::SetCullMode( bool mode )
+{
+ mCullMode = mode;
+}
+
+bool RenderTask::GetCullMode() const
+{
+ return mCullMode;
+}
+
void RenderTask::SetRefreshRate( unsigned int refreshRate )
{
DALI_LOG_TRACE_METHOD_FMT(gRenderTaskLogFilter, "this:%p RefreshRate:%d\n", this, refreshRate);
bool RenderTask::ReadyToRender( BufferIndex updateBufferIndex )
{
+ // If the source node of the render task is invisible we should still render
+ // We want the render task to complete and possible clear colors to happen
+
+ // Check source node
if ( NULL == mSourceNode ||
( !mSourceNode->IsRoot() && NULL == mSourceNode->GetParent() ) )
{
return false;
}
- // Check if the source node (root actor) and all its ancestors are visible.
- if( !mSourceNode->IsFullyVisible( updateBufferIndex ) )
- {
- TASK_LOG_FMT(Debug::General, " =F No visible source FC:%d\n", mFrameCounter );
- return false;
- }
-
+ // Check camera node
if ( NULL == mCameraNode ||
NULL == mCameraNode->GetParent() ||
!mCameraNode->HasAttachment() )
return required;
}
+void RenderTask::SetResourcesFinished( bool resourcesFinished )
+{
+ mResourcesFinished = resourcesFinished;
+}
+
// Called every frame regardless of whether render was required.
// If render was not required, ignore resourcesFinished.
-void RenderTask::UpdateState(bool resourcesFinished)
+void RenderTask::UpdateState()
{
- TASK_LOG_FMT( Debug::General, "(resourcesFinished:%s) FC:%d State:%s RR:%d\n", resourcesFinished?"T":"F", mFrameCounter, STATE_STRING(mState), mRefreshRate );
+ TASK_LOG_FMT( Debug::General, "(mResourcesFinished:%s) FC:%d State:%s RR:%d\n", mResourcesFinished?"T":"F", mFrameCounter, STATE_STRING(mState), mRefreshRate );
switch( mState )
{
{
if( mFrameCounter == 0 )
{
- if( resourcesFinished )
+ if( mResourcesFinished )
{
- ++mFrameCounter; // Only start missing frames when resources are loaded
+ ++mFrameCounter; // Only start skipping frames when resources are loaded
}
}
- else // Continue counting to miss frames
+ else // Continue counting to skip frames
{
++mFrameCounter;
if( mFrameCounter >= mRefreshRate )
case RENDER_ONCE_WAITING_FOR_RESOURCES:
{
- if( resourcesFinished )
+ if( mResourcesFinished )
{
mState = RENDERED_ONCE;
}
void RenderTask::PrepareRenderInstruction( RenderInstruction& instruction, BufferIndex updateBufferIndex )
{
+ DALI_ASSERT_DEBUG( NULL != mCameraAttachment );
+
TASK_LOG(Debug::General);
Viewport viewport;
bool viewportSet = QueryViewport( updateBufferIndex, viewport );
- instruction.Reset( &GetViewMatrix( updateBufferIndex ),
- &GetProjectionMatrix( updateBufferIndex ),
+ instruction.Reset( mCameraAttachment,
GetFrameBufferId(),
viewportSet ? &viewport : NULL,
mClearEnabled ? &GetClearColor( updateBufferIndex ) : NULL );
return false;
}
+Node* RenderTask::GetCamera() const
+{
+ return mCameraNode;
+}
+
void RenderTask::ResetDefaultProperties( BufferIndex updateBufferIndex )
{
// Reset default properties
mCameraNode( NULL ),
mCameraAttachment( NULL ),
mFrameBufferResourceId( 0 ),
+ mResourcesFinished( false ),
mWaitingToRender( false ),
mNotifyTrigger( false ),
mExclusive( Dali::RenderTask::DEFAULT_EXCLUSIVE ),
mClearEnabled( Dali::RenderTask::DEFAULT_CLEAR_ENABLED ),
+ mCullMode( Dali::RenderTask::DEFAULT_CULL_MODE ),
mRenderTarget( NULL ),
mState( (Dali::RenderTask::DEFAULT_REFRESH_RATE == Dali::RenderTask::REFRESH_ALWAYS)
? RENDER_CONTINUOUSLY