Updates to event/update interface 94/36794/3
authorDavid Steele <david.steele@partner.samsung.com>
Fri, 13 Mar 2015 13:36:17 +0000 (13:36 +0000)
committerFrancisco Santos <f1.santos@samsung.com>
Tue, 17 Mar 2015 14:05:16 +0000 (14:05 +0000)
Change-Id: I608fb5b73f834dcb9d92625618035138fe01fbc0

dali/internal/event/actors/renderer-impl.cpp
dali/internal/event/actors/renderer-impl.h
dali/internal/event/common/object-impl-helper.h
dali/internal/event/common/property-buffer-impl.cpp
dali/internal/event/common/property-buffer-impl.h
dali/internal/event/effects/material-impl.cpp
dali/internal/event/effects/sampler-impl.cpp
dali/internal/event/effects/shader-impl.cpp
dali/internal/event/geometry/geometry-impl.cpp
dali/internal/render/renderers/scene-graph-renderer.cpp
dali/internal/update/effects/scene-graph-material.cpp

index 6b01440af57860a5d93b33eca4917796aee32f3c..ff76a985ef80e31d45ded3523bef29b829616a0e 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/public-api/actors/renderer.h> // Dali::Renderer
 #include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
+#include <dali/internal/update/node-attachments/scene-graph-renderer-attachment.h>
 
 namespace Dali
 {
@@ -129,7 +130,7 @@ const SceneGraph::PropertyOwner* Renderer::GetPropertyOwner() const
 
 const SceneGraph::PropertyOwner* Renderer::GetSceneObject() const
 {
-  return RENDERER_IMPL.GetSceneObject();
+  return mSceneObject;
 }
 
 const SceneGraph::PropertyBase* Renderer::GetSceneObjectAnimatableProperty( Property::Index index ) const
@@ -169,6 +170,7 @@ void Renderer::Disconnect()
 }
 
 Renderer::Renderer()
+: mSceneObject(NULL)
 {
 }
 
index ebbc623152fcd31e2e40ac62a014ecf64d5b5c70..e33b31dbf504cc2f6160e840967942d4278d0f6b 100644 (file)
@@ -32,6 +32,10 @@ namespace Dali
 {
 namespace Internal
 {
+namespace SceneGraph
+{
+class RendererAttachment;
+}
 
 class Renderer;
 typedef IntrusivePtr<Renderer> RendererPtr;
@@ -170,6 +174,7 @@ private: // unimplemented methods
   Renderer& operator=( const Renderer& );
 
 private: // data
+  SceneGraph::RendererAttachment* mSceneObject;
   ObjectConnector<Geometry> mGeometryConnector; ///< Connector that holds the geometry used by this renderer
   ObjectConnector<Material> mMaterialConnector; ///< Connector that holds the material used by this renderer
 
index 27a63dd8ef0b4d0691082a67e8e2e8931790245f..6459ebd199bee07851879621dd8bc175ef328837 100644 (file)
@@ -181,13 +181,6 @@ struct ObjectImplHelper
     return 0;
   }
 
-  const SceneGraph::PropertyOwner* GetSceneObject() const
-  {
-    // TODO: MESH_REWORK
-    DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
-    return 0;
-  }
-
   const SceneGraph::PropertyBase* GetSceneObjectAnimatableProperty( Property::Index index ) const
   {
     // TODO: MESH_REWORK
@@ -218,4 +211,3 @@ struct ObjectImplHelper
 } // namespace Dali
 
 #endif // DALI_INTERNAL_OBJECT_IMPL_HELPER_H
-
index 2f59241b7f562c2a111fa4a001bf6f696a844701..027de42deb28a1b189a4c939d0c4f2460b198d08 100644 (file)
@@ -22,7 +22,7 @@
 #include <dali/public-api/object/property-buffer.h>     // Dali::Internal::PropertyBuffer
 #include <dali/internal/event/common/object-impl-helper.h> // Dali::Internal::ObjectHelper
 #include <dali/internal/event/common/property-helper.h> // DALI_PROPERTY_TABLE_BEGIN, DALI_PROPERTY, DALI_PROPERTY_TABLE_END
-
+#include <dali/internal/update/common/scene-graph-property-buffer.h>
 
 namespace Dali
 {
@@ -141,7 +141,7 @@ const SceneGraph::PropertyOwner* PropertyBuffer::GetPropertyOwner() const
 
 const SceneGraph::PropertyOwner* PropertyBuffer::GetSceneObject() const
 {
-  return PROPERTY_BUFFER_IMPL.GetSceneObject();
+  return mSceneObject;
 }
 
 const SceneGraph::PropertyBase* PropertyBuffer::GetSceneObjectAnimatableProperty( Property::Index index ) const
@@ -177,9 +177,9 @@ void PropertyBuffer::Disconnect()
 }
 
 PropertyBuffer::PropertyBuffer()
+: mSceneObject(NULL)
 {
 }
 
 } // namespace Internal
 } // namespace Dali
