X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali-toolkit%2Finternal%2Fvisuals%2Fgradient%2Fgradient-visual.cpp;h=b75b3596e2cd8767ef9cb7ac99bd6e14d5a281b1;hb=c1df31569e5f3e30a3b35c960d88c3252880af81;hp=80c899fc67317ec7b4afbe68906510cda38a336d;hpb=fb545906ceea3a2946c8a451f34ea7da283c4ffe;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp index 80c899f..b75b359 100644 --- a/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp +++ b/dali-toolkit/internal/visuals/gradient/gradient-visual.cpp @@ -172,11 +172,13 @@ const char* FRAGMENT_SHADER[] = DALI_COMPOSE_SHADER( uniform sampler2D sTexture;\n // sampler1D? uniform lowp vec4 uColor;\n + uniform lowp vec3 mixColor;\n + uniform lowp float opacity;\n varying mediump vec2 vTexCoord;\n \n void main()\n {\n - gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * uColor;\n + gl_FragColor = texture2D( sTexture, vec2( vTexCoord.y, 0.5 ) ) * vec4(mixColor*opacity, opacity) * uColor;\n }\n ), @@ -184,11 +186,13 @@ DALI_COMPOSE_SHADER( DALI_COMPOSE_SHADER( uniform sampler2D sTexture;\n // sampler1D? uniform lowp vec4 uColor;\n + uniform lowp vec3 mixColor;\n + uniform lowp float opacity;\n varying mediump vec2 vTexCoord;\n \n void main()\n {\n - gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * uColor;\n + gl_FragColor = texture2D( sTexture, vec2( length(vTexCoord), 0.5 ) ) * vec4(mixColor*opacity, opacity) * uColor;\n }\n ) }; @@ -274,6 +278,9 @@ void GradientVisual::DoSetOnStage( Actor& actor ) InitializeRenderer(); actor.AddRenderer( mImpl->mRenderer ); + + // Gradient Visual generated and ready to display + ResourceReady(); } void GradientVisual::DoCreatePropertyMap( Property::Map& map ) const @@ -319,14 +326,14 @@ void GradientVisual::DoCreatePropertyMap( Property::Map& map ) const } } +void GradientVisual::DoCreateInstancePropertyMap( Property::Map& map ) const +{ + // Do nothing +} + void GradientVisual::InitializeRenderer() { Geometry geometry = mFactoryCache.GetGeometry( VisualFactoryCache::QUAD_GEOMETRY ); - if( !geometry ) - { - geometry = VisualFactoryCache::CreateQuadGeometry(); - mFactoryCache.SaveGeometry( VisualFactoryCache::QUAD_GEOMETRY, geometry ); - } Toolkit::GradientVisual::Units::Type gradientUnits = mGradient->GetGradientUnits(); VisualFactoryCache::ShaderType shaderType = GetShaderType( mGradientType, gradientUnits );