Added Blending handling for materials and renderers 54/38654/2
authorDavid Steele <david.steele@partner.samsung.com>
Tue, 21 Apr 2015 15:52:39 +0000 (16:52 +0100)
committerFrancisco Santos <f1.santos@samsung.com>
Tue, 28 Apr 2015 09:32:31 +0000 (10:32 +0100)
Updated the material properties and data handlers to pass the blending
factors and equations through to the renderer.

Updated the RendererAttachment and SceneGraph::Material to determine
if blending is required.

Updated renderer to pass the depth index to the scene graph renderer
Ensured the scene graph renderer has it's properties reset. (WIP)
Temporarily copied the depth index to the existing sort modifier
(Allows the depth index to be used without changing ProcessRenderTasks)

Change-Id: I9eb98b67b8b0f79c9bf855203215cc96e94c112b
Signed-off-by: David Steele <david.steele@partner.samsung.com>
24 files changed:
dali/internal/event/actors/renderer-impl.cpp
dali/internal/event/effects/material-impl.cpp
dali/internal/event/effects/material-impl.h
dali/internal/event/effects/shader-impl.cpp
dali/internal/event/effects/shader-impl.h
dali/internal/event/geometry/geometry-impl.cpp
dali/internal/render/data-providers/material-data-provider.h
dali/internal/render/renderers/render-renderer.cpp
dali/internal/render/renderers/render-renderer.h
dali/internal/render/renderers/scene-graph-renderer.cpp
dali/internal/render/renderers/scene-graph-renderer.h
dali/internal/update/effects/scene-graph-material.cpp
dali/internal/update/effects/scene-graph-material.h
dali/internal/update/manager/prepare-render-algorithms.cpp
dali/internal/update/manager/process-render-tasks.cpp
dali/internal/update/manager/update-manager.cpp
dali/internal/update/node-attachments/node-attachment.h
dali/internal/update/node-attachments/scene-graph-image-attachment.cpp
dali/internal/update/node-attachments/scene-graph-renderable-attachment.cpp
dali/internal/update/node-attachments/scene-graph-renderable-attachment.h
dali/internal/update/node-attachments/scene-graph-renderer-attachment.cpp
dali/internal/update/node-attachments/scene-graph-renderer-attachment.h
dali/public-api/actors/renderer.cpp
dali/public-api/actors/renderer.h

index 42a935e..3085c6a 100644 (file)
@@ -69,7 +69,7 @@ void Renderer::SetMaterial( Material& material )
 
 void Renderer::SetDepthIndex( int depthIndex )
 {
-  SceneGraph::AnimatablePropertyMessage<int>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mDepthIndex, &SceneGraph::AnimatableProperty<int>::Bake, depthIndex );
+  SetDepthIndexMessage( GetEventThreadServices(), *mSceneObject, depthIndex );
 }
 
 int Renderer::GetCurrentDepthIndex() const
index d338c75..aa86ef6 100644 (file)
@@ -99,15 +99,18 @@ void Material::SetFaceCullingMode( Dali::Material::FaceCullingMode cullingMode )
 
 void Material::SetBlendMode( BlendingMode::Type mode )
 {
-  // TODO: MESH_REWORK
-  DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
+  mBlendingMode = mode;
+
+  if( NULL != mSceneObject )
+  {
+    SceneGraph::DoubleBufferedPropertyMessage<int>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mBlendingMode, &SceneGraph::DoubleBufferedProperty<int>::Set, static_cast<int>(mode) );
+  }
 }
 
+// @todo MESH_REWORK API change, or store here
 BlendingMode::Type Material::GetBlendMode() const
 {
-  // TODO: MESH_REWORK
-  DALI_ASSERT_ALWAYS( false && "TODO: MESH_REWORK" );
-  return BlendingMode::AUTO;
+  return mBlendingMode;
 }
 
 void Material::SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba )
@@ -229,7 +232,10 @@ void Material::SetDefaultProperty( Property::Index index,
     }
     case Dali::Material::Property::BLENDING_MODE:
     {
-      DALI_ASSERT_ALWAYS( 0 && "Mesh Rework" );
+      if( mSceneObject )
+      {
+        SceneGraph::DoubleBufferedPropertyMessage<int>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mBlendingMode, &SceneGraph::DoubleBufferedProperty<int>::Set, propertyValue.Get<int>() );
+      }
       break;
     }
     case Dali::Material::Property::BLEND_EQUATION:
@@ -298,7 +304,10 @@ Property::Value Material::GetDefaultProperty( Property::Index index ) const
     }
     case Dali::Material::Property::BLENDING_MODE:
     {
-      DALI_ASSERT_ALWAYS( 0 && "Mesh Rework" );
+      if( mSceneObject )
+      {
+        value = mSceneObject->mBlendingMode[bufferIndex];
+      }
       break;
     }
     case Dali::Material::Property::BLEND_EQUATION:
index ec32837..96a573f 100644 (file)
@@ -267,6 +267,8 @@ private: //data
   SamplerConnectorContainer mSamplerConnectors; ///< Vector of connectors that hold the samplers used by this material
 
   SceneGraph::Material* mSceneObject;
+
+  BlendingMode::Type mBlendingMode; ///< Local store
   bool mOnStage;
 };
 
