From: Xiangyin Ma Date: Mon, 30 Nov 2015 17:47:38 +0000 (+0000) Subject: remove the duplicate properties from ColorRenderer and BorderRenderer X-Git-Tag: dali_1.1.13~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F99%2F52999%2F2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git remove the duplicate properties from ColorRenderer and BorderRenderer Change-Id: I7689ae4e97882061b09f643481115f6d1d6b6f29 --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp index 374ec6a..31ac725 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp @@ -297,7 +297,7 @@ int UtcDaliRendererFactoryGetColorRenderer1(void) Vector4 actualValue(Vector4::ZERO); TestGlAbstraction& gl = application.GetGlAbstraction(); - DALI_TEST_CHECK( gl.GetUniformValue( "uBlendColor", actualValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "blendColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION ); END_TEST; @@ -320,7 +320,7 @@ int UtcDaliRendererFactoryGetColorRenderer2(void) Vector4 actualValue(Vector4::ZERO); TestGlAbstraction& gl = application.GetGlAbstraction(); - DALI_TEST_CHECK( gl.GetUniformValue( "uBlendColor", actualValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "blendColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION ); controlRenderer.SetOffStage( actor ); @@ -361,11 +361,11 @@ int UtcDaliRendererFactoryGetBorderRenderer1(void) application.Render(0); Vector4 actualColor(Vector4::ZERO); - DALI_TEST_CHECK( gl.GetUniformValue( "uBorderColor", actualColor ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "borderColor", actualColor ) ); DALI_TEST_EQUALS( actualColor, testColor, TEST_LOCATION ); float actualSize = 0.f; - DALI_TEST_CHECK( gl.GetUniformValue( "uBorderSize", actualSize ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "borderSize", actualSize ) ); DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION ); controlRenderer.SetOffStage( actor ); @@ -402,11 +402,11 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void) application.Render(0); Vector4 actualColor(Vector4::ZERO); - DALI_TEST_CHECK( gl.GetUniformValue( "uBorderColor", actualColor ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "borderColor", actualColor ) ); DALI_TEST_EQUALS( actualColor, testColor, TEST_LOCATION ); float actualSize = 0.f; - DALI_TEST_CHECK( gl.GetUniformValue( "uBorderSize", actualSize ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "borderSize", actualSize ) ); DALI_TEST_EQUALS( actualSize, testSize, TEST_LOCATION ); END_TEST; @@ -820,13 +820,13 @@ int UtcDaliRendererFactoryResetRenderer1(void) Vector4 actualValue(Vector4::ZERO); TestGlAbstraction& gl = application.GetGlAbstraction(); - DALI_TEST_CHECK( gl.GetUniformValue( "uBlendColor", actualValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "blendColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION ); factory.ResetRenderer( controlRenderer, actor, Color::GREEN ); application.SendNotification(); application.Render(0); - DALI_TEST_CHECK( gl.GetUniformValue( "uBlendColor", actualValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "blendColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION ); Image bufferImage = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) ); @@ -880,7 +880,7 @@ int UtcDaliRendererFactoryResetRenderer2(void) application.SendNotification(); application.Render(0); Vector4 actualValue(Vector4::ZERO); - DALI_TEST_CHECK( gl.GetUniformValue( "uBlendColor", actualValue ) ); + DALI_TEST_CHECK( gl.GetUniformValue( "blendColor", actualValue ) ); DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION ); END_TEST; diff --git a/dali-toolkit/internal/controls/renderers/border/border-renderer.cpp b/dali-toolkit/internal/controls/renderers/border/border-renderer.cpp index 2192016..19872bd 100644 --- a/dali-toolkit/internal/controls/renderers/border/border-renderer.cpp +++ b/dali-toolkit/internal/controls/renderers/border/border-renderer.cpp @@ -41,9 +41,7 @@ const char * const RENDERER_TYPE("rendererType"); const char * const RENDERER_TYPE_VALUE("borderRenderer"); const char * const COLOR_NAME("borderColor"); -const char * const COLOR_UNIFORM_NAME("uBorderColor"); const char * const SIZE_NAME("borderSize"); -const char * const SIZE_UNIFORM_NAME("uBorderSize"); const char * const POSITION_ATTRIBUTE_NAME("aPosition"); const char * const DRIFT_ATTRIBUTE_NAME("aDrift"); @@ -55,22 +53,22 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aDrift;\n uniform mediump mat4 uMvpMatrix;\n uniform mediump vec3 uSize;\n - uniform mediump float uBorderSize;\n + uniform mediump float borderSize;\n \n void main()\n {\n - vec2 position = aPosition*uSize.xy + aDrift*uBorderSize;\n + vec2 position = aPosition*uSize.xy + aDrift*borderSize;\n gl_Position = uMvpMatrix * vec4(position, 0.0, 1.0);\n }\n ); const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( uniform lowp vec4 uColor;\n - uniform lowp vec4 uBorderColor;\n + uniform lowp vec4 borderColor;\n \n void main()\n {\n - gl_FragColor = uBorderColor*uColor;\n + gl_FragColor = borderColor*uColor;\n }\n ); } @@ -114,12 +112,12 @@ void BorderRenderer::DoSetOnStage( Actor& actor ) { InitializeRenderer(); - mBorderColorIndex = (mImpl->mRenderer).RegisterProperty( COLOR_UNIFORM_NAME, mBorderColor ); + mBorderColorIndex = (mImpl->mRenderer).RegisterProperty( COLOR_NAME, mBorderColor ); if( mBorderColor.a < 1.f ) { (mImpl->mRenderer).GetMaterial().SetBlendMode( BlendingMode::ON ); } - mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( SIZE_UNIFORM_NAME, mBorderSize ); + mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( SIZE_NAME, mBorderSize ); } void BorderRenderer::DoCreatePropertyMap( Property::Map& map ) const diff --git a/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp b/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp index b6074eb..c7e4ed5 100644 --- a/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp +++ b/dali-toolkit/internal/controls/renderers/color/color-renderer.cpp @@ -40,8 +40,6 @@ namespace const char * const RENDERER_TYPE("rendererType"); const char * const RENDERER_TYPE_VALUE("colorRenderer"); const char * const COLOR_NAME("blendColor"); -const char * const COLOR_UNIFORM_NAME("uBlendColor"); - const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( attribute mediump vec2 aPosition;\n @@ -58,11 +56,11 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER( const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER( uniform lowp vec4 uColor;\n - uniform lowp vec4 uBlendColor;\n + uniform lowp vec4 blendColor;\n \n void main()\n {\n - gl_FragColor = uBlendColor*uColor;\n + gl_FragColor = blendColor*uColor;\n }\n ); } @@ -136,7 +134,7 @@ void ColorRenderer::InitializeRenderer() Material material = Material::New( shader ); mImpl->mRenderer = Renderer::New( geometry, material ); - mBlendColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_UNIFORM_NAME, mBlendColor ); + mBlendColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mBlendColor ); if( mBlendColor.a < 1.f ) { mImpl->mRenderer.GetMaterial().SetBlendMode( BlendingMode::ON );