X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fupdate%2Frendering%2Fscene-graph-renderer.h;h=610b8ce746d6a6fd263ecddbfa9aad46afc17151;hb=fcf315492ce0089cabd64c6b0344b6d41e31f3df;hp=d714a860d0fd8d9dcb3012d4fb3c1a468fdbaf2b;hpb=2e0f2ef705bf0035100cc94dcc53ea8768a1c93a;p=platform%2Fcore%2Fuifw%2Fdali-core.git diff --git a/dali/internal/update/rendering/scene-graph-renderer.h b/dali/internal/update/rendering/scene-graph-renderer.h index d714a86..610b8ce 100644 --- a/dali/internal/update/rendering/scene-graph-renderer.h +++ b/dali/internal/update/rendering/scene-graph-renderer.h @@ -20,17 +20,10 @@ #include #include -#include -#include -#include #include -#include #include #include -#include #include -#include -#include namespace Dali { @@ -39,11 +32,12 @@ namespace Internal namespace Render { -class NewRenderer; +class Renderer; } namespace SceneGraph { +class SceneController; class Renderer; typedef Dali::Vector< Renderer* > RendererContainer; @@ -60,10 +54,17 @@ class Renderer : public PropertyOwner, { public: + enum Opacity + { + OPAQUE, + TRANSPARENT, + TRANSLUCENT + }; + /** - * Default constructor + * Construct a new Renderer */ - Renderer(); + static Renderer* New(); /** * Destructor @@ -71,6 +72,12 @@ public: virtual ~Renderer(); /** + * Overriden delete operator + * Deletes the renderer from its global memory pool + */ + void operator delete( void* ptr ); + + /** * Set the material for the renderer * @param[in] bufferIndex The current frame's buffer index * @param[in] material The material this renderer will use @@ -141,28 +148,22 @@ public: Render::Renderer& GetRenderer(); /** - * 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. - * @param[in] resourceManager The resource manager. - */ - void PrepareResources( BufferIndex updateBufferIndex, ResourceManager& resourceManager ); - - /** * Check whether the renderer has been marked as ready to render + * ready means that renderer has all resources and should produce correct result + * complete means all resources have finished loading + * It's possible that renderer is complete but not ready, + * for example in case of resource load failed * @param[out] ready TRUE if the renderer has resources to render * @param[out] complete TRUE if the renderer resources are complete - * (e.g. image has finished loading, framebuffer is ready to render, native image - * framebuffer has been rendered) */ - void GetReadyAndComplete(bool& ready, bool& complete) const; + void GetReadyAndComplete( bool& ready, bool& complete ) const; /** - * Query whether the renderer is fully opaque. + * Query whether the renderer is fully opaque, fully transparent or transparent. * @param[in] updateBufferIndex The current update buffer index. - * @return True if fully opaque. + * @return OPAQUE if fully opaque, TRANSPARENT if fully transparent and TRANSLUCENT if in between */ - bool IsFullyOpaque( BufferIndex updateBufferIndex, const Node& node ) const; + Opacity GetOpacity( BufferIndex updateBufferIndex, const Node& node ) const; /** * Query whether the renderer is currently in use by an actor on the stage @@ -247,27 +248,29 @@ public: // From UniformMapDataProvider private: /** + * Protected constructor; See also Renderer::New() + */ + Renderer(); + + /** * Helper function to create a new render data provider * @return the new (initialized) data provider */ RenderDataProvider* NewRenderDataProvider(); SceneController* mSceneController; ///< Used for initializing renderers whilst attached - Render::NewRenderer* mRenderer; ///< Raw pointer to the new renderer (that's owned by RenderManager) + Render::Renderer* mRenderer; ///< Raw pointer to the new renderer (that's owned by RenderManager) Material* mMaterial; ///< The material this renderer uses. (Not owned) Geometry* mGeometry; ///< The geometry this renderer uses. (Not owned) - Dali::Vector< Integration::ResourceId > mTrackedResources; ///< Filled during PrepareResources if there are uncomplete, tracked resources. - - CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps collected by the renderer - unsigned int mReferenceCount; ///< Number of nodes currently using this renderer - unsigned int mRegenerateUniformMap; ///< 2 if the map should be regenerated, 1 if it should be copied. - bool mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame - bool mResendDataProviders : 1; ///< True if the data providers should be resent to the renderer - bool mResendGeometry : 1; ///< True if geometry should be resent to the renderer - bool mHasUntrackedResources : 1; ///< Set during PrepareResources, true if have tried to follow untracked resources - bool mFinishedResourceAcquisition : 1; ///< Set during DoPrepareResources; true if ready & all resource acquisition has finished (successfully or otherwise) - bool mResourcesReady : 1; ///< Set during the Update algorithm; true if the attachment has resources ready for the current frame. + CollectedUniformMap mCollectedUniformMap[2]; ///< Uniform maps collected by the renderer + unsigned int mReferenceCount; ///< Number of nodes currently using this renderer + unsigned int mRegenerateUniformMap; ///< 2 if the map should be regenerated, 1 if it should be copied. + bool mUniformMapChanged[2]; ///< Records if the uniform map has been altered this frame + bool mResendDataProviders; ///< True if the data providers should be resent to the renderer + bool mResendGeometry; ///< True if geometry should be resent to the renderer + bool mResourcesReady; ///< Set during the Update algorithm; true if the attachment has resources ready for the current frame. + bool mFinishedResourceAcquisition; ///< Set during DoPrepareResources; true if ready & all resource acquisition has finished (successfully or otherwise) public: int mDepthIndex; ///< Used only in PrepareRenderInstructions