#ifndef __DALI_INTERNAL_RENDER_TASK_H__
#define __DALI_INTERNAL_RENDER_TASK_H__
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
// INTERNAL INCLUDES
#include <dali/public-api/object/base-object.h>
#include <dali/public-api/render-tasks/render-task.h>
#include <dali/public-api/images/frame-buffer-image.h>
-#include <dali/internal/event/common/proxy-object.h>
+#include <dali/internal/event/common/object-impl.h>
namespace Dali
{
class Actor;
class CameraActor;
-class EventToUpdate;
+class EventThreadServices;
namespace SceneGraph
{
class RenderTask;
}
-class RenderTask : public ProxyObject
+class RenderTask : public Object
{
public:
const Vector4& GetClearColor() const;
/**
+ * Set whether whether GL sync is required for native render target.
+ * @param[in] requiresSync whether whether GL sync is required.
+ */
+ void SetSyncRequired( bool requiresSync );
+
+ /**
+ * Query whether the sync object is required for native render target.
+ * @return True if the sync object is required, false otherwise.
+ */
+ bool IsSyncRequired() const;
+
+ /**
* @copydoc Dali::RenderTask::SetClearEnabled()
*/
void SetClearEnabled( bool enabled );
bool GetClearEnabled() const;
/**
+ * @copydoc Dali::RenderTask::SetCullMode()
+ */
+ void SetCullMode( bool mode );
+
+ /**
+ * @copydoc Dali::RenderTask::GetCullMode()
+ */
+ bool GetCullMode() const;
+
+ /**
* @copydoc Dali::RenderTask::SetRefreshRate()
*/
void SetRefreshRate( unsigned int refreshRate );
*/
bool IsSystemLevel() const;
+ /**
+ * @copydoc Dali::RenderTask::WorldToViewport()
+ */
+ bool WorldToViewport(const Vector3 &position, float& viewportX, float& viewportY) const;
+
+ /**
+ * @copydoc Dali::RenderTask::ViewportToLocal()
+ */
+ bool ViewportToLocal(Actor* actor, float viewportX, float viewportY, float &localX, float &localY) const;
+
public: // Used by RenderTaskList, which owns the SceneGraph::RenderTasks
/**
*/
void DiscardSceneObject();
-public: // Implementation of ProxyObject
+public: // Implementation of Object
/**
- * @copydoc Dali::Internal::ProxyObject::IsSceneObjectRemovable()
+ * @copydoc Dali::Internal::Object::GetDefaultPropertyCount()
*/
- virtual bool IsSceneObjectRemovable() const;
+ virtual unsigned int GetDefaultPropertyCount() const;
/**
- * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyCount()
+ * @copydoc Dali::Internal::Object::GetDefaultPropertyIndices()
*/
- virtual unsigned int GetDefaultPropertyCount() const;
+ virtual void GetDefaultPropertyIndices( Property::IndexContainer& indices ) const;
/**
- * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyName()
+ * @copydoc Dali::Internal::Object::GetDefaultPropertyName()
*/
- virtual const std::string& GetDefaultPropertyName(Property::Index index) const;
+ virtual const char* GetDefaultPropertyName(Property::Index index) const;
/**
- * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyIndex()
+ * @copydoc Dali::Internal::Object::GetDefaultPropertyIndex()
*/
virtual Property::Index GetDefaultPropertyIndex(const std::string& name) const;
/**
- * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyWritable()
+ * @copydoc Dali::Internal::Object::IsDefaultPropertyWritable()
*/
virtual bool IsDefaultPropertyWritable(Property::Index index) const;
/**
- * @copydoc Dali::Internal::ProxyObject::IsDefaultPropertyAnimatable()
+ * @copydoc Dali::Internal::Object::IsDefaultPropertyAnimatable()
*/
virtual bool IsDefaultPropertyAnimatable(Property::Index index) const;
/**
- * @copydoc Dali::Internal::ProxyObject::GetDefaultPropertyType()
+ * @copydoc Dali::Internal::Object::IsDefaultPropertyAConstraintInput()
*/
- virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
+ virtual bool IsDefaultPropertyAConstraintInput( Property::Index index ) const;
/**
- * @copydoc Dali::Internal::ProxyObject::SetDefaultProperty()
+ * @copydoc Dali::Internal::Object::GetDefaultPropertyType()
*/
- virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
+ virtual Property::Type GetDefaultPropertyType(Property::Index index) const;
/**
- * @copydoc Dali::Internal::ProxyObject::SetCustomProperty()
+ * @copydoc Dali::Internal::Object::SetDefaultProperty()
*/
- virtual void SetCustomProperty( Property::Index index, const CustomProperty& entry, const Property::Value& value );
+ virtual void SetDefaultProperty(Property::Index index, const Property::Value& propertyValue);
/**
- * @copydoc Dali::Internal::ProxyObject::GetDefaultProperty()
+ * @copydoc Dali::Internal::Object::GetDefaultProperty()
*/
virtual Property::Value GetDefaultProperty( Property::Index index ) const;
/**
- * @copydoc Dali::Internal::ProxyObject::InstallSceneObjectProperty()
- */
- virtual void InstallSceneObjectProperty( SceneGraph::PropertyBase& newProperty, const std::string& name, unsigned int index );
-
- /**
- * @copydoc Dali::Internal::ProxyObject::GetSceneObject()
+ * @copydoc Dali::Internal::Object::GetSceneObject()
*/
virtual const SceneGraph::PropertyOwner* GetSceneObject() const;
/**
- * @copydoc Dali::Internal::ProxyObject::GetSceneObjectAnimatableProperty()
+ * @copydoc Dali::Internal::Object::GetSceneObjectAnimatableProperty()
*/
virtual const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const;
/**
- * @copydoc Dali::Internal::ProxyObject::GetSceneObjectInputProperty()
+ * @copydoc Dali::Internal::Object::GetSceneObjectInputProperty()
*/
virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
/**
* @copydoc Dali::RenderTask::FinishedSignal()
*/
- Dali::RenderTask::RenderTaskSignalV2& FinishedSignal();
+ Dali::RenderTask::RenderTaskSignalType& FinishedSignal();
/**
* Connects a callback function with the object's signals.
/**
* Construct a new RenderTask.
- * @param[in] eventToUpdate Used to send messages to the update-thread.
* @param[in] isSystemLevel Whether the RenderTask is on the system level task list.
*/
- RenderTask( EventToUpdate& eventToUpdate, bool isSystemLevel );
+ RenderTask( bool isSystemLevel );
/**
* A reference counted object may only be deleted by calling Unreference()
/**
* Helper class for connecting Nodes to the scene-graph RenderTask
*/
- class Connector : public ProxyObject::Observer
+ class Connector : public Object::Observer
{
public:
*/
void UpdateRenderTask();
- public: // From ProxyObject::Observer
+ public: // From Object::Observer
/**
- * @copydoc Dali::Internal::ProxyObject::Observer::SceneObjectAdded
+ * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded
*/
- virtual void SceneObjectAdded( ProxyObject& proxy );
+ virtual void SceneObjectAdded( Object& object );
/**
- * @copydoc Dali::Internal::ProxyObject::Observer::SceneObjectAdded
+ * @copydoc Dali::Internal::Object::Observer::SceneObjectAdded
*/
- virtual void SceneObjectRemoved( ProxyObject& proxy );
+ virtual void SceneObjectRemoved( Object& object );
/**
- * @copydoc Dali::Internal::ProxyObject::Observer::ProxyDestroyed
+ * @copydoc Dali::Internal::Object::Observer::ObjectDestroyed
*/
- virtual void ProxyDestroyed( ProxyObject& proxy );
+ virtual void ObjectDestroyed( Object& object );
private:
private:
- EventToUpdate& mEventToUpdate;
-
SceneGraph::RenderTask* mSceneObject; ///< Raw-pointer to the scene-graph object; not owned.
Connector mSourceConnector; ///< Responsible for connecting/disconnecting source Nodes
bool mExclusive : 1; ///< True if the render-task has exclusive access to the source Nodes.
bool mInputEnabled : 1; ///< True if the render-task should be considered for input handling.
bool mClearEnabled : 1; ///< True if the render-task should be clear the color buffer.
+ bool mCullMode : 1; ///< True if the render-task's actors should be culled
bool mIsSystemLevel : 1; ///< True if the render-task is on the system level task list.
-
- // Default properties
- typedef std::map<std::string, Property::Index> DefaultPropertyLookup;
- static DefaultPropertyLookup* sDefaultPropertyLookup;
+ bool mRequiresSync : 1; ///< True if the GL sync is required to track the render of
//Signals
- Dali::RenderTask::RenderTaskSignalV2 mSignalFinishedV2; ///< Signal emmited when the render task has been processed.
+ Dali::RenderTask::RenderTaskSignalType mSignalFinished; ///< Signal emmited when the render task has been processed.
};
} // namespace Internal