+ mActive = false; // if either source or camera disconnected, we're no longer active
+}
+
+void RenderTask::PropertyOwnerDestroyed(PropertyOwner& owner)
+{
+ if(static_cast<PropertyOwner*>(mSourceNode) == &owner)
+ {
+ mSourceNode = nullptr;
+ }
+ else if(static_cast<PropertyOwner*>(mCameraNode) == &owner)
+ {
+ mCameraNode = nullptr;
+ }
+}
+
+RenderTask::RenderTask()
+: mViewportPosition(Vector2::ZERO),
+ mViewportSize(Vector2::ZERO),
+ mClearColor(Dali::RenderTask::DEFAULT_CLEAR_COLOR),
+ mRenderMessageDispatcher(nullptr),
+ mRenderSyncTracker(nullptr),
+ mSourceNode(nullptr),
+ mCameraNode(nullptr),
+ mViewportGuideNode(nullptr),
+ mCamera(nullptr),
+ mFrameBuffer(nullptr),
+ mRefreshRate(Dali::RenderTask::DEFAULT_REFRESH_RATE),
+ mFrameCounter(0u),
+ mRenderedOnceCounter(0u),
+ mState((Dali::RenderTask::DEFAULT_REFRESH_RATE == Dali::RenderTask::REFRESH_ALWAYS)
+ ? RENDER_CONTINUOUSLY
+ : RENDER_ONCE_WAITING_FOR_RESOURCES),
+ mRequiresSync(false),
+ mActive(false),
+ mWaitingToRender(false),
+ mNotifyTrigger(false),
+ mExclusive(Dali::RenderTask::DEFAULT_EXCLUSIVE),
+ mClearEnabled(Dali::RenderTask::DEFAULT_CLEAR_ENABLED),
+ mCullMode(Dali::RenderTask::DEFAULT_CULL_MODE)
+{
+}
+
+void RenderTask::SetActiveStatus()
+{
+ // must have a source and camera both connected to scene
+ mActive = (mSourceNode && mSourceNode->ConnectedToScene() &&
+ mCameraNode && mCameraNode->ConnectedToScene() && mCamera);
+ TASK_LOG_FMT(Debug::General, " Source node(%x) active %d. Frame counter: %d\n", mSourceNode, mSourceNode && mSourceNode->ConnectedToScene(), mFrameCounter);
+ TASK_LOG_FMT(Debug::General, " Camera node(%x) active %d\n", mCameraNode, mCameraNode && mCameraNode->ConnectedToScene());