From: Andrew Poor Date: Tue, 30 Aug 2016 14:18:13 +0000 (+0100) Subject: Rename color property of primitive visual to mixColor. X-Git-Tag: dali_1.2.4~7 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F22%2F86122%2F2;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git Rename color property of primitive visual to mixColor. Change-Id: Icc27efb2752733bdbcd23f1b9eaa51e18df6033b --- diff --git a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp index b061cf1..6de8e23 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp @@ -744,7 +744,7 @@ int UtcDaliVisualGetPropertyMap9(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, color ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, color ); propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 ); propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f ); @@ -769,7 +769,7 @@ int UtcDaliVisualGetPropertyMap9(void) DALI_TEST_CHECK( value ); DALI_TEST_EQUALS( value->Get(), (int)PrimitiveVisual::Shape::CUBE, TEST_LOCATION ); - value = resultMap.Find( PrimitiveVisual::Property::COLOR, Property::VECTOR4 ); + value = resultMap.Find( PrimitiveVisual::Property::MIX_COLOR, Property::VECTOR4 ); DALI_TEST_CHECK( value ); DALI_TEST_CHECK( value->Get() == color ); DALI_TEST_EQUALS( value->Get(), color, Math::MACHINE_EPSILON_100, TEST_LOCATION ); @@ -1043,7 +1043,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void) DALI_TEST_EQUALS( actor.GetRendererCount(), 1u, TEST_LOCATION); Renderer renderer = actor.GetRendererAt(0); - Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::COLOR ); + Property::Index index = renderer.GetPropertyIndex( PrimitiveVisual::Property::MIX_COLOR ); // The property isn't registered on the renderer, it's instead registered on the shader. DALI_TEST_EQUALS( index, Property::INVALID_INDEX, TEST_LOCATION ); diff --git a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp index 79b2f69..670a586 100644 --- a/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp +++ b/automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp @@ -1531,7 +1531,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual2(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CUBE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 ); propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f ); @@ -1560,7 +1560,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual3(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); propertyMap.Insert( PrimitiveVisual::Property::STACKS, 20 ); @@ -1582,7 +1582,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual4(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONICAL_FRUSTRUM ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f ); propertyMap.Insert( PrimitiveVisual::Property::SCALE_BOTTOM_RADIUS, 40.0f ); @@ -1606,7 +1606,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual5(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::BEVELLED_CUBE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); propertyMap.Insert( PrimitiveVisual::Property::BEVEL_PERCENTAGE, 0.7f ); //Test to see if shape loads correctly. @@ -1627,7 +1627,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual6(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::OCTAHEDRON ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); //Test to see if shape loads correctly. TestPrimitiveVisualWithProperties( propertyMap, application ); @@ -1647,7 +1647,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual7(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::CONE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); propertyMap.Insert( PrimitiveVisual::Property::SLICES, 10 ); propertyMap.Insert( PrimitiveVisual::Property::SCALE_TOP_RADIUS, 30.0f ); propertyMap.Insert( PrimitiveVisual::Property::SCALE_HEIGHT, 50.0f ); @@ -1670,7 +1670,7 @@ int UtcDaliVisualFactoryGetPrimitiveVisual8(void) Property::Map propertyMap; propertyMap.Insert( Visual::Property::TYPE, Visual::PRIMITIVE ); propertyMap.Insert( PrimitiveVisual::Property::SHAPE, PrimitiveVisual::Shape::SPHERE ); - propertyMap.Insert( PrimitiveVisual::Property::COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); + propertyMap.Insert( PrimitiveVisual::Property::MIX_COLOR, Vector4( 0.5, 0.5, 0.5, 1.0 ) ); propertyMap.Insert( MeshVisual::Property::LIGHT_POSITION, Vector3( 0.0, 1.0, 2.0 ) ); //Test to see if shape loads correctly. diff --git a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp index 1955db5..a7aaaae 100644 --- a/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp +++ b/dali-toolkit/internal/visuals/primitive/primitive-visual.cpp @@ -53,7 +53,7 @@ DALI_ENUM_TO_STRING_TABLE_END( SHAPE_TYPE ) //Property names const char * const PRIMITIVE_SHAPE( "shape" ); -const char * const SHAPE_COLOR( "shapeColor" ); +const char * const SHAPE_COLOR( "mixColor" ); const char * const SLICES( "slices" ); const char * const STACKS( "stacks" ); const char * const SCALE_TOP_RADIUS( "scaleTopRadius" ); @@ -195,7 +195,7 @@ void PrimitiveVisual::DoInitialize( Actor& actor, const Property::Map& propertyM //Read in other potential properties. - Property::Value* color = propertyMap.Find( Toolkit::PrimitiveVisual::Property::COLOR, SHAPE_COLOR ); + Property::Value* color = propertyMap.Find( Toolkit::PrimitiveVisual::Property::MIX_COLOR, SHAPE_COLOR ); if( color && !color->Get( mColor ) ) { DALI_LOG_ERROR( "Invalid type for color in PrimitiveVisual.\n" ); @@ -377,7 +377,7 @@ void PrimitiveVisual::DoCreatePropertyMap( Property::Map& map ) const map.Clear(); map.Insert( Toolkit::Visual::Property::TYPE, Toolkit::Visual::PRIMITIVE ); map.Insert( Toolkit::PrimitiveVisual::Property::SHAPE, mPrimitiveType ); - map.Insert( Toolkit::PrimitiveVisual::Property::COLOR, mColor ); + map.Insert( Toolkit::PrimitiveVisual::Property::MIX_COLOR, mColor ); map.Insert( Toolkit::PrimitiveVisual::Property::SLICES, mSlices ); map.Insert( Toolkit::PrimitiveVisual::Property::STACKS, mStacks ); map.Insert( Toolkit::PrimitiveVisual::Property::SCALE_TOP_RADIUS, mScaleTopRadius ); @@ -419,7 +419,7 @@ void PrimitiveVisual::UpdateShaderUniforms() mShader.RegisterProperty( STAGE_OFFSET_UNIFORM_NAME, Vector2( width, height ) / 2.0f ); mShader.RegisterProperty( LIGHT_POSITION_UNIFORM_NAME, mLightPosition ); mShader.RegisterProperty( OBJECT_MATRIX_UNIFORM_NAME, scaleMatrix ); - mShader.RegisterProperty( Toolkit::PrimitiveVisual::Property::COLOR, COLOR_UNIFORM_NAME, mColor ); + mShader.RegisterProperty( Toolkit::PrimitiveVisual::Property::MIX_COLOR, COLOR_UNIFORM_NAME, mColor ); mShader.RegisterProperty( OBJECT_DIMENSIONS_UNIFORM_NAME, mObjectDimensions ); } diff --git a/dali-toolkit/public-api/visuals/primitive-visual-properties.h b/dali-toolkit/public-api/visuals/primitive-visual-properties.h index a5aac2d..5b04d4e 100644 --- a/dali-toolkit/public-api/visuals/primitive-visual-properties.h +++ b/dali-toolkit/public-api/visuals/primitive-visual-properties.h @@ -46,12 +46,12 @@ enum /** * @brief The color of the shape. - * @details Name "shapeColor", type Property::VECTOR4. - * @SINCE_1_1.45 + * @details Name "mixColor", type Property::VECTOR4. + * @SINCE_1_2.4 * @note Optional. If not specified, the default is Vector4(0.5, 0.5, 0.5, 1.0). * @note Applies to ALL shapes. */ - COLOR, + MIX_COLOR, /** * @brief The number of slices as you go around the shape.