-
index 6b927b781038cfad026f9c0074c084d81d60c523..67e9822e8ae35798614d004cc6ed6e3a64a60d40 100644 (file)
@@ -30,6 +30,10 @@ namespace Dali
 {
 namespace Internal
 {
+namespace SceneGraph
+{
+class PropertyBuffer;
+}
 
 class PropertyBuffer;
 typedef IntrusivePtr<PropertyBuffer> PropertyBufferPtr;
@@ -172,6 +176,8 @@ private: // unimplemented methods
   PropertyBuffer( const PropertyBuffer& );
   PropertyBuffer& operator=( const PropertyBuffer& );
 
+private: // data
+  SceneGraph::PropertyBuffer* mSceneObject;
 };
 
 } // namespace Internal
index e7a41c87de71f446123b8cf8c1c5066b49f0038f..2671316ed92fca0c79c5c38b70cf75770ea4033a 100644 (file)
@@ -234,7 +234,7 @@ const SceneGraph::PropertyOwner* Material::GetPropertyOwner() const
 
 const SceneGraph::PropertyOwner* Material::GetSceneObject() const
 {
-  return MATERIAL_IMPL.GetSceneObject();
+  return mSceneObject;
 }
 
 const SceneGraph::PropertyBase* Material::GetSceneObjectAnimatableProperty( Property::Index index ) const
@@ -255,8 +255,8 @@ int Material::GetPropertyComponentIndex( Property::Index index ) const
 bool Material::OnStage() const
 {
   // TODO: MESH_REWORK
-  DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
-  return false;
+  //DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
+  return mSceneObject != NULL;
 }
 
 void Material::Connect()
index f62a4e37c932e5fa38fcf60afb7a54f2729795fa..6bded718ae41791730e56ee8cc650ffd9caec779 100644 (file)
@@ -158,7 +158,7 @@ const SceneGraph::PropertyOwner* Sampler::GetPropertyOwner() const
 
 const SceneGraph::PropertyOwner* Sampler::GetSceneObject() const
 {
-  return SAMPLER_IMPL.GetSceneObject();
+  return mSceneObject;
 }
 
 const SceneGraph::PropertyBase* Sampler::GetSceneObjectAnimatableProperty( Property::Index index ) const
index 93f3e53f7c3639a98e944697ac92774c260df3fd..1e37980dc6322c99fa675c59618dc681e8af4ad0 100644 (file)
@@ -55,7 +55,7 @@ ShaderPtr Shader::New( const std::string& vertexShader,
                        Dali::Shader::ShaderHints hints )
 {
   //TODO: MESH_REWORK
-  DALI_ASSERT_ALWAYS(false && "MESH REWORK");
+  //DALI_ASSERT_ALWAYS(false && "MESH REWORK");
   ShaderPtr shader( new Shader() );
   shader->Initialize( vertexShader, fragmentShader );
   return shader;
@@ -126,7 +126,7 @@ const SceneGraph::PropertyOwner* Shader::GetPropertyOwner() const
 
 const SceneGraph::PropertyOwner* Shader::GetSceneObject() const
 {
-  return SHADER_IMPL.GetSceneObject();
+  return mSceneObject;
 }
 
 const SceneGraph::PropertyBase* Shader::GetSceneObjectAnimatableProperty( Property::Index index ) const
index 0ee623cc6b296a8e5446da8711036245f6a65b40..c57eb2ee8da1c60014701222f3db79712209e7a9 100644 (file)
@@ -166,7 +166,7 @@ const SceneGraph::PropertyOwner* Geometry::GetPropertyOwner() const
 
 const SceneGraph::PropertyOwner* Geometry::GetSceneObject() const
 {
-  return GEOMETRY_IMPL.GetSceneObject();
+  return mSceneObject;
 }
 
 const SceneGraph::PropertyBase* Geometry::GetSceneObjectAnimatableProperty( Property::Index index ) const
index a74bddee31e70c79c7de50e9939357186589c60e..f411d62f72bc2c0fdf6ae97816a671ad95f03cac 100644 (file)
@@ -158,6 +158,8 @@ void Renderer::Render( BufferIndex bufferIndex,
 {
   DALI_ASSERT_DEBUG( mContext && "Renderer::Render. Renderer not initialised!! (mContext == NULL)." );
 
+  // @todo
+
   // if mShader is NULL it means we're set to default
   if( !mShader )
   {
index f84ba1a8dee1e1b9a3575edef8e5342bfa36c5aa..b854083efe6a50e0df37706366f8ad0793cff096 100644 (file)
@@ -41,6 +41,7 @@ Material::~Material()
 void Material::SetShader( const Shader* shader )
 {
   mShader = shader;
+  // Need to inform renderer in render thread about this shader
 }
 
 const Shader* Material::GetShader() const