X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fcontrols%2Frenderers%2Fcolor%2Fcolor-renderer.cpp;h=c09f86fd69b4a8447741f4fc7345b65d1e6017a7;hb=54fbf47db890d0479d19d780de5ea5d860924632;hp=ddc41f55d2cafa4ffc791837865cf23e7f432f36;hpb=864042717041b6d9ad114b2e2f360f5f07c7682b;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp b/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp index ddc41f5..c09f86f 100644 --- a/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp +++ b/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp @@ -24,6 +24,7 @@ //INTERNAL INCLUDES #include #include +#include #include namespace Dali @@ -37,9 +38,7 @@ namespace Internal namespace { -const char * const RENDERER_TYPE("rendererType"); -const char * const RENDERER_TYPE_VALUE("color"); -const char * const COLOR_NAME("blendColor"); +const char * const COLOR_NAME("mixColor"); const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n @@ -56,18 +55,18 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( uniform lowp vec4 uColor;\n - uniform lowp vec4 blendColor;\n + uniform lowp vec4 mixColor;\n \n void main()\n {\n - gl_FragColor = blendColor*uColor;\n + gl_FragColor = mixColor*uColor;\n }\n ); } ColorRenderer::ColorRenderer( RendererFactoryCache& factoryCache ) : ControlRenderer( factoryCache ), - mBlendColorIndex( Property::INVALID_INDEX ) + mMixColorIndex( Property::INVALID_INDEX ) { } @@ -78,7 +77,7 @@ ColorRenderer::~ColorRenderer() void ColorRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap ) { Property::Value* color = propertyMap.Find( COLOR_NAME ); - if( !( color && color->Get(mBlendColor) ) ) + if( !( color && color->Get(mMixColor) ) ) { DALI_LOG_ERROR( "Fail to provide a color to the ColorRenderer object" ); } @@ -111,8 +110,8 @@ void ColorRenderer::DoSetOnStage( Actor& actor ) void ColorRenderer::DoCreatePropertyMap( Property::Map& map ) const { map.Clear(); - map.Insert( RENDERER_TYPE, RENDERER_TYPE_VALUE ); - map.Insert( COLOR_NAME, mBlendColor ); + map.Insert( RENDERER_TYPE, COLOR_RENDERER ); + map.Insert( COLOR_NAME, mMixColor ); } void ColorRenderer::InitializeRenderer() @@ -131,26 +130,25 @@ void ColorRenderer::InitializeRenderer() mFactoryCache.SaveShader( RendererFactoryCache::COLOR_SHADER, shader ); } - Material material = Material::New( shader ); - mImpl->mRenderer = Renderer::New( geometry, material ); + mImpl->mRenderer = Renderer::New( geometry, shader ); - mBlendColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mBlendColor ); - if( mBlendColor.a < 1.f ) + mMixColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mMixColor ); + if( mMixColor.a < 1.f ) { - mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON ); + mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON ); } } void ColorRenderer::SetColor(const Vector4& color) { - mBlendColor = color; + mMixColor = color; if( mImpl->mRenderer ) { - (mImpl->mRenderer).SetProperty( mBlendColorIndex, color ); + (mImpl->mRenderer).SetProperty( mMixColorIndex, color ); if( color.a < 1.f ) { - mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON ); + mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON ); } } }