Reverting DebugVisual back to DebugRenderer
Changing some parameters from renderer to visual
Change-Id: I9a64930d79c57a3d684cebc0497846dba6d4c76c
16 files changed:
- * The renderer which renders a solid color to the control's quad border fixed to a specified size.
+ * The visual which renders a solid color to the control's quad border fixed to a specified size.
*
* The following properties are required for create a BorderRender
*
*
* The following properties are required for create a BorderRender
*
- * The renderer which renders a solid color to the control's quad
+ * The visual which renders a solid color to the control's quad
*
* The following properties are required for create a ColorRender
*
*
* The following properties are required for create a ColorRender
*
void DebugVisual::InitializeRenderer()
{
void DebugVisual::InitializeRenderer()
{
- mImpl->mRenderer = mFactoryCache.GetDebugVisual();
+ mImpl->mRenderer = mFactoryCache.GetDebugRenderer();
if( !mImpl->mRenderer )
{
Geometry geometry = CreateQuadWireframeGeometry();
Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mImpl->mRenderer = Renderer::New( geometry, shader);
if( !mImpl->mRenderer )
{
Geometry geometry = CreateQuadWireframeGeometry();
Shader shader = Shader::New( VERTEX_SHADER, FRAGMENT_SHADER );
mImpl->mRenderer = Renderer::New( geometry, shader);
- mFactoryCache.CacheDebugVisual( mImpl->mRenderer );
+ mFactoryCache.CacheDebugRenderer( mImpl->mRenderer );
- * The renderer which renders a wireframe outline to the control's quad for debugging
+ * The visual which renders a wireframe outline to the control's quad for debugging
*
*/
class DebugVisual: public Visual
*
*/
class DebugVisual: public Visual
- DebugVisual( const DebugVisual& debugRenderer );
+ DebugVisual( const DebugVisual& debugVisual);
- DebugVisual& operator=( const DebugVisual& debugRenderer );
+ DebugVisual& operator=( const DebugVisual& debugVisual );
- * The renderer which renders smooth transition of colors to the control's quad.
+ * The visual which renders smooth transition of colors to the control's quad.
* It supports two types of gradients: linear and radial.
*
* The following properties are essential for create a LINEAR GradientRender
* It supports two types of gradients: linear and radial.
*
* The following properties are essential for create a LINEAR GradientRender
static void GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);
// Undefined
static void GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);
// Undefined
- GradientVisual( const GradientVisual& gradientRenderer );
+ GradientVisual( const GradientVisual& gradientVisual );
- GradientVisual& operator=( const GradientVisual& gradientRenderer );
+ GradientVisual& operator=( const GradientVisual& gradientVisual );
// Renderer can't be shared between NativeImage and other image types.
if( !mNativeFragmentShaderCode.empty() )
{
// Renderer can't be shared between NativeImage and other image types.
if( !mNativeFragmentShaderCode.empty() )
{
- return CreateNativeImageVisual();
+ return CreateNativeImageRenderer();
}
if( !mImpl->mCustomShader )
}
if( !mImpl->mCustomShader )
-Renderer ImageVisual::CreateNativeImageVisual() const
+Renderer ImageVisual::CreateNativeImageRenderer() const
{
Geometry geometry;
Shader shader;
{
Geometry geometry;
Shader shader;
typedef IntrusivePtr< ImageVisual > ImageVisualPtr;
/**
typedef IntrusivePtr< ImageVisual > ImageVisualPtr;
/**
- * The renderer which renders an image to the control's quad
+ * The visual which renders an image to the control's quad
*
* The following properties are optional
*
*
* The following properties are optional
*
static Shader GetImageShader( VisualFactoryCache& factoryCache );
/**
static Shader GetImageShader( VisualFactoryCache& factoryCache );
/**
- * @brief Sets the image of this renderer to the resource at imageUrl
- * The renderer will load the Image asynchronously when the associated actor is put on stage, and destroy the image when it is off stage
+ * @brief Sets the image of this visual to the resource at imageUrl
+ * The visual will load the Image asynchronously when the associated actor is put on stage, and destroy the image when it is off stage
*
* @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
* @param[in] imageUrl The URL of the image resource to use
*
* @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
* @param[in] imageUrl The URL of the image resource to use
Dali::SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR );
/**
Dali::SamplingMode::Type samplingMode = SamplingMode::BOX_THEN_LINEAR );
/**
- * @brief Sets the image of this renderer to use
+ * @brief Sets the image to be rendered by this visual
*
* @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
* @param[in] image The image to use
*
* @param[in] actor The Actor the renderer is applied to if, empty if the renderer has not been applied to any Actor
* @param[in] image The image to use
*
* @return Returns the created Dali::Renderer
*/
*
* @return Returns the created Dali::Renderer
*/
- Renderer CreateNativeImageVisual() const;
+ Renderer CreateNativeImageRenderer() const;
/**
* @brief Query whether resources requires to be loaded synchronously.
/**
* @brief Query whether resources requires to be loaded synchronously.
mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER );
mImpl->mRenderer = Renderer::New( mGeometry, mShader );
mShader = Shader::New( SIMPLE_VERTEX_SHADER, SIMPLE_FRAGMENT_SHADER );
mImpl->mRenderer = Renderer::New( mGeometry, mShader );
- DALI_LOG_ERROR( "Initialisation error in mesh renderer.\n" );
+ DALI_LOG_ERROR( "Initialisation error in mesh visual.\n" );
}
void MeshVisual::UpdateShaderUniforms()
}
void MeshVisual::UpdateShaderUniforms()
- DALI_LOG_ERROR( "Failed to load geometry in mesh renderer.\n" );
+ DALI_LOG_ERROR( "Failed to load geometry in mesh visual.\n" );
- DALI_LOG_ERROR( "Failed to find object to load in mesh renderer.\n" );
+ DALI_LOG_ERROR( "Failed to find object to load in mesh visual.\n" );
- DALI_LOG_ERROR( "Failed to find texture set to load in mesh renderer.\n" );
+ DALI_LOG_ERROR( "Failed to find texture set to load in mesh visual.\n" );
mUseTexture = false;
return false;
}
mUseTexture = false;
return false;
}
- DALI_LOG_ERROR( "Failed to load diffuse map texture in mesh renderer.\n");
+ DALI_LOG_ERROR( "Failed to load diffuse map texture in mesh visual.\n");
- DALI_LOG_ERROR( "Failed to load normal map texture in mesh renderer.\n");
+ DALI_LOG_ERROR( "Failed to load normal map texture in mesh visual.\n");
- DALI_LOG_ERROR( "Failed to load gloss map texture in mesh renderer.\n");
+ DALI_LOG_ERROR( "Failed to load gloss map texture in mesh visual.\n");
- * The renderer which renders a 3D object to the control's quad
+ * The visual which renders a 3D object to the control's quad
- * The following Property::Map keys are required to create a MeshRender
+ * The following Property::Map keys are required to create a MeshVisual
*
* | %Property Name | Type | Representing |
* |-----------------|-------------|-----------------------------------------------------------------------|
*
* | %Property Name | Type | Representing |
* |-----------------|-------------|-----------------------------------------------------------------------|
- //Corresponds to the shader that will be used by the mesh renderer.
+ //Corresponds to the shader that will be used by the mesh visual.
enum ShaderType
{
TEXTURELESS,
enum ShaderType
{
TEXTURELESS,
- * @brief Provide an empty geometry for the renderer to use.
+ * @brief Provide an empty geometry for the visual to use.
* @details For use in error cases where the initialisation has failed for varying reasons.
*/
void SupplyEmptyGeometry();
/**
* @details For use in error cases where the initialisation has failed for varying reasons.
*/
void SupplyEmptyGeometry();
/**
- * @brief Initialize the renderer with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
+ * @brief Initialize the visual with the geometry and shader from the cache, if not available, create and save to the cache for sharing.
*/
void InitializeRenderer();
*/
void InitializeRenderer();
void UpdateShaderUniforms();
/**
void UpdateShaderUniforms();
/**
- * @brief Use the object URL stored in the renderer to load and create the geometry of the object.
+ * @brief Use the object URL stored in the mesh visual to load and create the geometry of the object.
* @return Boolean of success of operation.
*/
bool CreateGeometry();
/**
* @return Boolean of success of operation.
*/
bool CreateGeometry();
/**
- * @brief Use the object URL stored in the renderer to load the geometry of the object.
+ * @brief Use the object URL stored in the visual to load the geometry of the object.
* @return Boolean of success of operation.
*/
bool LoadGeometry();
/**
* @return Boolean of success of operation.
*/
bool LoadGeometry();
/**
- * @brief Use the material URL stored in the renderer to load the material of the object.
+ * @brief Use the material URL stored in the mesh visual to load the material of the object.
* @return Boolean of success of operation.
*/
bool LoadMaterial();
* @return Boolean of success of operation.
*/
bool LoadMaterial();
- MeshVisual( const MeshVisual& meshRenderer );
+ MeshVisual( const MeshVisual& meshVisual );
- MeshVisual& operator=( const MeshVisual& meshRenderer );
+ MeshVisual& operator=( const MeshVisual& meshVisual );
- * The renderer which renders an 9 patch image to the control's quad
+ * The visual which renders an 9 patch image to the control's quad
*
* The following properties are optional
*
*
* The following properties are optional
*
- * @brief Sets the 9 patch image of this renderer to the resource at imageUrl
- * The renderer will load the image synchronously when the associated actor is put on stage, and destroy the image when it is off stage
+ * @brief Sets the 9 patch image of this visual to the resource at imageUrl
+ * The visual will load the image synchronously when the associated actor is put on stage, and destroy the image when it is off stage
*
* @param[in] imageUrl The URL to 9 patch image resource to use
* @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
*
* @param[in] imageUrl The URL to 9 patch image resource to use
* @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
void SetImage( const std::string& imageUrl, bool borderOnly = false );
/**
void SetImage( const std::string& imageUrl, bool borderOnly = false );
/**
- * @brief Sets the 9 patch image of this renderer to the 9 patch image
+ * @brief Sets the 9 patch image of this viusal to the 9 patch image
*
* @param[in] image The NinePatchImage to use
* @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
*
* @param[in] image The NinePatchImage to use
* @param[in] borderOnly A Flag to indicate if the image should omit the centre of the n-patch and only render the border
- NinePatchImage mImage; ///< The image to render if the renderer was set from an NinePatchImage, empty otherwise
+ NinePatchImage mImage; ///< The image to render if the visual was set from an NinePatchImage, empty otherwise
- std::string mImageUrl; ///< The url to the image resource to render if the renderer was set from an image resource url, empty otherwise
+ std::string mImageUrl; ///< The url to the image resource to render if the visual was set from an image resource url, empty otherwise
NinePatchImage::StretchRanges mStretchPixelsX;
NinePatchImage::StretchRanges mStretchPixelsY;
ImageDimensions mImageSize;
NinePatchImage::StretchRanges mStretchPixelsX;
NinePatchImage::StretchRanges mStretchPixelsY;
ImageDimensions mImageSize;
- * The renderer which renders a simple 3D shape to the control's quad
+ * The visual which renders a simple 3D shape to the control's quad
*
* The following properties are required to create a PrimitiveRender
*
*
* The following properties are required to create a PrimitiveRender
*
*
* Note: slices and stacks both have an upper limit of 255.
*
*
* Note: slices and stacks both have an upper limit of 255.
*
- * Finally, the following can be used to affect the renderer's shader
+ * Finally, the following can be used to affect the visual's shader
*
* | %Property Name | Type | Representing |
* |-----------------|-------------|-----------------------------------------|
*
* | %Property Name | Type | Representing |
* |-----------------|-------------|-----------------------------------------|
-void SvgRasterizeThread::RemoveTask( SvgVisual* renderer )
+void SvgRasterizeThread::RemoveTask( SvgVisual* visual )
{
// Lock while remove task from the queue
ConditionalWait::ScopedLock lock( mConditionalWait );
{
// Lock while remove task from the queue
ConditionalWait::ScopedLock lock( mConditionalWait );
{
for( std::vector< RasterizingTaskPtr >::iterator it = mRasterizeTasks.begin(), endIt = mRasterizeTasks.end(); it != endIt; ++it )
{
{
for( std::vector< RasterizingTaskPtr >::iterator it = mRasterizeTasks.begin(), endIt = mRasterizeTasks.end(); it != endIt; ++it )
{
- if( (*it) && (*it)->GetSvgVisual() == renderer )
+ if( (*it) && (*it)->GetSvgVisual() == visual )
{
mRasterizeTasks.erase( it );
break;
{
mRasterizeTasks.erase( it );
break;
* 1. Created by SvgVisual in the main thread
* 2. Queued in the worked thread waiting to be processed.
* 3. If this task gets its turn to do the rasterization, it triggers main thread to apply the rasterized image to material then been deleted in main thread call back
* 1. Created by SvgVisual in the main thread
* 2. Queued in the worked thread waiting to be processed.
* 3. If this task gets its turn to do the rasterization, it triggers main thread to apply the rasterized image to material then been deleted in main thread call back
- * Or if this task is been removed ( new image/size set to the renderer or actor off stage) before its turn to be processed, it then been deleted in the worker thread.
+ * Or if this task is been removed ( new image/size set to the visual or actor off stage) before its turn to be processed, it then been deleted in the worker thread.
*/
class RasterizingTask : public RefObject
{
*/
class RasterizingTask : public RefObject
{
void Rasterize( NSVGrasterizer* rasterizer );
/**
void Rasterize( NSVGrasterizer* rasterizer );
/**
*/
SvgVisual* GetSvgVisual() const;
*/
SvgVisual* GetSvgVisual() const;
RasterizingTaskPtr NextCompletedTask();
/**
RasterizingTaskPtr NextCompletedTask();
/**
- * Remove the task with the given renderer from the waiting queue, called by main thread.
+ * Remove the task with the given visual from the waiting queue, called by main thread.
*
* Typically called when the actor is put off stage, so the renderer is not needed anymore.
*
*
* Typically called when the actor is put off stage, so the renderer is not needed anymore.
*
- * @param[in] renderer The renderer pointer.
+ * @param[in] visual The visual pointer.
- void RemoveTask( SvgVisual* renderer );
+ void RemoveTask( SvgVisual* visual );
/**
* Delete the parsed SVG image, called by main thread.
/**
* Delete the parsed SVG image, called by main thread.
- * The renderer which renders a svg image
+ * The visual which renders a svg image
*
* The following property is essential
*
*
* The following property is essential
*
static bool IsSvgUrl( const std::string& url );
/**
static bool IsSvgUrl( const std::string& url );
/**
- * @brief Sets the svg image of this renderer to the resource at imageUrl
- * The renderer will parse the svg image once it is set.
+ * @brief Sets the svg image of this visual to the resource at imageUrl
+ * The visual will parse the svg image once it is set.
* And rasterize it into BufferImage synchronously when the associated actor is put on stage, and destroy the BufferImage when it is off stage
*
* @param[in] imageUrl The URL to svg resource to use
* And rasterize it into BufferImage synchronously when the associated actor is put on stage, and destroy the BufferImage when it is off stage
*
* @param[in] imageUrl The URL to svg resource to use
void SetImage( const std::string& imageUrl, ImageDimensions size = ImageDimensions() );
/**
void SetImage( const std::string& imageUrl, ImageDimensions size = ImageDimensions() );
/**
- * @bried Apply the rasterized image to the renderer.
+ * @bried Apply the rasterized image to the visual.
*
* @param[in] rasterizedPixelData The pixel buffer with the rasterized pixels
*/
*
* @param[in] rasterizedPixelData The pixel buffer with the rasterized pixels
*/
- * @bried Rasterize the svg with the given size, and add it to the renderer.
+ * @bried Rasterize the svg with the given size, and add it to the visual.
*
* @param[in] size The target size of the SVG rasterization.
*/
*
* @param[in] size The target size of the SVG rasterization.
*/
-void VisualFactoryCache::CacheDebugVisual( Renderer& renderer )
+void VisualFactoryCache::CacheDebugRenderer( Renderer& renderer )
- mDebugVisual = renderer;
+ mDebugRenderer = renderer;
-Renderer VisualFactoryCache::GetDebugVisual()
+Renderer VisualFactoryCache::GetDebugRenderer()
}
Geometry VisualFactoryCache::CreateQuadGeometry()
}
Geometry VisualFactoryCache::CreateQuadGeometry()
/**
* @brief Cache the debug renderer
*/
/**
* @brief Cache the debug renderer
*/
- void CacheDebugVisual( Renderer& renderer );
+ void CacheDebugRenderer( Renderer& renderer );
/**
* @brief Request the debug renderer;
*/
/**
* @brief Request the debug renderer;
*/
- Renderer GetDebugVisual();
+ Renderer GetDebugRenderer();
/**
* Get the SVG rasterization thread.
/**
* Get the SVG rasterization thread.
HashVector mRendererHashes;
CachedRenderers mRenderers;
HashVector mRendererHashes;
CachedRenderers mRenderers;
+ Renderer mDebugRenderer;
SvgRasterizeThread* mSvgRasterizeThread;
};
SvgRasterizeThread* mSvgRasterizeThread;
};