-Removed mCenter, mGeometryType and mRequiresDepthTest double buffered properties from SceneGraph::Geometry
-Added those properties to RenderGeometry
-When any of those properties change, RenderGeometry is updated via message to RenderManager
-Fixed RequiresDepthTest which wasn't being considered when rendering
Change-Id: Idb70db083ef9c51005a442e7cde158a13994a7f5
{
enum
{
- GEOMETRY_TYPE = DEFAULT_OBJECT_PROPERTY_START_INDEX, ///< name "depth-index", type STRING
- GEOMETRY_CENTER, ///< name "geometry-center", type VECTOR3
+ GEOMETRY_TYPE = DEFAULT_OBJECT_PROPERTY_START_INDEX, ///< name "geometry-type", type STRING
REQUIRES_DEPTH_TEST, ///< name "requires-depth-testing", type BOOLEAN
};
};
* |name |type |writable|animatable|constraint-input|enum for index-checking|
*/
DALI_PROPERTY_TABLE_BEGIN
-DALI_PROPERTY( "geometry-type", STRING, true, false, true, Dali::Geometry::Property::GEOMETRY_TYPE )
-DALI_PROPERTY( "geometry-center", VECTOR3, true, true, true, Dali::Geometry::Property::GEOMETRY_CENTER )
-DALI_PROPERTY( "requires-depth-test", BOOLEAN, true, false, true, Dali::Geometry::Property::REQUIRES_DEPTH_TEST )
+DALI_PROPERTY( "geometry-type", STRING, true, false, true, Dali::Geometry::Property::GEOMETRY_TYPE )
+DALI_PROPERTY( "requires-depth-test", BOOLEAN, true, false, true, Dali::Geometry::Property::REQUIRES_DEPTH_TEST )
DALI_PROPERTY_TABLE_END( DEFAULT_ACTOR_PROPERTY_START_INDEX )
const ObjectImplHelper<DEFAULT_PROPERTY_COUNT> GEOMETRY_IMPL = { DEFAULT_PROPERTY_DETAILS };
void Geometry::SetGeometryType( Dali::Geometry::GeometryType geometryType )
{
- if( NULL != mSceneObject )
+ if( geometryType != mGeometryType )
{
- SceneGraph::DoubleBufferedPropertyMessage<int>::Send(
- GetEventThreadServices(),
- mSceneObject,
- &mSceneObject->mGeometryType,
- &SceneGraph::DoubleBufferedProperty<int>::Set,
- static_cast<int>(geometryType) );
+ SceneGraph::SetGeometryTypeMessage(GetEventThreadServices(),
+ *mSceneObject,
+ geometryType );
+
+ mGeometryType = geometryType;
}
}
Dali::Geometry::GeometryType Geometry::GetGeometryType() const
{
- return mSceneObject->GetGeometryType(GetEventThreadServices().GetEventBufferIndex());
+ return mGeometryType;
}
void Geometry::SetRequiresDepthTesting( bool requiresDepthTest )
{
- if( NULL != mSceneObject )
+ if( requiresDepthTest != mRequiresDepthTest )
{
- SceneGraph::DoubleBufferedPropertyMessage<bool>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mRequiresDepthTest, &SceneGraph::DoubleBufferedProperty<bool>::Set, static_cast<int>(requiresDepthTest) );
+ SceneGraph::SetGeometryRequiresDepthTestMessage(GetEventThreadServices(),
+ *mSceneObject,
+ requiresDepthTest );
+
+ mRequiresDepthTest = requiresDepthTest;
}
}
bool Geometry::GetRequiresDepthTesting() const
{
- if( mSceneObject )
- {
- // mSceneObject is being used in a separate thread; copy the value from the previous update
- return mSceneObject->GetRequiresDepthTesting(GetEventThreadServices().GetEventBufferIndex());
- }
- return false;
+ return mRequiresDepthTest;
}
const SceneGraph::Geometry* Geometry::GetGeometrySceneObject() const
{
case Dali::Geometry::Property::GEOMETRY_TYPE :
{
- SceneGraph::DoubleBufferedPropertyMessage<int>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mGeometryType, &SceneGraph::DoubleBufferedProperty<int>::Set, propertyValue.Get<int>() );
- break;
- }
- case Dali::Geometry::Property::GEOMETRY_CENTER :
- {
- SceneGraph::AnimatablePropertyMessage<Vector3>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mCenter, &SceneGraph::AnimatableProperty<Vector3>::Bake, propertyValue.Get<Vector3>() );
+ Dali::Geometry::GeometryType geometryType = static_cast<Dali::Geometry::GeometryType>(propertyValue.Get<int>());
+ if( geometryType != mGeometryType )
+ {
+ SceneGraph::SetGeometryTypeMessage(GetEventThreadServices(), *mSceneObject, geometryType );
+ mGeometryType = geometryType;
+ }
break;
}
case Dali::Geometry::Property::REQUIRES_DEPTH_TEST :
{
- SceneGraph::DoubleBufferedPropertyMessage<bool>::Send( GetEventThreadServices(), mSceneObject, &mSceneObject->mRequiresDepthTest, &SceneGraph::DoubleBufferedProperty<bool>::Set, propertyValue.Get<bool>() );
+ bool requiresDepthTest = propertyValue.Get<bool>();
+ if( requiresDepthTest != mRequiresDepthTest )
+ {
+ SceneGraph::SetGeometryRequiresDepthTestMessage(GetEventThreadServices(), *mSceneObject, requiresDepthTest);
+ mRequiresDepthTest = requiresDepthTest;
+ }
break;
}
}
Property::Value Geometry::GetDefaultProperty( Property::Index index ) const
{
- BufferIndex bufferIndex = GetEventThreadServices().GetEventBufferIndex();
Property::Value value;
switch( index )
{
if( mSceneObject )
{
- value = mSceneObject->mGeometryType[bufferIndex];
- }
- break;
- }
- case Dali::Geometry::Property::GEOMETRY_CENTER :
- {
- if( mSceneObject )
- {
- value = mSceneObject->mCenter[bufferIndex];
+ value = mGeometryType;
}
break;
}
-
case Dali::Geometry::Property::REQUIRES_DEPTH_TEST :
{
if( mSceneObject )
{
- value = mSceneObject->mRequiresDepthTest[bufferIndex];
+ value = mRequiresDepthTest;
}
break;
}
const SceneGraph::PropertyBase* Geometry::GetSceneObjectAnimatableProperty( Property::Index index ) const
{
const SceneGraph::PropertyBase* property = NULL;
-
if( OnStage() )
{
property = GEOMETRY_IMPL.GetRegisteredSceneGraphProperty ( this,
&Geometry::FindAnimatableProperty,
&Geometry::FindCustomProperty,
index );
-
- if( property == NULL && index < DEFAULT_PROPERTY_MAX_COUNT )
- {
- switch(index)
- {
- case Dali::Geometry::Property::GEOMETRY_CENTER :
- {
- property = &mSceneObject->mCenter;
- break;
- }
- default:
- {
- DALI_ASSERT_ALWAYS( 0 && "Property is not animatable" );
- break;
- }
- }
- }
}
+
return property;
}
if( OnStage() )
{
const SceneGraph::PropertyBase* baseProperty =
- GEOMETRY_IMPL.GetRegisteredSceneGraphProperty ( this,
- &Geometry::FindAnimatableProperty,
- &Geometry::FindCustomProperty,
- index );
+ GEOMETRY_IMPL.GetRegisteredSceneGraphProperty ( this,
+ &Geometry::FindAnimatableProperty,
+ &Geometry::FindCustomProperty,
+ index );
property = static_cast<const PropertyInputImpl*>( baseProperty );
-
- if( property == NULL && index < DEFAULT_PROPERTY_MAX_COUNT )
- {
- switch(index)
- {
- case Dali::Geometry::Property::GEOMETRY_TYPE :
- {
- property = &mSceneObject->mGeometryType;
- break;
- }
- case Dali::Geometry::Property::GEOMETRY_CENTER :
- {
- property = &mSceneObject->mCenter;
- break;
- }
- case Dali::Geometry::Property::REQUIRES_DEPTH_TEST :
- {
- property = &mSceneObject->mRequiresDepthTest;
- break;
- }
- default:
- {
- DALI_ASSERT_ALWAYS( 0 && "Property cannot be a constraint input");
- break;
- }
- }
- }
}
return property;
}
-int Geometry::GetPropertyComponentIndex( Property::Index index ) const
-{
- // @todo MESH_REWORK - Change this if component properties are added for center/half-extent
- return Property::INVALID_COMPONENT_INDEX;
-}
-
bool Geometry::OnStage() const
{
return mOnStage;
}
Geometry::Geometry()
-: mIndexBuffer( NULL ),
- mSceneObject( NULL ),
+: mSceneObject( NULL ),
+ mIndexBuffer( NULL ),
+ mGeometryType(Dali::Geometry::TRIANGLES),
+ mRequiresDepthTest(false),
mOnStage( false )
{
}
*/
virtual const PropertyInputImpl* GetSceneObjectInputProperty( Property::Index index ) const;
- /**
- * @copydoc Dali::Internal::Object::GetPropertyComponentIndex()
- */
- virtual int GetPropertyComponentIndex( Property::Index index ) const;
-
public: // Functions from Connectable
/**
* @copydoc Dali::Internal::Connectable::OnStage()
private: // data
- std::vector<PropertyBufferPtr> mVertexBuffers; ///< Vector of intrusive pointers to vertex buffers
- PropertyBufferPtr mIndexBuffer; ///< Intrusive pointer to index buffer
SceneGraph::Geometry* mSceneObject;
+
+ std::vector<PropertyBufferPtr> mVertexBuffers; ///< Vector of intrusive pointers to vertex buffers
+ PropertyBufferPtr mIndexBuffer; ///< Intrusive pointer to index buffer
+
+ Dali::Geometry::GeometryType mGeometryType; ///< Geometry type (cached)
+ bool mRequiresDepthTest; ///< Establish if geometry requires depth testing (cached)
+
bool mOnStage;
};
DALI_PRINT_RENDER_ITEM( item );
//Enable depth writes if depth buffer is enabled and item is opaque
- context.DepthMask( depthBufferEnabled && item.IsOpaque() );
+ context.DepthMask( depthBufferEnabled && ( item.IsOpaque() || item.GetRenderer().RequiresDepthTest() ) );
item.GetRenderer().Render( context, textureCache, bufferIndex, item.GetNode(), defaultShader, item.GetModelViewMatrix(), viewMatrix, projectionMatrix, cullMode, !item.IsOpaque() );
}
#include <dali/internal/render/gl-resources/context.h>
#include <dali/internal/render/gl-resources/frame-buffer-texture.h>
#include <dali/internal/render/gl-resources/texture-cache.h>
-#include <dali/internal/render/renderers/render-renderer.h>
#include <dali/internal/render/renderers/render-geometry.h>
+#include <dali/internal/render/renderers/render-renderer.h>
#include <dali/internal/render/renderers/render-sampler.h>
#include <dali/internal/render/shaders/program-controller.h>
}
}
+void RenderManager::SetGeometryType( RenderGeometry* geometry, int type )
+{
+ geometry->SetGeometryType( static_cast<Geometry::GeometryType>(type) );
+}
+
+void RenderManager::SetGeometryRequiresDepthTest( RenderGeometry* geometry, bool requiresDepthTest )
+{
+ geometry->SetRequiresDepthTest( requiresDepthTest );
+}
void RenderManager::AddRenderTracker( RenderTracker* renderTracker )
{
void SetPropertyBufferSize(Render::PropertyBuffer* propertyBuffer, size_t size );
/**
+ * Set the geometry type of an existing render geometry
+ * @param[in] geometry The render geometry
+ * @param[in] geometryType The new geometry type
+ */
+ void SetGeometryType( RenderGeometry* geometry, int geometryType );
+
+ /**
+ * Set if an existing geometry requires depth testing
+ * @param[in] geometry The render geometry
+ * @param[in] requiresDepthTest True if depth testing is required, false otherwise
+ */
+ void SetGeometryRequiresDepthTest( RenderGeometry* geometry, bool requiresDepthTest );
+
+ /**
* Adds a render tracker to the RenderManager. RenderManager takes ownership of the
* tracker. The lifetime of the tracker is related to the lifetime of the tracked
* object, usually an offscreen render task.
+++ /dev/null
-#ifndef __DALI_INTERNAL_SCENE_GRAPH_GEOMETRY_DATA_PROVIDER_H__
-#define __DALI_INTERNAL_SCENE_GRAPH_GEOMETRY_DATA_PROVIDER_H__
-/*
- * Copyright (c) 2015 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.
- *
- */
-
-#include <dali/devel-api/rendering/geometry.h>
-#include <dali/devel-api/common/owner-container.h>
-#include <dali/internal/common/buffer-index.h>
-#include <dali/internal/render/data-providers/property-buffer-data-provider.h>
-
-namespace Dali
-{
-namespace Internal
-{
-namespace SceneGraph
-{
-class PropertyBuffer;
-
-/**
- * An interface to provide geometry properties to the render thread.
- */
-class GeometryDataProvider
-{
-public:
- typedef Dali::Geometry::GeometryType GeometryType;
-
- /**
- * Constructor. Nothing to do as a pure interface.
- */
- GeometryDataProvider() { }
-
-public: // GeometryDataProvider
- /**
- * Get the type of geometry to draw
- */
- virtual GeometryType GetGeometryType( BufferIndex bufferIndex ) const = 0;
-
- /**
- * @todo MESH_REWORK - Should only use this in Update Sorting algorithm
- * Returns true if this geometry requires depth testing, e.g. if it is
- * a set of vertices with differing z values.
- */
- virtual bool GetRequiresDepthTesting( BufferIndex bufferIndex ) const = 0;
-
-protected:
-
- /**
- * Virtual destructor, this is an interface, no deletion through this interface
- */
- virtual ~GeometryDataProvider() { }
-};
-
-} // SceneGraph
-} // Internal
-} // Dali
-
-#endif // __DALI_INTERNAL_SCENE_GRAPH_GEOMETRY_DATA_PROVIDER_H__
* limitations under the License.
*/
+#include <dali/internal/common/buffer-index.h>
#include <dali/public-api/common/dali-vector.h>
#include <dali/public-api/actors/blending.h>
*
*/
-#include <dali/internal/render/data-providers/geometry-data-provider.h>
#include <dali/internal/render/data-providers/material-data-provider.h>
#include <dali/internal/render/data-providers/node-data-provider.h>
#include <dali/internal/render/data-providers/property-buffer-data-provider.h>
*/
#include <dali/internal/render/renderers/render-geometry.h>
-
#include <dali/internal/common/buffer-index.h>
-#include <dali/internal/update/rendering/scene-graph-geometry.h>
-#include <dali/internal/render/data-providers/render-data-provider.h>
#include <dali/internal/render/gl-resources/context.h>
#include <dali/internal/render/gl-resources/gpu-buffer.h>
#include <dali/internal/render/renderers/render-property-buffer.h>
namespace SceneGraph
{
-RenderGeometry::RenderGeometry( const GeometryDataProvider& geometryDataProvider )
-: mGeometryDataProvider( geometryDataProvider ),
- mIndexBuffer(0),
+RenderGeometry::RenderGeometry( GeometryType type, bool requiresDepthTest )
+: mIndexBuffer(0),
+ mGeometryType( type ),
+ mRequiresDepthTest(requiresDepthTest ),
mHasBeenUpdated(false),
mAttributesChanged(true)
{
}
//Draw call
- GeometryDataProvider::GeometryType type = mGeometryDataProvider.GetGeometryType( bufferIndex );
- switch(type)
+ switch(mGeometryType)
{
case Dali::Geometry::TRIANGLES:
{
#include <dali/integration-api/gl-defines.h>
#include <dali/internal/common/buffer-index.h>
#include <dali/internal/common/owner-pointer.h>
-#include <dali/internal/render/data-providers/render-data-provider.h>
#include <dali/integration-api/gl-abstraction.h>
+#include <dali/internal/update/rendering/scene-graph-geometry.h>
namespace Dali
{
namespace SceneGraph
{
-class RenderDataProvider;
-class GeometryDataProvider;
/**
* This class encapsulates the GPU buffers. It is used to upload vertex data
{
public:
+ typedef SceneGraph::Geometry::GeometryType GeometryType;
/**
* Constructor. Creates a render geometry object with no GPU buffers.
+ * @param[in] center The center of the geometry
+ * @param[in] geometryType The geometry type
+ * @param[in] requiresDepthTest True if geometry requires depth testing, false otherwise
*/
- RenderGeometry( const GeometryDataProvider& geometryDataProvider );
-
+ RenderGeometry( GeometryType geometryType, bool requiresDepthTest );
/**
* Destructor
*/
}
/**
+ * Sets the geometry type
+ * @param[in] type The new geometry type
+ */
+ void SetGeometryType( GeometryType type )
+ {
+ mGeometryType = type;
+ }
+
+ /**
+ * Sets if the geometry requires depth testing
+ * @param[in] requiresDepthTest True if depth testing is required, false otherwise
+ */
+ void SetRequiresDepthTest( bool requiresDepthTest )
+ {
+ mRequiresDepthTest = requiresDepthTest;
+ }
+
+ /**
+ * Check if geometry requires depth testing
+ * @return True if depth testing is required, false otherwise
+ */
+ bool RequiresDepthTest() const
+ {
+ return mRequiresDepthTest;
+ }
+
+ /**
* Upload the geometry if it has changed, set up the attributes and perform
* the Draw call corresponding to the geometry type
* @param[in] context The GL context
private:
- const GeometryDataProvider& mGeometryDataProvider; //Reference to update thread object
-
// PropertyBuffers
Render::PropertyBuffer* mIndexBuffer;
Vector<Render::PropertyBuffer*> mVertexBuffers;
+ GeometryType mGeometryType;
+
// Booleans
+ bool mRequiresDepthTest : 1;
bool mHasBeenUpdated : 1;
bool mAttributesChanged : 1;
+
};
} // namespace SceneGraph
// @todo MESH_REWORK Should use Update thread objects only in PrepareRenderInstructions.
bool NewRenderer::RequiresDepthTest() const
{
+ if( mRenderGeometry )
+ {
+ return mRenderGeometry->RequiresDepthTest();
+ }
+
return true;
}
new (slot) DerivedType( &mRenderManager, &RenderManager::RemovePropertyBuffer, &renderGeometry, propertyBuffer );
}
+void RenderMessageDispatcher::SetGeometryType( RenderGeometry& geometry, int geometryType )
+{
+ typedef MessageValue2< RenderManager, RenderGeometry*, int > DerivedType;
+
+ // Reserve some memory inside the render queue
+ unsigned int* slot = mRenderQueue.ReserveMessageSlot( mBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
+
+ // Construct message in the render queue memory; note that delete should not be called on the return value
+ new (slot) DerivedType( &mRenderManager, &RenderManager::SetGeometryType, &geometry, geometryType );
+}
+
+void RenderMessageDispatcher::SetGeometryRequiresDepthTest( RenderGeometry& geometry, bool requiresDepthTest )
+{
+ typedef MessageValue2< RenderManager, RenderGeometry*, bool > DerivedType;
+
+ // Reserve some memory inside the render queue
+ unsigned int* slot = mRenderQueue.ReserveMessageSlot( mBuffers.GetUpdateBufferIndex(), sizeof( DerivedType ) );
+
+ // Construct message in the render queue memory; note that delete should not be called on the return value
+ new (slot) DerivedType( &mRenderManager, &RenderManager::SetGeometryRequiresDepthTest, &geometry, requiresDepthTest );
+}
+
void RenderMessageDispatcher::AddRenderTracker( RenderTracker& renderTracker )
{
typedef MessageValue1< RenderManager, RenderTracker* > DerivedType;
void RemovePropertyBuffer( RenderGeometry& renderGeometry, Render::PropertyBuffer* propertyBuffer );
/**
+ * Set the geometry type of an existing render geometry
+ * @param[in] geometry The render geometry
+ * @param[in] geometryType The new geometry type
+ */
+ void SetGeometryType( RenderGeometry& geometry, int geometryType );
+
+ /**
+ * Set if an existing geometry requires depth testing
+ * @param[in] geometry The render geometry
+ * @param[in] requiresDepthTest True if depth testing is required, false otherwise
+ */
+ void SetGeometryRequiresDepthTest( RenderGeometry& geometry, bool requiresDepthTest );
+
+ /**
* Add a Render tracker.
* @param[in] renderTracker The render tracker to add.
* @post ownership is transferred
{
Geometry::Geometry()
-: mIndexBuffer( NULL ),
- mRenderGeometry(0),
- mSceneController(0),
- mRendererRefCount(0u),
- mCenter(),
+: mRenderGeometry(NULL),
+ mSceneController(NULL),
+ mIndexBuffer( NULL ),
mGeometryType(Dali::Geometry::TRIANGLES),
+ mRendererRefCount(0u),
mRequiresDepthTest(false)
{
mConnectionObservers.ConnectionsChanged(*this);
}
-void Geometry::SetGeometryType( BufferIndex bufferIndex, Geometry::GeometryType geometryType )
+void Geometry::SetGeometryType(Geometry::GeometryType geometryType )
{
- mGeometryType.Set( bufferIndex, geometryType);
+ mGeometryType = geometryType;
+ if( mRenderGeometry )
+ {
+ mSceneController->GetRenderMessageDispatcher().SetGeometryType( *mRenderGeometry, static_cast<int>(geometryType) );
+ }
+}
+
+void Geometry::SetRequiresDepthTest( bool requiresDepthTest )
+{
+ mRequiresDepthTest = requiresDepthTest;
+ if( mRenderGeometry )
+ {
+ mSceneController->GetRenderMessageDispatcher().SetGeometryRequiresDepthTest( *mRenderGeometry, requiresDepthTest );
+ }
}
Vector<Render::PropertyBuffer*>& Geometry::GetVertexBuffers()
Geometry::GeometryType Geometry::GetGeometryType( BufferIndex bufferIndex) const
{
- int geometryType = mGeometryType[ bufferIndex ];
- return static_cast< GeometryDataProvider::GeometryType > ( geometryType );
+ return mGeometryType;
}
bool Geometry::GetRequiresDepthTesting( BufferIndex bufferIndex ) const
{
- return mRequiresDepthTest.GetBoolean( bufferIndex );
-}
-
-void Geometry::ResetDefaultProperties( BufferIndex updateBufferIndex )
-{
- // Reset the animated properties
- mCenter.ResetToBaseValue( updateBufferIndex );
-
- // Age the double buffered properties
- mGeometryType.CopyPrevious(updateBufferIndex);
- mRequiresDepthTest.CopyPrevious(updateBufferIndex);
+ return mRequiresDepthTest;
}
void Geometry::ConnectToSceneGraph( SceneController& sceneController, BufferIndex bufferIndex )
{
//Create RenderGeometry
mSceneController = sceneController;
- mRenderGeometry = new RenderGeometry( *this );
+ mRenderGeometry = new RenderGeometry( mGeometryType, mRequiresDepthTest );
size_t vertexBufferCount( mVertexBuffers.Size() );
for( size_t i(0); i<vertexBufferCount; ++i )
#include <dali/internal/update/common/property-boolean.h>
#include <dali/internal/update/common/uniform-map.h>
#include <dali/internal/update/common/scene-graph-connection-change-propagator.h>
-#include <dali/internal/render/data-providers/geometry-data-provider.h>
#include <dali/internal/render/data-providers/render-data-provider.h>
namespace Dali
* This scene graph object is a property owner. It describes a geometry using a
* number of PropertyBuffers acting as Vertex buffers.
*/
-class Geometry : public PropertyOwner, public GeometryDataProvider, public UniformMap::Observer
+class Geometry : public PropertyOwner, public UniformMap::Observer
{
public:
+ typedef Dali::Geometry::GeometryType GeometryType;
/**
* Constructor
*/
* @param[in] bufferIndex Index for double buffered values
* @param[in] geometryType The geometry type
*/
- void SetGeometryType( BufferIndex bufferIndex, GeometryType geometryType );
+ void SetGeometryType( GeometryType geometryType );
+
+ /**
+ * Set if the geometry requires depth testing
+ * @param[in] requiresDepthTest True if depth testing is required, false otherwise
+ */
+ void SetRequiresDepthTest( bool requiresDepthTest );
/**
* Connect the object to the scene graph
*/
virtual bool GetRequiresDepthTesting( BufferIndex bufferIndex ) const;
-protected: // From PropertyOwner
- /**
- * @copydoc Dali::Internal::SceneGraph::PropertyOwner::ResetDefaultProperties()
- */
- virtual void ResetDefaultProperties( BufferIndex updateBufferIndex );
-
private:
+ RenderGeometry* mRenderGeometry;
+ SceneController* mSceneController;
+
+ Render::PropertyBuffer* mIndexBuffer; ///< The index buffer if required
Vector<Render::PropertyBuffer*> mVertexBuffers; ///< The vertex buffers
- Render::PropertyBuffer* mIndexBuffer; ///< The index buffer if required
- ConnectionChangePropagator mConnectionObservers;
- RenderGeometry* mRenderGeometry;
- SceneController* mSceneController;
- unsigned int mRendererRefCount;
+ ConnectionChangePropagator mConnectionObservers;
-public: // Properties
- AnimatableProperty<Vector3> mCenter;
- DoubleBufferedProperty<int> mGeometryType;
- DoubleBufferedProperty<bool> mRequiresDepthTest;
+ Geometry::GeometryType mGeometryType;
+ unsigned int mRendererRefCount;
+ bool mRequiresDepthTest;
};
inline void AddVertexBufferMessage( EventThreadServices& eventThreadServices , const Geometry& geometry, const Render::PropertyBuffer& vertexBuffer )
inline void SetGeometryTypeMessage( EventThreadServices& eventThreadServices, const Geometry& geometry, SceneGraph::Geometry::GeometryType geometryType )
{
- typedef MessageDoubleBuffered1< Geometry, SceneGraph::Geometry::GeometryType > LocalType;
+ typedef MessageValue1< Geometry, SceneGraph::Geometry::GeometryType > LocalType;
// Reserve some memory inside the message queue
unsigned int* slot = eventThreadServices.ReserveMessageSlot( sizeof( LocalType ) );
new (slot) LocalType( &geometry, &Geometry::SetGeometryType, geometryType );
}
+inline void SetGeometryRequiresDepthTestMessage( EventThreadServices& eventThreadServices, const Geometry& geometry, bool requiresDepthTest )
+{
+ typedef MessageValue1< Geometry, bool > 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( &geometry, &Geometry::SetRequiresDepthTest, requiresDepthTest );
+}
+
} // namespace SceneGraph
} // namespace Internal
} // namespace Dali
#include <dali/internal/update/common/property-boolean.h>
#include <dali/internal/update/common/uniform-map.h>
#include <dali/internal/update/common/scene-graph-connection-change-propagator.h>
-#include <dali/internal/render/data-providers/geometry-data-provider.h>
#include <dali/internal/render/data-providers/render-data-provider.h>
#include <dali/internal/render/renderers/render-new-renderer.h>
#include <dali/internal/update/resources/resource-manager.h>