// INTERNAL INCLUDES
#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
#include <dali-toolkit/devel-api/controls/renderer-factory/control-renderer.h>
+#include <dali-toolkit/internal/controls/renderers/renderer-factory-cache.h>
namespace Dali
{
namespace Internal
{
-class RendererFactoryCache;
-
/**
* Base class for all Control rendering logic. A control may have multiple control renderers.
*
*
* The following properties are optional
*
- * | %Property Name | Type |
- * |---------------------------|------------------|
- * | custom-shader | MAP |
+ * | %Property Name | Type |
+ * |-------------------------|------------------|
+ * | customShader | MAP |
*
* where custom-shader is a map with the following properties:
- * | %Property Name | Type |
- * |---------------------------|------------------|
- * | vertex-shader | STRING |
- * | fragment-shader | STRING |
- * | subdivide-grid-x | INT |
- * | subdivide-grid-y | INT |
- * | shader-hints | INT |
+ * | %Property Name | Type |
+ * |-------------------------|------------------|
+ * | vertexShader | STRING |
+ * | fragmentShader | STRING |
+ * | subdivideGridX | INT |
+ * | subdivideGridY | INT |
+ * | shaderHints | INT |
*/
class ControlRenderer : public BaseObject
{
* request the geometry and shader from the cache, if not available, create and save to the cache for sharing;
* record the property values.
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
* @param[in] propertyMap The properties for the requested ControlRenderer object.
*/
- void Initialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap );
+ void Initialize( Actor& actor, const Property::Map& propertyMap );
/**
* @copydoc Toolkit::ControlRenderer::SetSize
/**
* @brief Constructor.
+ *
+ * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
*/
- ControlRenderer();
+ ControlRenderer( RendererFactoryCache& factoryCache );
/**
* @brief A reference counted object may only be deleted by calling Unreference().
/**
* @brief Called by Initialize() allowing sub classes to respond to the Initialize event
*
- * @param[in] factoryCache A pointer pointing to the RendererFactoryCache object
+ * @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
* @param[in] propertyMap The properties for the requested ControlRenderer object.
*/
- virtual void DoInitialize( RendererFactoryCache& factoryCache, const Property::Map& propertyMap ) = 0;
+ virtual void DoInitialize( Actor& actor, const Property::Map& propertyMap ) = 0;
protected:
*/
virtual void DoSetOffStage( Actor& actor );
+protected:
+ /**
+ * @brief Gets the on stage state for this ControlRenderer
+ *
+ * @return Returns true if this ControlRenderer is on stage, false if it is off the stage
+ */
+ bool GetIsOnStage() const;
+
+ /**
+ * @brief Gets whether the Dali::Renderer is from a shared cache (and therefore any modifications will affect other users of that renderer)
+ *
+ * @return Returns true if the renderer is from shared cache, false otherwise
+ */
+ bool GetIsFromCache() const;
+
private:
// Undefined
protected:
struct Impl;
Impl* mImpl;
+ RendererFactoryCache& mFactoryCache;
};
} // namespace Internal