index 6b581cb..ba3fb69 100644 (file)
@@ -56,7 +56,7 @@ ShaderPtr Shader::New( const std::string& vertexShader,
 {
   //TODO: MESH_REWORK
   ShaderPtr shader( new Shader() );
-  shader->Initialize( vertexShader, fragmentShader );
+  shader->Initialize( vertexShader, fragmentShader, hints );
   return shader;
 }
 
@@ -239,14 +239,34 @@ Shader::Shader()
 {
 }
 
-void Shader::Initialize( const std::string& vertexSource, const std::string& fragmentSource )
+void Shader::Initialize(
+  const std::string& vertexSource,
+  const std::string& fragmentSource,
+  Dali::Shader::ShaderHints hints )
 {
   DALI_ASSERT_ALWAYS( EventThreadServices::IsCoreRunning() && "Core is not running" );
   EventThreadServices& eventThreadServices = GetEventThreadServices();
   SceneGraph::UpdateManager& updateManager = eventThreadServices.GetUpdateManager();
 
-  Dali::ShaderEffect::GeometryHints hint = Dali::ShaderEffect::HINT_NONE;
-  mSceneObject = new SceneGraph::Shader(hint);
+  // @todo MESH_REWORK - Pass hints directly to a new scene graph shader
+  int effectHint = Dali::ShaderEffect::HINT_NONE;
+  if( hints & Dali::Shader::HINT_OUTPUT_IS_TRANSPARENT )
+  {
+    effectHint |= Dali::ShaderEffect::HINT_BLENDING;
+  }
+
+  if( hints & Dali::Shader::HINT_REQUIRES_SELF_DEPTH_TEST )
+  {
+    effectHint |= Dali::ShaderEffect::HINT_DEPTH_BUFFER;
+  }
+
+  if( (hints & Dali::Shader::HINT_MODIFIES_GEOMETRY) == 0x0 )
+  {
+    effectHint |= Dali::ShaderEffect::HINT_DOESNT_MODIFY_GEOMETRY;
+  }
+  Dali::ShaderEffect::GeometryHints shaderEffectHint = static_cast<Dali::ShaderEffect::GeometryHints>( effectHint );
+
+  mSceneObject = new SceneGraph::Shader(shaderEffectHint);
 
   // Add to update manager
   AddShaderMessage( updateManager, *mSceneObject );
index ec50176..008238d 100644 (file)
@@ -165,7 +165,7 @@ private: // implementation
   /**
    * Second stage initialization
    */
-  void Initialize( const std::string& vertexShader, const std::string& fragmentShader );
+  void Initialize( const std::string& vertexShader, const std::string& fragmentShader, Dali::Shader::ShaderHints hints );
 
 protected:
   /**
index 8bb4028..7e991f9 100644 (file)
@@ -89,7 +89,12 @@ void Geometry::SetGeometryType( Dali::Geometry::GeometryType geometryType )
 {
   if( NULL != mSceneObject )
   {
-    SceneGraph::DoubleBufferedPropertyMessage<int>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mGeometryType, &SceneGraph::DoubleBufferedProperty<int>::Set, static_cast<int>(geometryType) );
+    SceneGraph::DoubleBufferedPropertyMessage<int>::Send(
+      GetEventThreadServices(),
+      mSceneObject,
+      &mSceneObject->mGeometryType,
+      &SceneGraph::DoubleBufferedProperty<int>::Set,
+      static_cast<int>(geometryType) );
   }
 }
 
index dfc31f2..2f40f90 100644 (file)
@@ -17,6 +17,7 @@
  */
 
 #include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/actors/blending.h>
 
 namespace Dali
 {
@@ -39,6 +40,44 @@ public:
   {
   }
 
+  virtual const Vector4& GetBlendColor( BufferIndex bufferIndex ) const = 0;
+
+  /**
+   * Get the RGB source factor
+   * @return the RGB source factor
+   */
+  virtual BlendingFactor::Type GetBlendSrcFactorRgb( BufferIndex bufferIndex ) const = 0;
+
+  /**
+   * Get the Alpha source factor
+   * @return the Alpha source factor
+   */
+  virtual BlendingFactor::Type GetBlendSrcFactorAlpha( BufferIndex bufferIndex ) const = 0;
+
+  /**
+   * Get the RGB destination factor
+   * @return the RGB destination factor
+   */
+  virtual BlendingFactor::Type GetBlendDestFactorRgb( BufferIndex bufferIndex ) const = 0;
+
+  /**
+   * Get the Alpha destination factor
+   * @return the Alpha destination factor
+   */
+  virtual BlendingFactor::Type GetBlendDestFactorAlpha( BufferIndex bufferIndex ) const = 0;
+
+  /**
+   * Get the RGB blending equation
+   * @return the RGB blending equation
+   */
+  virtual BlendingEquation::Type GetBlendEquationRgb( BufferIndex bufferIndex ) const = 0;
+
+  /**
+   * Get the Alpha blending equation
+   * @return the Alpha blending equation
+   */
+  virtual BlendingEquation::Type GetBlendEquationAlpha( BufferIndex bufferIndex ) const = 0;
+
 protected:
   /**
    * Destructor. No deletion through this interface
index 5286f1a..40fb042 100644 (file)
@@ -91,6 +91,31 @@ void NewRenderer::DoSetUniforms( Context& context, BufferIndex bufferIndex, Shad
   // Do nothing, we're going to set up the uniforms with our own code instead
 }
 
+void NewRenderer::DoSetCullFaceMode( Context& context, BufferIndex bufferIndex )
+{
+}
+
+void NewRenderer::DoSetBlending( Context& context, BufferIndex bufferIndex )
+{
+  context.SetBlend(mUseBlend); // @todo MESH_REWORK Should use a RendererDataProvider
+
+  if( mUseBlend )
+  {
+    const MaterialDataProvider& material = mRenderDataProvider->GetMaterial();
+
+    context.SetCustomBlendColor( material.GetBlendColor( bufferIndex ) );
+
+    // Set blend source & destination factors
+    context.BlendFuncSeparate( material.GetBlendSrcFactorRgb( bufferIndex ),
+                               material.GetBlendDestFactorRgb( bufferIndex ),
+                               material.GetBlendSrcFactorAlpha( bufferIndex ),
+                               material.GetBlendDestFactorAlpha( bufferIndex ) );
+
+    // Set blend equations
+    context.BlendEquationSeparate( material.GetBlendEquationRgb( bufferIndex ),
+                                   material.GetBlendEquationAlpha( bufferIndex ) );
+  }
+}
 
 void NewRenderer::DoRender( Context& context, TextureCache& textureCache, BufferIndex bufferIndex, Program& program, const Matrix& modelViewMatrix, const Matrix& viewMatrix )
 {
index 107c003..efed81d 100644 (file)
@@ -97,6 +97,16 @@ public: // Implementation of Renderer
   virtual void DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex, ShaderSubTypes subType );
 
   /**
+   * @copydoc SceneGraph::Renderer::DoSetCullFaceMode
+   */
+  virtual void DoSetCullFaceMode(Context& context, BufferIndex bufferIndex );
+
+  /**
+   * @copydoc SceneGraph::Renderer::DoSetBlending
+   */
+  virtual void DoSetBlending(Context& context, BufferIndex bufferIndex );
+
+  /**
    * @copydoc SceneGraph::Renderer::DoRender()
    */
   virtual void DoRender( Context& context,
index 87948c5..9bc1dc2 100644 (file)
@@ -210,32 +210,9 @@ void Renderer::Render( Context& context,
   // Take the program into use so we can send uniforms to it
   program->Use();
 
-  // Enables/disables blending mode.
-  context.SetBlend( mUseBlend );
-
-  // Set face culling mode
-  context.CullFace( mCullFaceMode );
-
-  // Set the blend color
-  const Vector4* const customColor = mBlendingOptions.GetBlendColor();
-  if( customColor )
-  {
-    context.SetCustomBlendColor( *customColor );
-  }
-  else
-  {
-    context.SetDefaultBlendColor();
-  }
+  DoSetCullFaceMode( context, bufferIndex );
 
-  // Set blend source & destination factors
-  context.BlendFuncSeparate( mBlendingOptions.GetBlendSrcFactorRgb(),
-                               mBlendingOptions.GetBlendDestFactorRgb(),
-                               mBlendingOptions.GetBlendSrcFactorAlpha(),
-                               mBlendingOptions.GetBlendDestFactorAlpha() );
-
-  // Set blend equations
-  context.BlendEquationSeparate( mBlendingOptions.GetBlendEquationRgb(),
-                                   mBlendingOptions.GetBlendEquationAlpha() );
+  DoSetBlending( context, bufferIndex );
 
   // Ignore missing uniforms - custom shaders and flat color shaders don't have SAMPLER
   // set projection and view matrix if program has not yet received them yet this frame
@@ -267,6 +244,42 @@ void Renderer::DoSetUniforms(Context& context, BufferIndex bufferIndex, Shader*
   shader->SetUniforms( context, *program, bufferIndex, programIndex, subType );
 }
 
+// can be overridden by deriving class
+void Renderer::DoSetCullFaceMode(Context& context, BufferIndex bufferIndex )
+{
+  // Set face culling mode
+  context.CullFace( mCullFaceMode );
+}
+
+// can be overridden by deriving class
+void Renderer::DoSetBlending(Context& context, BufferIndex bufferIndex )
+{
+  // Enables/disables blending mode.
+  context.SetBlend( mUseBlend );
+
+  // Set the blend color
+  const Vector4* const customColor = mBlendingOptions.GetBlendColor();
+  if( customColor )
+  {
+    context.SetCustomBlendColor( *customColor );
+  }
+  else
+  {
+    context.SetDefaultBlendColor();
+  }
+
+  // Set blend source & destination factors
+  context.BlendFuncSeparate( mBlendingOptions.GetBlendSrcFactorRgb(),
+                             mBlendingOptions.GetBlendDestFactorRgb(),
+                             mBlendingOptions.GetBlendSrcFactorAlpha(),
+                             mBlendingOptions.GetBlendDestFactorAlpha() );
+
+  // Set blend equations
+  context.BlendEquationSeparate( mBlendingOptions.GetBlendEquationRgb(),
+                                 mBlendingOptions.GetBlendEquationAlpha() );
+
+}
+
 Renderer::Renderer( NodeDataProvider& dataprovider )
 : mDataProvider( dataprovider ),
   mContextDELETEME(NULL),
index 2d047cb..d66e525 100644 (file)
@@ -175,7 +175,19 @@ private:
    * Called from Render prior to DoRender().
    * @todo MESH_REWORK Remove after merge
    */
-  virtual void DoSetUniforms(Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex, ShaderSubTypes subType );
+  virtual void DoSetUniforms( Context& context, BufferIndex bufferIndex, Shader* shader, Program* program, unsigned int programIndex, ShaderSubTypes subType );
+
+  /**
+   * Called from Render prior to DoRender(). Default method to set CullFaceMode
+   * @todo MESH_REWORK Remove after merge
+   */
+  virtual void DoSetCullFaceMode( Context& context, BufferIndex bufferIndex );
+
+  /**
+   * Called from Render prior to DoRender(). Default method to set blending options
+   * @todo MESH_REWORK Remove after merge
+   */
+  virtual void DoSetBlending( Context& context, BufferIndex bufferIndex );
 
   /**
    * Called from Render; implemented in derived classes.
@@ -197,10 +209,10 @@ protected:
   Shader* mShader;
   unsigned int mSamplerBitfield;          ///< Sampler options used for texture filtering
 
+  bool mUseBlend:1;                 ///< True if blending should be enabled, 1 bit is enough
 private:
 
   BlendingOptions mBlendingOptions;
-  bool mUseBlend:1;                 ///< True if blending should be enabled, 1 bit is enough
   CullFaceMode mCullFaceMode:3;     ///< cullface enum, 3 bits is enough
 };
 
index 90ae5fa..744eba6 100644 (file)
 
 // INTERNAL HEADERS
 #include <dali/public-api/shader-effects/material.h>
+#include <dali/public-api/shader-effects/shader-effect.h>
 #include <dali/internal/render/data-providers/sampler-data-provider.h>
 #include <dali/internal/update/effects/scene-graph-sampler.h>
+#include <dali/internal/render/shaders/scene-graph-shader.h>
+#include <dali/public-api/actors/blending.h>
 
 namespace Dali
 {
@@ -33,7 +36,15 @@ Material::Material()
 : mColor( Color::WHITE ),
   mBlendColor( Color::WHITE ),
   mFaceCullingMode(Dali::Material::NONE),
-  mShader(NULL)
+  mBlendingMode(Dali::BlendingMode::AUTO),
+  mBlendFuncSrcFactorRgb(DEFAULT_BLENDING_SRC_FACTOR_RGB),
+  mBlendFuncSrcFactorAlpha(DEFAULT_BLENDING_SRC_FACTOR_ALPHA),
+  mBlendFuncDestFactorRgb(DEFAULT_BLENDING_DEST_FACTOR_RGB),
+  mBlendFuncDestFactorAlpha(DEFAULT_BLENDING_SRC_FACTOR_ALPHA),
+  mBlendEquationRgb(DEFAULT_BLENDING_EQUATION_RGB),
+  mBlendEquationAlpha(DEFAULT_BLENDING_EQUATION_ALPHA),
+  mShader(NULL),
+  mBlendingEnabled(false)
 {
   // Observe own property-owner's uniform map
   AddUniformMapObserver( *this );
@@ -85,11 +96,107 @@ void Material::RemoveSampler( Sampler* sampler )
   }
 }
 
+void Material::PrepareRender( BufferIndex bufferIndex )
+{
+  mBlendingEnabled[bufferIndex] = false; // The best default
+
+  switch(mBlendingMode[bufferIndex])
+  {
+    case BlendingMode::OFF:
+    {
+      mBlendingEnabled[bufferIndex] = false;
+      break;
+    }
+    case BlendingMode::ON:
+    {
+      mBlendingEnabled[bufferIndex] = true;
+      break;
+    }
+    case BlendingMode::AUTO:
+    {
+      bool opaque = true;
+
+      //  @todo: MESH_REWORK - Change hints for new SceneGraphShader
+      if( mShader->GeometryHintEnabled( Dali::ShaderEffect::HINT_BLENDING ) )
+      {
+        opaque = false;
+      }
+
+      if( opaque )
+      {
+        // Require that all affecting samplers are opaque
+        unsigned int opaqueCount=0;
+        unsigned int affectingCount=0;
+
+        for( Vector<Sampler*>::ConstIterator iter = mSamplers.Begin();
+             iter != mSamplers.End(); ++iter )
+        {
+          const Sampler* sampler = *iter;
+          if( sampler != NULL )
+          {
+            if( sampler->AffectsTransparency( bufferIndex ) )
+            {
+              affectingCount++;
+              if( sampler->IsFullyOpaque( bufferIndex ) )
+              {
+                opaqueCount++;
+              }
+            }
+          }
+        }
+        opaque = (opaqueCount == affectingCount);
+      }
+
+      mBlendingEnabled[bufferIndex] = ! opaque;
+    }
+  }
+}
+
 Vector<Sampler*>& Material::GetSamplers()
 {
   return mSamplers;
 }
 
+bool Material::GetBlendingEnabled( BufferIndex bufferIndex ) const
+{
+  return mBlendingEnabled[bufferIndex];
+}
+
+const Vector4& Material::GetBlendColor(BufferIndex bufferIndex) const
+{
+  return mBlendColor[bufferIndex];
+}
+
+BlendingFactor::Type Material::GetBlendSrcFactorRgb( BufferIndex bufferIndex ) const
+{
+  return static_cast<Dali::BlendingFactor::Type>(mBlendFuncSrcFactorRgb[bufferIndex]);
+}
+
+BlendingFactor::Type Material::GetBlendSrcFactorAlpha( BufferIndex bufferIndex ) const
+{
+  return static_cast<Dali::BlendingFactor::Type>(mBlendFuncSrcFactorAlpha[bufferIndex]);
+}
+
+BlendingFactor::Type Material::GetBlendDestFactorRgb( BufferIndex bufferIndex ) const
+{
+  return static_cast<Dali::BlendingFactor::Type>(mBlendFuncDestFactorRgb[bufferIndex]);
+}
+
+BlendingFactor::Type Material::GetBlendDestFactorAlpha( BufferIndex bufferIndex ) const
+{
+  return static_cast<Dali::BlendingFactor::Type>(mBlendFuncDestFactorAlpha[bufferIndex]);
+}
+
+BlendingEquation::Type Material::GetBlendEquationRgb( BufferIndex bufferIndex ) const
+{
+  return static_cast<Dali::BlendingEquation::Type>(mBlendEquationRgb[bufferIndex]);
+}
+
+BlendingEquation::Type Material::GetBlendEquationAlpha( BufferIndex bufferIndex ) const
+{
+  return static_cast<Dali::BlendingEquation::Type>(mBlendEquationAlpha[bufferIndex]);
+}
+
 void Material::ConnectToSceneGraph( SceneController& sceneController, BufferIndex bufferIndex )
 {
 }
@@ -130,6 +237,14 @@ void Material::ResetDefaultProperties( BufferIndex updateBufferIndex )
   mColor.ResetToBaseValue( updateBufferIndex );
   mBlendColor.ResetToBaseValue( updateBufferIndex );
   mFaceCullingMode.CopyPrevious( updateBufferIndex );
+
+  mBlendingMode.CopyPrevious( updateBufferIndex );
+  mBlendFuncSrcFactorRgb.CopyPrevious( updateBufferIndex );
+  mBlendFuncSrcFactorAlpha.CopyPrevious( updateBufferIndex );
+  mBlendFuncDestFactorRgb.CopyPrevious( updateBufferIndex );
+  mBlendFuncDestFactorAlpha.CopyPrevious( updateBufferIndex );
+  mBlendEquationRgb.CopyPrevious( updateBufferIndex );
+  mBlendEquationAlpha.CopyPrevious( updateBufferIndex );
 }
 
 } // namespace SceneGraph
index a450620..4245554 100644 (file)
@@ -71,6 +71,58 @@ public:
   void RemoveSampler( Sampler* sampler );
 
   /**
+   * Prepare the material for rendering.
+   *
+   * Determine whether blending is enabled for this material, and store the result.
+   * @param[in] bufferIndex The current buffer index
+   */
+  void PrepareRender( BufferIndex bufferIndex );
+
+  /**
+   * Return true if the material requires blending
+   * @return true if the material requires blending
+   */
+  bool GetBlendingEnabled( BufferIndex bufferIndex ) const;
+
+public: // Implementation of MaterialDataProvider
+
+  /**
+   * @copydoc MaterialDataProvider::GetBlendColor
+   */
+  virtual const Vector4& GetBlendColor(BufferIndex bufferIndex) const;
+
+  /**
+   * @copydoc MaterialDataProvider::GetBlendSrcFactorRgb
+   */
+  virtual BlendingFactor::Type GetBlendSrcFactorRgb(BufferIndex bufferIndex) const;
+
+  /**
+   * @copydoc MaterialDataProvider::GetBlendSrcFactorAlpha
+   */
+  virtual BlendingFactor::Type GetBlendSrcFactorAlpha( BufferIndex bufferIndex ) const;
+
+  /**
+   * @copydoc MaterialDataProvider::GetBlendDestFactorRgb
+   */
+  virtual BlendingFactor::Type GetBlendDestFactorRgb( BufferIndex bufferIndex ) const;
+
+  /**
+   * @copydoc MaterialDataProvider::GetBlendDestFactorAlpha
+   */
+  virtual BlendingFactor::Type GetBlendDestFactorAlpha( BufferIndex bufferIndex ) const;
+
+  /**
+   * @copydoc MaterialDataProvider::GetBlendEquationRgb
+   */
+  virtual BlendingEquation::Type GetBlendEquationRgb( BufferIndex bufferIndex ) const;
+
+  /**
+   * @copydoc MaterialDataProvider::GetBlendEquationAlpha
+   */
+  virtual BlendingEquation::Type GetBlendEquationAlpha( BufferIndex bufferIndex ) const;
+
+public: // Implementation of ObjectOwnerContainer template methods
+  /**
    * Connect the object to the scene graph
    *
    * @param[in] sceneController The scene controller - used for sending messages to render thread
@@ -85,6 +137,7 @@ public:
    */
   void DisconnectFromSceneGraph( SceneController& sceneController, BufferIndex bufferIndex );
 
+public: // Implementation of ConnectionChangePropagator
   /**
    * @copydoc ConnectionChangePropagator::AddObserver
    */
@@ -136,14 +189,21 @@ public: // Property data
   AnimatableProperty<Vector4> mColor;
   AnimatableProperty<Vector4> mBlendColor;
   DoubleBufferedProperty<int> mFaceCullingMode;
+  DoubleBufferedProperty<int> mBlendingMode;
+
+  // @todo MESH_REWORK Consider storing only mBlendingOptions bitmask
+  DoubleBufferedProperty<int> mBlendFuncSrcFactorRgb;
+  DoubleBufferedProperty<int> mBlendFuncSrcFactorAlpha;
+  DoubleBufferedProperty<int> mBlendFuncDestFactorRgb;
+  DoubleBufferedProperty<int> mBlendFuncDestFactorAlpha;
+  DoubleBufferedProperty<int> mBlendEquationRgb;
+  DoubleBufferedProperty<int> mBlendEquationAlpha;
 
 private:
   Shader* mShader;
   Vector<Sampler*> mSamplers; // Not owned
   ConnectionChangePropagator mConnectionObservers;
-
-  // @todo MESH_REWORK add property values for cull face mode, blending options, blend color
-  // Add getters/setters?
+  DoubleBuffered<bool> mBlendingEnabled; // The output of the current blending mode and sampler properties
 };
 
 inline void SetShaderMessage( EventThreadServices& eventThreadServices, const Material& material, const Shader& shader )
index ae7ba34..51e1699 100644 (file)
@@ -70,7 +70,6 @@ void PrepareRenderables( BufferIndex updateBufferIndex, RenderableAttachmentCont
 
 void PrepareRenderables( BufferIndex updateBufferIndex, SortedLayerPointers& sortedLayers )
 {
-
   const SortedLayersIter endIter = sortedLayers.end();
 
   for ( SortedLayersIter iter = sortedLayers.begin(); iter != endIter; ++iter )
index 6010adf..7495fe0 100644 (file)
@@ -164,7 +164,7 @@ static bool AddRenderablesForTask( BufferIndex updateBufferIndex,
           {
             layer->overlayRenderables.push_back( renderable );
           }
-          else if ( ! renderable->IsBlendingOn( updateBufferIndex ) )
+          else if ( renderable->IsFullyOpaque( updateBufferIndex ) )
           {
             layer->opaqueRenderables.push_back( renderable );
           }
index 4f5b77e..17d208b 100644 (file)
@@ -693,7 +693,19 @@ bool UpdateManager::FlushQueue()
 
 void UpdateManager::ResetNodeProperty( Node& node )
 {
-  node.ResetToBaseValues( mSceneGraphBuffers.GetUpdateBufferIndex() );
+  BufferIndex bufferIndex = mSceneGraphBuffers.GetUpdateBufferIndex();
+
+  node.ResetToBaseValues( bufferIndex );
+
+  // @todo MESH_REWORK Only perform this step for RendererAttachments - consider
+  // storing them again? Split out to separate scene graph object owned by UpdateManager
+  // It is after all, a property owner, and always requires resetting...
+  // The depth index should not be an animatable property... and probably not even
+  // a constraint input? (Double buffering will slow down the sort algorithm slightly)
+  if( node.HasAttachment() )
+  {
+    node.GetAttachment().ResetToBaseValues( bufferIndex );
+  }
 }
 
 void UpdateManager::ResetProperties()
index 7803450..a7d3402 100644 (file)
@@ -122,6 +122,12 @@ public:
   // Update methods
 
   /**
+   * Called to reset attachment's properties to base values.
+   * Attachments without properties should not override this method
+   */
+  virtual void ResetToBaseValues(BufferIndex bufferIndex) { }
+
+  /**
    * Called when the attachment or it's owning node is flagged as dirty during scene graph updates.
    * Allows derived classes to perform extra processing
    * @param[in] updateBufferIndex The current update buffer index.
index 5af55fc..ed8edda 100644 (file)
@@ -420,27 +420,55 @@ void ImageAttachment::DoPrepareRender( BufferIndex updateBufferIndex )
   }
 }
 
+void RenderableAttachment::SetBlendingMode( BlendingMode::Type mode )
+{
+  mBlendingMode = mode;
+}
+
+BlendingMode::Type RenderableAttachment::GetBlendingMode() const
+{
+  return mBlendingMode;
+}
+
 bool ImageAttachment::IsFullyOpaque( BufferIndex updateBufferIndex )
 {
-  /**
-   * Fully opaque when...
-   *   1) not using the alpha channel from the image data
-   *   2) the inherited color is not transparent nor semi-transparent
-   *   3) the shader doesn't require blending
-   */
-  bool opaque = mBitmapMetadata.IsFullyOpaque();
-
-  if ( opaque && mParent )
-  {
-    opaque = ( mParent->GetWorldColor(updateBufferIndex).a >= FULLY_OPAQUE );
+  bool fullyOpaque = true;
 
-    if ( opaque && mShader != NULL )
+  switch( mBlendingMode )
+  {
+    case BlendingMode::OFF:
     {
-      opaque = !PreviousHintEnabled( Dali::ShaderEffect::HINT_BLENDING );
+      fullyOpaque = true;
+      break;
     }
-  }
+    case BlendingMode::ON:
+    {
+      // Blending always.
+      fullyOpaque = false;
+      break;
+    }
+    case BlendingMode::AUTO:
+    {
+      /**
+       * Fully opaque when...
+       *   1) not using the alpha channel from the image data
+       *   2) the inherited color is not transparent nor semi-transparent
+       *   3) the shader doesn't require blending
+       */
+      fullyOpaque = mBitmapMetadata.IsFullyOpaque();
+
+      if ( fullyOpaque && mParent )
+      {
+        fullyOpaque = ( mParent->GetWorldColor(updateBufferIndex).a >= FULLY_OPAQUE );
 
-  return opaque;
+        if ( fullyOpaque && mShader != NULL )
+        {
+          fullyOpaque = !PreviousHintEnabled( Dali::ShaderEffect::HINT_BLENDING );
+        }
+      }
+    }
+  }
+  return fullyOpaque;
 }
 
 void ImageAttachment::SendShaderChangeMessage( BufferIndex updateBufferIndex )
index 6f0444f..4568673 100644 (file)
@@ -65,8 +65,6 @@ void RenderableAttachment::Initialize( SceneController& sceneController, BufferI
 
   // Chain to derived attachments
   Initialize2( updateBufferIndex );
-
-  // @todo MESH_REWORK: removed: renderer.SetCullFace & renderer.SetShader;
 }
 
 void RenderableAttachment::OnDestroy()
@@ -78,16 +76,6 @@ void RenderableAttachment::OnDestroy()
   mSceneController = NULL;
 }
 
-void RenderableAttachment::SetBlendingMode( BlendingMode::Type mode )
-{
-  mBlendingMode = mode;
-}
-
-BlendingMode::Type RenderableAttachment::GetBlendingMode() const
-{
-  return mBlendingMode;
-}
-
 void RenderableAttachment::SetRecalculateScaleForSize()
 {
   mScaleForSizeDirty = true;
@@ -125,61 +113,11 @@ bool RenderableAttachment::ResolveVisibility( BufferIndex updateBufferIndex )
   return mHasSizeAndColorFlag;
 }
 
-bool RenderableAttachment::IsBlendingOn( BufferIndex updateBufferIndex )
-{
-  // Check whether blending needs to be disabled / enabled
-  bool blend = false;
-  switch( mBlendingMode )
-  {
-    case BlendingMode::OFF:
-    {
-      // No blending.
-      blend = false;
-      break;
-    }
-    case BlendingMode::AUTO:
-    {
-      // Blending if the node is not fully opaque only.
-      blend = !IsFullyOpaque( updateBufferIndex );
-      break;
-    }
-    case BlendingMode::ON:
-    {
-      // Blending always.
-      blend = true;
-      break;
-    }
-    default:
-    {
-      DALI_ASSERT_ALWAYS( !"RenderableAttachment::PrepareRender. Wrong blending mode" );
-    }
-  }
-  return blend;
-}
-
-void RenderableAttachment::ChangeBlending( BufferIndex updateBufferIndex, bool useBlend )
-{
-  if ( mUseBlend != useBlend )
-  {
-    mUseBlend = useBlend;
-
-    // Enable/disable blending in the next render
-    typedef MessageValue1< Renderer, bool > DerivedType;
-
-    // Reserve some memory inside the render queue
-    unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( updateBufferIndex, sizeof( DerivedType ) );
-
-    // Construct message in the render queue memory; note that delete should not be called on the return value
-    new (slot) DerivedType( &GetRenderer(), &Renderer::SetUseBlend, useBlend );
-  }
-}
-
 void RenderableAttachment::DoGetScaleForSize( const Vector3& nodeSize, Vector3& scaling )
 {
   scaling = Vector3::ONE;
 }
 
-
 void RenderableAttachment::PrepareResources( BufferIndex updateBufferIndex, ResourceManager& resourceManager )
 {
   mHasUntrackedResources = false; // Only need to know this if the resources are not yet complete
@@ -272,16 +210,29 @@ void RenderableAttachment::GetReadyAndComplete(bool& ready, bool& complete) cons
   }
 }
 
-
 void RenderableAttachment::PrepareRender( BufferIndex updateBufferIndex )
 {
   // call the derived class first as it might change its state regarding blending
   DoPrepareRender( updateBufferIndex );
 
-  bool blend = IsBlendingOn( updateBufferIndex );
-  ChangeBlending( updateBufferIndex, blend );
-}
+  // @todo MESH_REWORK Remove remainder of method after removing ImageAttachment
 
+  bool blend = !IsFullyOpaque( updateBufferIndex );
+
+  if ( mUseBlend != blend )
+  {
+    mUseBlend = blend;
+
+    // Enable/disable blending in the next render
+    typedef MessageValue1< Renderer, bool > DerivedType;
+
+    // Reserve some memory inside the render queue
+    unsigned int* slot = mSceneController->GetRenderQueue().ReserveMessageSlot( updateBufferIndex, sizeof( DerivedType ) );
+
+    // Construct message in the render queue memory; note that delete should not be called on the return value
+    new (slot) DerivedType( &GetRenderer(), &Renderer::SetUseBlend, blend );
+  }
+}
 
 RenderableAttachment* RenderableAttachment::GetRenderable()
 {
index 968e9c0..a525d7b 100644 (file)
@@ -151,20 +151,6 @@ public: // For use during in the update algorithm only
   }
 
   /**
-   * Query whether the attachment has blending enabled.
-   * @param[in] updateBufferIndex The current update buffer index.
-   * @return true if blending is enabled, false otherwise.
-   */
-  bool IsBlendingOn( BufferIndex updateBufferIndex );
-
-  /**
-   * Check if the blending mode has changed - if it has, send message to renderer
-   * @param[in] updateBufferIndex The current update buffer index.
-   * @param[in] useBlending True if the renderer should use blending option
-   */
-  void ChangeBlending( BufferIndex updateBufferIndex, bool useBlending );
-
-  /**
    * Prepare the object resources.
    * This must be called by the UpdateManager before calling PrepareRender, for each frame.
    * @param[in] updateBufferIndex The current update buffer index.
@@ -215,6 +201,15 @@ public: // API for derived classes
   virtual const Renderer& GetRenderer() const = 0;
 
   /**
+   * Prepare the object resources.
+   * This must be called by the UpdateManager before calling PrepareRender, for each frame.
+   * @param[in] updateBufferIndex The current buffer index.
+   * @param[in] resourceManager The resource manager.
+   * @return True if resources are ready, false will prevent PrepareRender being called for this attachment.
+   */
+  virtual bool DoPrepareResources( BufferIndex updateBufferIndex, ResourceManager& resourceManager ) = 0;
+
+  /**
    * @copydoc RenderableAttachment::PrepareRender()
    */
   virtual void DoPrepareRender( BufferIndex updateBufferIndex ) = 0;
@@ -260,15 +255,6 @@ public: // API for derived classes
 
 private:
 
-  /**
-   * Prepare the object resources.
-   * This must be called by the UpdateManager before calling PrepareRender, for each frame.
-   * @param[in] updateBufferIndex The current buffer index.
-   * @param[in] resourceManager The resource manager.
-   * @return True if resources are ready, false will prevent PrepareRender being called for this attachment.
-   */
-  virtual bool DoPrepareResources( BufferIndex updateBufferIndex, ResourceManager& resourceManager ) = 0;
-
   // Undefined
   RenderableAttachment( const RenderableAttachment& );
 
index dce9ce6..a005dd1 100644 (file)
@@ -151,9 +151,23 @@ Geometry& RendererAttachment::GetGeometry()
   return *mGeometry;
 }
 
-int RendererAttachment::GetDepthIndex(BufferIndex bufferIndex) const
+void RendererAttachment::SetDepthIndex( BufferIndex updateBufferIndex, int depthIndex )
 {
-  return mDepthIndex[bufferIndex];
+  mDepthIndex.Bake(updateBufferIndex, depthIndex);
+
+  if( mParent )
+  {
+    // only do this if we are on-stage
+    mParent->SetDirtyFlag( SortModifierFlag );
+  }
+
+  // @todo MESH_REWORK Change SortTransparentRenderItems to use GetDepthIndex instead
+  mSortModifier = depthIndex;
+}
+
+void RendererAttachment::ResetToBaseValues( BufferIndex updateBufferIndex )
+{
+  mDepthIndex.ResetToBaseValue( updateBufferIndex );
 }
 
 Renderer& RendererAttachment::GetRenderer()
@@ -166,6 +180,99 @@ const Renderer& RendererAttachment::GetRenderer() const
   return *mRenderer;
 }
 
+// Called by ProcessRenderTasks after DoPrepareRender
+bool RendererAttachment::IsFullyOpaque( BufferIndex updateBufferIndex )
+{
+  bool opaque = false;
+
+  if( mParent )
+  {
+    opaque = mParent->GetWorldColor( updateBufferIndex ).a >= FULLY_OPAQUE;
+  }
+
+  if( opaque && mMaterial != NULL )
+  {
+    // Calculated by material in PrepareRender step
+    opaque = ! mMaterial->GetBlendingEnabled( updateBufferIndex );
+  }
+
+  return opaque;
+}
+
+void RendererAttachment::SizeChanged( BufferIndex updateBufferIndex )
+{
+  // Do nothing.
+}
+
+bool RendererAttachment::DoPrepareResources(
+  BufferIndex updateBufferIndex,
+  ResourceManager& resourceManager )
+{
+  DALI_ASSERT_DEBUG( mSceneController );
+
+  CompleteStatusManager& completeStatusManager = mSceneController->GetCompleteStatusManager();
+  bool ready = false;
+  mFinishedResourceAcquisition = false;
+
+  // Can only be considered ready when all the scene graph objects are connected to the renderer
+  if( ( mGeometry ) &&
+      ( mGeometry->GetVertexBuffers().Count() > 0 ) &&
+      ( mMaterial ) &&
+      ( mMaterial->GetShader() != NULL ) )
+  {
+    unsigned int completeCount = 0;
+    unsigned int neverCount = 0;
+    unsigned int frameBufferCount = 0;
+
+    Vector<Sampler*>& samplers = mMaterial->GetSamplers();
+    for( Vector<Sampler*>::ConstIterator iter = samplers.Begin();
+         iter != samplers.End(); ++iter )
+    {
+      Sampler* sampler = *iter;
+
+      ResourceId textureId = sampler->GetTextureId( updateBufferIndex );
+      BitmapMetadata metaData = resourceManager.GetBitmapMetadata( textureId );
+
+      sampler->SetFullyOpaque( metaData.IsFullyOpaque() );
+
+      switch( completeStatusManager.GetStatus( textureId ) )
+      {
+        case CompleteStatusManager::NOT_READY:
+        {
+          ready = false;
+          if( metaData.GetIsFramebuffer() )
+          {
+            frameBufferCount++;
+          }
+          FollowTracker( textureId ); // @todo MESH_REWORK Trackers per sampler rather than per actor?
+        }
+        break;
+
+        case CompleteStatusManager::COMPLETE:
+        {
+          completeCount++;
+        }
+        break;
+
+        case CompleteStatusManager::NEVER:
+        {
+          neverCount++;
+        }
+        break;
+      }
+    }
+
+    // We are ready if all samplers are complete, or those that aren't are framebuffers
+    // We are complete if all samplers are either complete or will never complete
+
+    ready = ( completeCount + frameBufferCount >= samplers.Count() ) ;
+    mFinishedResourceAcquisition = ( completeCount + neverCount >= samplers.Count() );
+  }
+
+  return ready;
+}
+
+
 // Uniform maps are checked in the following priority order:
 //   Renderer (this object)
 //   Actor
@@ -176,6 +283,9 @@ const Renderer& RendererAttachment::GetRenderer() const
 //   VertexBuffers
 void RendererAttachment::DoPrepareRender( BufferIndex updateBufferIndex )
 {
+  // @todo MESH_REWORK - call DoPrepareRender on all scene objects? in caller class?
+  mMaterial->PrepareRender( updateBufferIndex );
+
   if( mRegenerateUniformMap > 0)
   {
     if( mRegenerateUniformMap == REGENERATE_UNIFORM_MAP)
@@ -257,117 +367,6 @@ void RendererAttachment::DoPrepareRender( BufferIndex updateBufferIndex )
   }
 }
 
-bool RendererAttachment::IsFullyOpaque( BufferIndex updateBufferIndex )
-{
-  bool opaque = false;
-
-  if( mParent )
-  {
-    opaque = mParent->GetWorldColor( updateBufferIndex ).a >= FULLY_OPAQUE;
-  }
-
-  if( mMaterial != NULL )
-  {
-    // Require that all affecting samplers are opaque
-    unsigned int opaqueCount=0;
-    unsigned int affectingCount=0;
-
-    Vector<Sampler*>& samplers = mMaterial->GetSamplers();
-    for( Vector<Sampler*>::ConstIterator iter = samplers.Begin();
-         iter != samplers.End(); ++iter )
-    {
-      const Sampler* sampler = *iter;
-      if( sampler != NULL )
-      {
-        if( sampler->AffectsTransparency( updateBufferIndex ) )
-        {
-          affectingCount++;
-          if( sampler->IsFullyOpaque( updateBufferIndex ) )
-          {
-            opaqueCount++;
-          }
-        }
-      }
-    }
-    opaque = (opaqueCount == affectingCount);
-  }
-
-  return opaque;
-}
-
-void RendererAttachment::SizeChanged( BufferIndex updateBufferIndex )
-{
-  // Do nothing.
-}
-
-bool RendererAttachment::DoPrepareResources(
-  BufferIndex updateBufferIndex,
-  ResourceManager& resourceManager )
-{
-  DALI_ASSERT_DEBUG( mSceneController );
-
-  CompleteStatusManager& completeStatusManager = mSceneController->GetCompleteStatusManager();
-
-  bool ready = false;
-  mFinishedResourceAcquisition = false;
-
-  // Can only be considered ready when all the scene graph objects are connected to the renderer
-  if( ( mGeometry ) &&
-      ( mGeometry->GetVertexBuffers().Count() > 0 ) &&
-      ( mMaterial ) &&
-      ( mMaterial->GetShader() != NULL ) )
-  {
-    unsigned int completeCount = 0;
-    unsigned int neverCount = 0;
-    unsigned int frameBufferCount = 0;
-
-    Vector<Sampler*>& samplers = mMaterial->GetSamplers();
-    for( Vector<Sampler*>::ConstIterator iter = samplers.Begin();
-         iter != samplers.End(); ++iter )
-    {
-      Sampler* sampler = *iter;
-
-      ResourceId textureId = sampler->GetTextureId( updateBufferIndex );
-      BitmapMetadata metaData = resourceManager.GetBitmapMetadata( textureId );
-
-      sampler->SetFullyOpaque( metaData.IsFullyOpaque() );
-
-      switch( completeStatusManager.GetStatus( textureId ) )
-      {
-        case CompleteStatusManager::NOT_READY:
-        {
-          ready = false;
-          if( metaData.GetIsFramebuffer() )
-          {
-            frameBufferCount++;
-          }
-          FollowTracker( textureId ); // @todo MESH_REWORK Trackers per sampler rather than per actor?
-        }
-        break;
-
-        case CompleteStatusManager::COMPLETE:
-        {
-          completeCount++;
-        }
-        break;
-
-        case CompleteStatusManager::NEVER:
-        {
-          neverCount++;
-        }
-        break;
-      }
-    }
-
-    // We are ready if all samplers are complete, or those that aren't are framebuffers
-    // We are complete if all samplers are either complete or will never complete
-
-    ready = ( completeCount + frameBufferCount >= samplers.Count() ) ;
-    mFinishedResourceAcquisition = ( completeCount + neverCount >= samplers.Count() );
-  }
-
-  return ready;
-}
 
 void RendererAttachment::ConnectionsChanged( PropertyOwner& object )
 {
index fe210c4..670a277 100644 (file)
@@ -125,10 +125,28 @@ public:
   Geometry& GetGeometry();
 
   /**
-   * Get the depth index
+   * Set the depth index
+   * @param[in] bufferIndex The buffer index
+   * @param[in] depthIndex the new depth index to use
+   */
+  void SetDepthIndex( BufferIndex bufferIndex, int depthIndex );
+
+  /**
+   * Get the depth index.
+   * Inlined, as called from sort algorithm
    * @return The depth index of the renderer attachment in the current frame
    */
-  int GetDepthIndex( BufferIndex bufferIndex ) const ;
+  int GetDepthIndex( BufferIndex bufferIndex ) const
+  {
+    return mDepthIndex[bufferIndex];
+  }
+
+
+protected: // From NodeAttachment
+  /**
+   * @copydoc NodeAttachment::ResetToBaseValues
+   */
+  virtual void ResetToBaseValues( BufferIndex updateBufferIndex );
 
 protected: // From RenderableAttachment
   /**
@@ -142,6 +160,12 @@ protected: // From RenderableAttachment
   virtual const Renderer& GetRenderer() const;
 
   /**
+   * @copydoc RenderableAttachment::DoPrepareResources()
+   */
+  virtual bool DoPrepareResources( BufferIndex updateBufferIndex,
+                                   ResourceManager& resourceManager );
+
+  /**
    * @copydoc RenderableAttachment::DoPrepareRender()
    */
   virtual void DoPrepareRender( BufferIndex updateBufferIndex );
@@ -156,12 +180,6 @@ protected: // From RenderableAttachment
    */
   virtual void SizeChanged( BufferIndex updateBufferIndex );
 
-  /**
-   * @copydoc RenderableAttachment::DoPrepareResources()
-   */
-  virtual bool DoPrepareResources( BufferIndex updateBufferIndex,
-                                   ResourceManager& resourceManager );
-
 protected: // From ConnectionObserver
   /**
    * @copydoc ConnectionObservers::Observer::ConnectionsChanged
@@ -245,6 +263,17 @@ inline void SetGeometryMessage( EventThreadServices& eventThreadServices, const
   new (slot) LocalType( &attachment, &RendererAttachment::SetGeometry, const_cast<Geometry*>(&geometry) );
 }
 
+inline void SetDepthIndexMessage( EventThreadServices& eventThreadServices, const RendererAttachment& attachment, int depthIndex )
+{
+  typedef MessageDoubleBuffered1< RendererAttachment, int > LocalType;
+
+  // Reserve some memory inside the message queue
+  unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
+
+  // Construct message in the message queue memory; note that delete should not be called on the return value
+  new (slot) LocalType( &attachment, &RendererAttachment::SetDepthIndex, depthIndex );
+}
+
 } // namespace SceneGraph
 } // namespace Internal
 } // namespace Dali
index ffd2d3d..2af1722 100644 (file)
@@ -73,6 +73,11 @@ void Renderer::SetDepthIndex( int depthIndex )
   GetImplementation(*this).SetDepthIndex( depthIndex );
 }
 
+int Renderer::GetCurrentDepthIndex()
+{
+  return GetImplementation(*this).GetCurrentDepthIndex();
+}
+
 Renderer::Renderer( Internal::Renderer* pointer )
 : Handle( pointer )
 {
index 9f76f93..758b361 100644 (file)
@@ -127,7 +127,7 @@ public:
    * @sa SetDepthIndex()
    * @return the depth index
    */
-  int GetDepthIndex();
+  int GetCurrentDepthIndex();
 
 public:
   /**