Deprecate VisualRenderer::MIX_COLOR and VISUAL_PRE_MULTIPLIED_ALPHA 49/317449/10
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 10 Sep 2024 10:21:38 +0000 (19:21 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Fri, 13 Sep 2024 06:41:03 +0000 (15:41 +0900)
Let we remove Visual's PreMultpliyAlpha property, what most application didn't set.

Also, let we use Renderer::Property::MIX_COLOR instead of VisualRenderer::Property::MIX_COLOR.

Change-Id: I29fc8c03416237466b88bc6533b58257f766371c
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
31 files changed:
automated-tests/src/dali-toolkit/utc-Dali-ImageVisual.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
automated-tests/src/dali-toolkit/utc-Dali-VisualFactory.cpp
dali-toolkit/internal/graphics/shaders/arc-visual-butt-cap-shader.frag
dali-toolkit/internal/graphics/shaders/arc-visual-round-cap-shader.frag
dali-toolkit/internal/graphics/shaders/border-visual-anti-aliasing-shader.frag
dali-toolkit/internal/graphics/shaders/border-visual-shader.frag
dali-toolkit/internal/graphics/shaders/color-visual-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag
dali-toolkit/internal/graphics/shaders/image-visual-shader.frag
dali-toolkit/internal/graphics/shaders/mesh-visual-normal-map-shader.frag
dali-toolkit/internal/graphics/shaders/mesh-visual-shader.frag
dali-toolkit/internal/graphics/shaders/mesh-visual-simple-shader.frag
dali-toolkit/internal/graphics/shaders/npatch-visual-mask-shader.frag
dali-toolkit/internal/graphics/shaders/npatch-visual-shader.frag
dali-toolkit/internal/graphics/shaders/primitive-visual-shader.frag
dali-toolkit/internal/graphics/shaders/text-scroller-shader.frag
dali-toolkit/internal/graphics/shaders/text-visual-shader.frag
dali-toolkit/internal/graphics/shaders/wireframe-visual-shader.frag
dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/animated-image/animated-image-visual.h
dali-toolkit/internal/visuals/image/image-visual-shader-factory.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/image/image-visual.h
dali-toolkit/internal/visuals/npatch/npatch-visual.cpp
dali-toolkit/internal/visuals/npatch/npatch-visual.h
dali-toolkit/internal/visuals/text/text-visual.cpp
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/visuals/visual-properties.h

index 023d27ea263f5b05bb60dd13c97fcd8ffb59c51e..3053c7f2cf267fe562559aecde71348a4f8c7c14 100644 (file)
@@ -232,10 +232,13 @@ int UtcDaliImageVisualPropertyMap(void)
   application.Render();
 
   DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
-  auto renderer           = actor.GetRendererAt(0);
-  auto preMultipliedIndex = renderer.GetPropertyIndex("preMultipliedAlpha");
+  auto renderer = actor.GetRendererAt(0);
+
+  // Note : renderer don't have "premultipliedAlpha" at pre multiplied alpha enabled. (Since shader hold it.)
+  auto shader             = renderer.GetShader();
+  auto preMultipliedIndex = shader.GetPropertyIndex("premultipliedAlpha");
   DALI_TEST_CHECK(preMultipliedIndex != Property::INVALID_INDEX);
-  auto preMultipliedAlpha  = renderer.GetProperty<float>(preMultipliedIndex);
+  auto preMultipliedAlpha  = shader.GetProperty<float>(preMultipliedIndex);
   auto preMultipliedAlpha2 = renderer.GetProperty<bool>(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
   DALI_TEST_EQUALS(preMultipliedAlpha, 1.0f, TEST_LOCATION);
   DALI_TEST_EQUALS(preMultipliedAlpha2, true, TEST_LOCATION);
@@ -287,13 +290,15 @@ int UtcDaliImageVisualNoPremultipliedAlpha01(void)
   application.Render();
 
   DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
-  auto renderer           = actor.GetRendererAt(0);
-  auto preMultipliedIndex = renderer.GetPropertyIndex("preMultipliedAlpha");
+  auto renderer = actor.GetRendererAt(0);
+
+  // Note : renderer now have "premultipliedAlpha" since pre multiplied alpha disabled.
+  auto preMultipliedIndex = renderer.GetPropertyIndex("premultipliedAlpha");
   DALI_TEST_CHECK(preMultipliedIndex != Property::INVALID_INDEX);
-  auto preMultipliedAlpha  = renderer.GetProperty<bool>(preMultipliedIndex);
+  auto preMultipliedAlpha  = renderer.GetProperty<float>(preMultipliedIndex);
   auto preMultipliedAlpha2 = renderer.GetProperty<bool>(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
 
-  DALI_TEST_EQUALS(preMultipliedAlpha, false, TEST_LOCATION);
+  DALI_TEST_EQUALS(preMultipliedAlpha, 0.0f, TEST_LOCATION);
   DALI_TEST_EQUALS(preMultipliedAlpha2, false, TEST_LOCATION);
 
   DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
@@ -343,13 +348,15 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void)
   application.Render();
 
   DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
-  auto renderer           = actor.GetRendererAt(0);
-  auto preMultipliedIndex = renderer.GetPropertyIndex("preMultipliedAlpha");
+  auto renderer = actor.GetRendererAt(0);
+
+  // Note : renderer now have "premultipliedAlpha" since pre multiplied alpha disabled.
+  auto preMultipliedIndex = renderer.GetPropertyIndex("premultipliedAlpha");
   DALI_TEST_CHECK(preMultipliedIndex != Property::INVALID_INDEX);
-  auto preMultipliedAlpha  = renderer.GetProperty<bool>(preMultipliedIndex);
+  auto preMultipliedAlpha  = renderer.GetProperty<float>(preMultipliedIndex);
   auto preMultipliedAlpha2 = renderer.GetProperty<bool>(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
 
-  DALI_TEST_EQUALS(preMultipliedAlpha, false, TEST_LOCATION);
+  DALI_TEST_EQUALS(preMultipliedAlpha, 0.0f, TEST_LOCATION);
   DALI_TEST_EQUALS(preMultipliedAlpha2, false, TEST_LOCATION);
 
   DALI_TEST_EQUALS(textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION);
@@ -386,12 +393,12 @@ int UtcDaliImageVisualNoPremultipliedAlpha02(void)
 
   DALI_TEST_EQUALS(newActor.GetRendererCount(), 1u, TEST_LOCATION);
   auto newRenderer   = newActor.GetRendererAt(0);
-  preMultipliedIndex = newRenderer.GetPropertyIndex("preMultipliedAlpha");
+  preMultipliedIndex = newRenderer.GetPropertyIndex("premultipliedAlpha");
   DALI_TEST_CHECK(preMultipliedIndex != Property::INVALID_INDEX);
-  preMultipliedAlpha  = newRenderer.GetProperty<bool>(preMultipliedIndex);
+  preMultipliedAlpha  = newRenderer.GetProperty<float>(preMultipliedIndex);
   preMultipliedAlpha2 = newRenderer.GetProperty<bool>(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA);
 
-  DALI_TEST_EQUALS(preMultipliedAlpha, false, TEST_LOCATION);
+  DALI_TEST_EQUALS(preMultipliedAlpha, 0.0f, TEST_LOCATION);
   DALI_TEST_EQUALS(preMultipliedAlpha2, false, TEST_LOCATION);
 
   srcFactorRgb    = newRenderer.GetProperty<int>(Renderer::Property::BLEND_FACTOR_SRC_RGB);
@@ -1560,14 +1567,6 @@ int UtcDaliImageVisualAnimateMixColor(void)
   ToolkitTestApplication application;
   tet_infoline("Animate mix color");
 
-  static std::vector<UniformData> customUniforms =
-    {
-      UniformData("mixColor", Property::Type::VECTOR3),
-    };
-
-  TestGraphicsController& graphics = application.GetGraphicsController();
-  graphics.AddCustomUniforms(customUniforms);
-
   application.GetPlatform().SetClosestImageSize(Vector2(100, 100));
 
   VisualFactory factory = VisualFactory::Get();
@@ -1624,11 +1623,10 @@ int UtcDaliImageVisualAnimateMixColor(void)
   application.SendNotification();
   application.Render(0);     // Ensure animation starts
   application.Render(2000u); // Halfway point
-  Vector3 testColor(1.0f, 0.0f, 0.5f);
+  Vector4 testColor(1.0f, 0.0f, 0.5f, 0.75f);
 
-  // uColor.a should be actor's alpha * mixColor.a.
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 0.75f)), true, TEST_LOCATION);
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", testColor), true, TEST_LOCATION);
+  // uColor should be actor's color * mixColor.
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f) * testColor), true, TEST_LOCATION);
 
   DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Enable", blendStr.str()));
 
@@ -1642,8 +1640,7 @@ int UtcDaliImageVisualAnimateMixColor(void)
   application.SendNotification();
 
   DALI_TEST_EQUALS(actor.GetCurrentProperty<Vector4>(Actor::Property::COLOR), Color::WHITE, TEST_LOCATION);
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, 0.5f)), true, TEST_LOCATION);
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR)), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE * TARGET_MIX_COLOR), true, TEST_LOCATION);
 
   // (Don't test for caching of capabilities, toolkit uses Test graphics backend, not actual backend)
 
index 252fbbaf867a1fa1316f7c4876c8b40b5e4e3ca9..c407198947b9102da890a4922cf36e2e759f3861 100644 (file)
@@ -1174,14 +1174,6 @@ int UtcDaliVisualGetPropertyMap9(void)
   ToolkitTestApplication application;
   tet_infoline("UtcDaliVisualGetPropertyMap9: PrimitiveVisual");
 
-  static std::vector<UniformData> customUniforms =
-    {
-      UniformData("mixColor", Property::Type::VECTOR3),
-    };
-
-  TestGraphicsController& graphics = application.GetGraphicsController();
-  graphics.AddCustomUniforms(customUniforms);
-
   Vector4 color      = Vector4(1.0, 0.8, 0.6, 1.0);
   Vector3 dimensions = Vector3(1.0, 2.0, 3.0);
 
@@ -1268,7 +1260,7 @@ int UtcDaliVisualGetPropertyMap9(void)
   application.GetScene().Add(actor);
 
   Animation animation = Animation::New(1.0f);
-  animation.AnimateTo(DevelControl::GetVisualProperty(actor, DummyControl::Property::TEST_VISUAL, PrimitiveVisual::Property::MIX_COLOR), Vector3(Color::MAGENTA));
+  animation.AnimateTo(DevelControl::GetVisualProperty(actor, DummyControl::Property::TEST_VISUAL, PrimitiveVisual::Property::MIX_COLOR), Color::MAGENTA);
   animation.Play();
   application.SendNotification();
   application.Render(0);
@@ -1276,7 +1268,7 @@ int UtcDaliVisualGetPropertyMap9(void)
   application.SendNotification();
 
   auto& gl = application.GetGlAbstraction();
-  DALI_TEST_EQUALS(gl.CheckUniformValue<Vector3>("mixColor", Vector3(Color::MAGENTA)), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(gl.CheckUniformValue<Vector4>("uColor", Color::MAGENTA), true, TEST_LOCATION);
 
   tet_infoline("Check property map after animation");
 
@@ -1285,7 +1277,7 @@ int UtcDaliVisualGetPropertyMap9(void)
   DALI_TEST_CHECK(value);
   color = value->Get<Vector4>();
   // Ignore alpha part
-  DALI_TEST_EQUALS(Vector3(color), Vector3(Color::MAGENTA), 0.001f, TEST_LOCATION);
+  DALI_TEST_EQUALS(color, Color::MAGENTA, 0.001f, TEST_LOCATION);
 
   END_TEST;
 }
@@ -1959,7 +1951,6 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   static std::vector<UniformData> customUniforms =
     {
       UniformData("borderColor", Property::Type::VECTOR4),
-      UniformData("mixColor", Property::Type::VECTOR3),
     };
 
   TestGraphicsController& graphics = application.GetGraphicsController();
@@ -1994,7 +1985,7 @@ int UtcDaliVisualAnimateBorderVisual01(void)
 
   Renderer        renderer         = actor.GetRendererAt(0);
   Property::Index borderColorIndex = renderer.GetPropertyIndex(BorderVisual::Property::COLOR);
-  Property::Index mixColorIndex    = VisualRenderer::Property::VISUAL_MIX_COLOR; //renderer.GetPropertyIndex( Visual::Property::MIX_COLOR );
+  Property::Index mixColorIndex    = Renderer::Property::MIX_COLOR;
 
   Animation animation = dummyImpl.CreateTransition(transition);
 
@@ -2012,14 +2003,10 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   DALI_TEST_EQUALS(color, testColor, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", testColor), true, TEST_LOCATION);
 
-  color     = renderer.GetCurrentProperty<Vector3>(mixColorIndex);
+  color     = renderer.GetCurrentProperty<Vector4>(mixColorIndex);
   testColor = Vector4(1, 1, 1, 0.45f);
-  DALI_TEST_EQUALS(Vector3(color), Vector3(testColor), 0.0001f, TEST_LOCATION);
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor)), true, TEST_LOCATION);
-
-  Vector4 uColor;
-  DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", uColor));
-  DALI_TEST_EQUALS(uColor.a, testColor.a, TEST_LOCATION);
+  DALI_TEST_EQUALS(color, testColor, 0.0001f, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", testColor), true, TEST_LOCATION);
 
   application.Render(2000u);
 
@@ -2027,13 +2014,10 @@ int UtcDaliVisualAnimateBorderVisual01(void)
   DALI_TEST_EQUALS(color, Color::WHITE, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("borderColor", Color::WHITE), true, TEST_LOCATION);
 
-  color     = renderer.GetCurrentProperty<Vector3>(mixColorIndex);
+  color     = renderer.GetCurrentProperty<Vector4>(mixColorIndex);
   testColor = Vector4(1, 1, 1, 0.1);
-  DALI_TEST_EQUALS(Vector3(color), Vector3(testColor), TEST_LOCATION);
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(testColor)), true, TEST_LOCATION);
-
-  DALI_TEST_CHECK(application.GetGlAbstraction().GetUniformValue<Vector4>("uColor", uColor));
-  DALI_TEST_EQUALS(uColor.a, testColor.a, TEST_LOCATION);
+  DALI_TEST_EQUALS(color, testColor, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", testColor), true, TEST_LOCATION);
 
   END_TEST;
 }
@@ -2096,14 +2080,6 @@ int UtcDaliVisualAnimateColorVisual(void)
   ToolkitTestApplication application;
   tet_infoline("UtcDaliAnimateColorVisual mixColor");
 
-  static std::vector<UniformData> customUniforms =
-    {
-      UniformData("mixColor", Property::Type::VECTOR3),
-    };
-
-  TestGraphicsController& graphics = application.GetGraphicsController();
-  graphics.AddCustomUniforms(customUniforms);
-
   VisualFactory factory = VisualFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
@@ -2120,31 +2096,31 @@ int UtcDaliVisualAnimateColorVisual(void)
   DALI_TEST_EQUALS(actor.GetRendererCount(), 1u, TEST_LOCATION);
 
   Renderer        renderer      = actor.GetRendererAt(0);
-  Property::Index mixColorIndex = VisualRenderer::Property::VISUAL_MIX_COLOR; //renderer.GetPropertyIndex( ColorVisual::Property::MIX_COLOR );
+  Property::Index mixColorIndex = Renderer::Property::MIX_COLOR;
 
   Property::Value blendModeValue = renderer.GetProperty(Renderer::Property::BLEND_MODE);
   DALI_TEST_EQUALS(blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION);
 
   Animation animation = Animation::New(4.0f);
-  animation.AnimateTo(Property(renderer, mixColorIndex), Vector3(Color::WHITE));
+  animation.AnimateTo(Property(renderer, mixColorIndex), Color::WHITE);
   animation.Play();
 
   application.SendNotification();
   application.Render(0);
   application.Render(2000u); // halfway point
 
-  Vector3 color     = renderer.GetCurrentProperty<Vector3>(mixColorIndex);
-  Vector3 testColor = Vector3(Color::BLUE + Color::WHITE) * 0.5f;
+  Vector4 color     = renderer.GetCurrentProperty<Vector4>(mixColorIndex);
+  Vector4 testColor = (Color::BLUE + Color::WHITE) * 0.5f;
   DALI_TEST_EQUALS(color, testColor, TEST_LOCATION);
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", testColor), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", testColor), true, TEST_LOCATION);
 
   application.Render(2000u); // halfway point between blue and white
 
-  color = renderer.GetCurrentProperty<Vector3>(mixColorIndex);
-  DALI_TEST_EQUALS(color, Vector3(Color::WHITE), TEST_LOCATION);
+  color = renderer.GetCurrentProperty<Vector4>(mixColorIndex);
+  DALI_TEST_EQUALS(color, Color::WHITE, TEST_LOCATION);
 
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(Color::WHITE)), true, TEST_LOCATION);
+  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Color::WHITE), true, TEST_LOCATION);
 
   blendModeValue = renderer.GetCurrentProperty(Renderer::Property::BLEND_MODE);
   DALI_TEST_EQUALS(blendModeValue.Get<int>(), (int)BlendMode::AUTO, TEST_LOCATION);
@@ -2157,14 +2133,6 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
   ToolkitTestApplication application;
   tet_infoline("UtcDaliAnimatePrimitiveVisual color");
 
-  static std::vector<UniformData> customUniforms =
-    {
-      UniformData("mixColor", Property::Type::VECTOR3),
-    };
-
-  TestGraphicsController& graphics = application.GetGraphicsController();
-  graphics.AddCustomUniforms(customUniforms);
-
   {
     VisualFactory factory = VisualFactory::Get();
     Property::Map propertyMap;
@@ -2215,8 +2183,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     application.SendNotification();
 
     Vector4 halfwayColor = (INITIAL_MIX_COLOR + TARGET_MIX_COLOR) * 0.5;
-    DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, halfwayColor.a)), true, TEST_LOCATION);
-    DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(halfwayColor)), true, TEST_LOCATION);
+    DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(0.5f, 0.5f, 0.5f, 1.0f) * halfwayColor), true, TEST_LOCATION);
 
     DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Enable", blendStr.str()));
 
@@ -2226,8 +2193,7 @@ int UtcDaliVisualAnimatePrimitiveVisual(void)
     application.SendNotification(); // Trigger signals
 
     DALI_TEST_EQUALS(actor.GetCurrentProperty<Vector4>(Actor::Property::COLOR), Color::WHITE, TEST_LOCATION);
-    DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, TARGET_MIX_COLOR.a)), true, TEST_LOCATION);
-    DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", Vector3(TARGET_MIX_COLOR)), true, TEST_LOCATION);
+    DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, 1.0f) * TARGET_MIX_COLOR), true, TEST_LOCATION);
 
     DALI_TEST_CHECK(glEnableStack.FindMethodAndParams("Disable", blendStr.str()));
 
@@ -4824,7 +4790,6 @@ int UtcDaliVisualBorderlineColorAnimateTest(void)
   TestGraphicsController&         graphics = application.GetGraphicsController();
   static std::vector<UniformData> customUniforms =
     {
-      UniformData("mixColor", Property::Type::VECTOR3),
       UniformData("cornerRadius", Property::Type::VECTOR4),
       UniformData("cornerRadiusPolicy", Property::Type::FLOAT),
       UniformData("borderlineWidth", Property::Type::FLOAT),
@@ -4834,12 +4799,10 @@ int UtcDaliVisualBorderlineColorAnimateTest(void)
   graphics.AddCustomUniforms(customUniforms);
 
   {
-    const Vector3 INITIAL_MIX_COLOR(1.0f, 0.0f, 1.0f);
-    const float   INITIAL_MIX_OPACITY(0.5f);
+    const Vector4 INITIAL_MIX_COLOR(1.0f, 0.0f, 1.0f, 0.5f);
     const Vector4 INITIAL_BORDERLINE_COLOR(0.0f, 1.0f, 0.0f, 1.0f);
     const float   INITIAL_ACTOR_OPACITY(1.0f);
-    const Vector3 TARGET_MIX_COLOR(1.0f, 0.0f, 0.0f);
-    const float   TARGET_MIX_OPACITY(0.8f);
+    const Vector4 TARGET_MIX_COLOR(1.0f, 0.0f, 0.0f, 0.8f);
     const Vector4 TARGET_BORDERLINE_COLOR(1.0f, 0.0f, 1.0f, 0.2f);
     const float   TARGET_ACTOR_OPACITY(0.5f);
 
@@ -4847,7 +4810,6 @@ int UtcDaliVisualBorderlineColorAnimateTest(void)
     Property::Map propertyMap;
     propertyMap.Insert(Visual::Property::TYPE, Visual::COLOR);
     propertyMap.Insert(Visual::Property::MIX_COLOR, INITIAL_MIX_COLOR);
-    propertyMap.Insert(Visual::Property::OPACITY, INITIAL_MIX_OPACITY);
     propertyMap.Insert(DevelVisual::Property::BORDERLINE_WIDTH, 1.0f);
     propertyMap.Insert(DevelVisual::Property::BORDERLINE_COLOR, INITIAL_BORDERLINE_COLOR);
     Visual::Base visual = factory.CreateVisual(propertyMap);
@@ -4864,7 +4826,6 @@ int UtcDaliVisualBorderlineColorAnimateTest(void)
 
     Animation animation = Animation::New(4.0f);
     animation.AnimateTo(DevelControl::GetVisualProperty(actor, DummyControl::Property::TEST_VISUAL, Visual::Property::MIX_COLOR), TARGET_MIX_COLOR);
-    animation.AnimateTo(DevelControl::GetVisualProperty(actor, DummyControl::Property::TEST_VISUAL, Visual::Property::OPACITY), TARGET_MIX_OPACITY);
     animation.AnimateTo(DevelControl::GetVisualProperty(actor, DummyControl::Property::TEST_VISUAL, DevelVisual::Property::BORDERLINE_COLOR), TARGET_BORDERLINE_COLOR);
     animation.AnimateTo(Property(actor, Actor::Property::OPACITY), TARGET_ACTOR_OPACITY);
     animation.Play();
@@ -4876,13 +4837,10 @@ int UtcDaliVisualBorderlineColorAnimateTest(void)
     application.Render(2000u); // halfway point
     application.SendNotification();
 
-    Vector3 halfwayMixColor        = (INITIAL_MIX_COLOR + TARGET_MIX_COLOR) * 0.5f;
-    float   halfwayMixOpacity      = (INITIAL_MIX_OPACITY + TARGET_MIX_OPACITY) * 0.5f;
+    Vector4 halfwayMixColor        = (INITIAL_MIX_COLOR + TARGET_MIX_COLOR) * 0.5f;
     Vector4 halfwayBorderlineColor = (INITIAL_BORDERLINE_COLOR + TARGET_BORDERLINE_COLOR) * 0.5f;
     float   halfwayActorOpacity    = (INITIAL_ACTOR_OPACITY + TARGET_ACTOR_OPACITY) * 0.5f;
-    halfwayMixOpacity *= halfwayActorOpacity;
-    DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector3>("mixColor", halfwayMixColor), true, TEST_LOCATION);
-    DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, halfwayMixOpacity)), true, TEST_LOCATION);
+    DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, halfwayActorOpacity) * halfwayMixColor), true, TEST_LOCATION);
     DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("uActorColor", Vector4(1.0f, 1.0f, 1.0f, halfwayActorOpacity)), true, TEST_LOCATION);
     DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("borderlineColor", halfwayBorderlineColor), true, TEST_LOCATION);
 
@@ -4890,8 +4848,7 @@ int UtcDaliVisualBorderlineColorAnimateTest(void)
     application.SendNotification(); // Trigger signals
 
     DALI_TEST_EQUALS(actor.GetCurrentProperty<Vector4>(Actor::Property::COLOR), Vector4(1.0f, 1.0f, 1.0f, TARGET_ACTOR_OPACITY), TEST_LOCATION);
-    DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector3>("mixColor", TARGET_MIX_COLOR), true, TEST_LOCATION);
-    DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, TARGET_MIX_OPACITY * TARGET_ACTOR_OPACITY)), true, TEST_LOCATION);
+    DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("uColor", Vector4(1.0f, 1.0f, 1.0f, TARGET_ACTOR_OPACITY) * TARGET_MIX_COLOR), true, TEST_LOCATION);
     DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("uActorColor", Vector4(1.0f, 1.0f, 1.0f, TARGET_ACTOR_OPACITY)), true, TEST_LOCATION);
     DALI_TEST_EQUALS(glAbstraction.CheckUniformValue<Vector4>("borderlineColor", TARGET_BORDERLINE_COLOR), true, TEST_LOCATION);
 
@@ -5087,7 +5044,6 @@ int UtcDaliVisualGetVisualProperty01(void)
 
   static std::vector<UniformData> customUniforms =
     {
-      UniformData("mixColor", Property::Type::VECTOR3),
       UniformData("offset", Property::Type::VECTOR2),
       UniformData("size", Property::Type::VECTOR2),
       UniformData("cornerRadius", Property::Type::VECTOR4),
@@ -5120,10 +5076,9 @@ int UtcDaliVisualGetVisualProperty01(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 targetColor(1.0f, 1.0f, 1.0f);
+  Vector4 targetColor(1.0f, 1.0f, 1.0f, 0.5f);
   Vector2 targetOffset(0.05f, 0.05f);
   Vector2 targetSize(1.1f, 1.1f);
-  float   targetOpacity = 0.5f;
   Vector4 targetCornerRadius(0.0f, 0.0f, 0.0f, 0.0f);
   float   targetBlurRadius      = 10.0f;
   float   targetBorderlineWidth = 25.0f;
@@ -5132,7 +5087,6 @@ int UtcDaliVisualGetVisualProperty01(void)
 
   Animation animation = Animation::New(1.0f);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, Visual::Property::MIX_COLOR), targetColor);
-  animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, Visual::Property::OPACITY), targetOpacity);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, Visual::Transform::Property::OFFSET), targetOffset);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, Visual::Transform::Property::SIZE), targetSize);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, DevelVisual::Property::CORNER_RADIUS), targetCornerRadius);
@@ -5152,7 +5106,7 @@ int UtcDaliVisualGetVisualProperty01(void)
   // Test property values: they should be updated
   Property::Value* colorValue = resultMap.Find(ColorVisual::Property::MIX_COLOR, Property::VECTOR4);
   DALI_TEST_CHECK(colorValue);
-  DALI_TEST_EQUALS(colorValue->Get<Vector4>(), Vector4(targetColor.r, targetColor.g, targetColor.b, targetOpacity), TEST_LOCATION);
+  DALI_TEST_EQUALS(colorValue->Get<Vector4>(), targetColor, TEST_LOCATION);
 
   Property::Value*     transformValue = resultMap.Find(Dali::Toolkit::Visual::Property::TRANSFORM);
   Dali::Property::Map* transformMap   = transformValue->GetMap();
@@ -5187,7 +5141,6 @@ int UtcDaliVisualGetVisualProperty01(void)
   DALI_TEST_EQUALS(borderlineOffsetValue->Get<float>(), targetBorderlineOffset, TEST_LOCATION);
 
   // Test uniform values
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", targetColor), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("offset", targetOffset), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("size", targetSize), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
@@ -5211,7 +5164,6 @@ int UtcDaliVisualGetVisualProperty02(void)
 
   static std::vector<UniformData> customUniforms =
     {
-      UniformData("mixColor", Property::Type::VECTOR3),
       UniformData("offset", Property::Type::VECTOR2),
       UniformData("size", Property::Type::VECTOR2),
       UniformData("cornerRadius", Property::Type::VECTOR4),
@@ -5238,10 +5190,9 @@ int UtcDaliVisualGetVisualProperty02(void)
   application.SendNotification();
   application.Render();
 
-  Vector3 targetColor(1.0f, 1.0f, 1.0f);
+  Vector4 targetColor(1.0f, 1.0f, 1.0f, 0.5f);
   Vector2 targetOffset(0.05f, 0.05f);
   Vector2 targetSize(1.1f, 1.1f);
-  float   targetOpacity = 0.5f;
   Vector4 targetCornerRadius(20.0f, 0.0f, 20.0f, 0.0f);
   float   targetBorderlineWidth = 77.7f;
   Vector4 targetBorderlineColor(0.4f, 0.2f, 0.3f, 0.9f);
@@ -5251,7 +5202,6 @@ int UtcDaliVisualGetVisualProperty02(void)
   // Should work when the properties are not set before
   Animation animation = Animation::New(1.0f);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, "mixColor"), targetColor);
-  animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, "opacity"), targetOpacity);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, "offset"), targetOffset);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, "size"), targetSize);
   animation.AnimateTo(DevelControl::GetVisualProperty(dummyControl, DummyControl::Property::TEST_VISUAL, "cornerRadius"), targetCornerRadius);
@@ -5271,7 +5221,7 @@ int UtcDaliVisualGetVisualProperty02(void)
   // Test property values: they should be updated
   Property::Value* colorValue = resultMap.Find(ColorVisual::Property::MIX_COLOR, Property::VECTOR4);
   DALI_TEST_CHECK(colorValue);
-  DALI_TEST_EQUALS(colorValue->Get<Vector4>(), Vector4(targetColor.r, targetColor.g, targetColor.b, targetOpacity), TEST_LOCATION);
+  DALI_TEST_EQUALS(colorValue->Get<Vector4>(), targetColor, TEST_LOCATION);
 
   Property::Value*     transformValue = resultMap.Find(Dali::Toolkit::Visual::Property::TRANSFORM);
   Dali::Property::Map* transformMap   = transformValue->GetMap();
@@ -5306,7 +5256,6 @@ int UtcDaliVisualGetVisualProperty02(void)
   DALI_TEST_EQUALS(blurRadiusValue->Get<float>(), targetBlurRadius, TEST_LOCATION);
 
   // Test uniform values
-  DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector3>("mixColor", targetColor), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("offset", targetOffset), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector2>("size", targetSize), true, TEST_LOCATION);
   DALI_TEST_EQUALS(application.GetGlAbstraction().CheckUniformValue<Vector4>("cornerRadius", targetCornerRadius), true, TEST_LOCATION);
index 7316c91ff8d88c1c21d8026fb743ac54ea236994..2bbc07e0e9fbd3e43ee509d6819fcae7b05ed9f0 100644 (file)
@@ -197,14 +197,6 @@ int UtcDaliVisualFactoryGetColorVisual1(void)
   ToolkitTestApplication application;
   tet_infoline("UtcDaliVisualFactoryGetColorVisual1:  Request color visual with a Property::Map");
 
-  static std::vector<UniformData> customUniforms =
-    {
-      UniformData("mixColor", Property::Type::VECTOR3),
-    };
-
-  TestGraphicsController& graphics = application.GetGraphicsController();
-  graphics.AddCustomUniforms(customUniforms);
-
   VisualFactory factory = VisualFactory::Get();
   DALI_TEST_CHECK(factory);
 
@@ -219,13 +211,10 @@ int UtcDaliVisualFactoryGetColorVisual1(void)
   DummyControl actor = DummyControl::New(true);
   TestVisualRender(application, actor, visual);
 
-  Vector3            actualValue(Vector4::ZERO);
   Vector4            actualColor(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK(gl.GetUniformValue<Vector3>("mixColor", actualValue));
   DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualColor));
-  DALI_TEST_EQUALS(actualValue, Vector3(testColor), TEST_LOCATION);
-  DALI_TEST_EQUALS(actualColor.a, testColor.a, TEST_LOCATION);
+  DALI_TEST_EQUALS(actualColor, testColor, TEST_LOCATION);
 
   END_TEST;
 }
@@ -235,14 +224,6 @@ int UtcDaliVisualFactoryGetColorVisual2(void)
   ToolkitTestApplication application;
   tet_infoline("UtcDaliVisualFactoryGetColorVisual2: Request color visual with a Vector4");
 
-  static std::vector<UniformData> customUniforms =
-    {
-      UniformData("mixColor", Property::Type::VECTOR3),
-    };
-
-  TestGraphicsController& graphics = application.GetGraphicsController();
-  graphics.AddCustomUniforms(customUniforms);
-
   VisualFactory factory = VisualFactory::Get();
   DALI_TEST_CHECK(factory);
 
@@ -256,13 +237,10 @@ int UtcDaliVisualFactoryGetColorVisual2(void)
   DummyControl actor = DummyControl::New(true);
   TestVisualRender(application, actor, visual);
 
-  Vector3            actualValue;
   Vector4            actualColor;
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK(gl.GetUniformValue<Vector3>("mixColor", actualValue));
   DALI_TEST_CHECK(gl.GetUniformValue<Vector4>("uColor", actualColor));
-  DALI_TEST_EQUALS(actualValue, Vector3(testColor), TEST_LOCATION);
-  DALI_TEST_EQUALS(actualColor.a, testColor.a, TEST_LOCATION);
+  DALI_TEST_EQUALS(actualColor, testColor, TEST_LOCATION);
 
   application.GetScene().Remove(actor);
   DALI_TEST_CHECK(actor.GetRendererCount() == 0u);
@@ -2920,9 +2898,9 @@ int UtcDaliVisualFactoryUsePreCompiledShader(void)
   Property::Map imageShader2;
   imageShader2["shaderType"]   = "image";
   imageShader2["shaderOption"] = Property::Map()
-                                    .Add("ROUNDED_CORNER", true)
-                                    .Add("BORDERLINE", true)
-                                    .Add("MASKING", true);
+                                   .Add("ROUNDED_CORNER", true)
+                                   .Add("BORDERLINE", true)
+                                   .Add("MASKING", true);
 
   Property::Map imageShader3;
   imageShader3["shaderType"]   = "image";
@@ -2939,40 +2917,40 @@ int UtcDaliVisualFactoryUsePreCompiledShader(void)
   Property::Map textShader;
   textShader["shaderType"]   = "text";
   textShader["shaderOption"] = Property::Map()
-                                    .Add("MULTI_COLOR", true)
-                                    .Add("OVERLAY", true)
-                                    .Add("STYLES", true);
+                                 .Add("MULTI_COLOR", true)
+                                 .Add("OVERLAY", true)
+                                 .Add("STYLES", true);
 
   Property::Map textShader2;
   textShader2["shaderType"]   = "text";
   textShader2["shaderOption"] = Property::Map()
-                                    .Add("EMOJI", true);
+                                  .Add("EMOJI", true);
 
   Property::Map colorShader;
   colorShader["shaderType"]   = "color";
   colorShader["shaderOption"] = Property::Map()
-                                    .Add("CUTOUT", true)
-                                    .Add("BORDERLINE", true);
+                                  .Add("CUTOUT", true)
+                                  .Add("BORDERLINE", true);
 
   Property::Map colorShader2;
   colorShader2["shaderType"]   = "color";
   colorShader2["shaderOption"] = Property::Map()
-                                    .Add("ROUNDED_CORNER,", true)
-                                    .Add("BLUR_EDGE", true);
+                                   .Add("ROUNDED_CORNER,", true)
+                                   .Add("BLUR_EDGE", true);
 
   Property::Map npatchShader;
-  npatchShader["shaderType"]   = "npatch";
+  npatchShader["shaderType"] = "npatch";
 
   Property::Map npatchShader2;
-  npatchShader2["shaderType"]   = "npatch";
-  npatchShader2["shaderOption"] = Property::Map() .Add("MASKING", true);
+  npatchShader2["shaderType"]    = "npatch";
+  npatchShader2["shaderOption"]  = Property::Map().Add("MASKING", true);
   npatchShader2["xStretchCount"] = 4;
   npatchShader2["yStretchCount"] = 3;
 
   Property::Map customSHader;
-  customSHader["shaderType"]   = "custom";
-  customSHader["shaderName"]   = "myShader";
-  customSHader["vertexShader"] = VertexSource;
+  customSHader["shaderType"]     = "custom";
+  customSHader["shaderName"]     = "myShader";
+  customSHader["vertexShader"]   = VertexSource;
   customSHader["fragmentShader"] = FragmentSource;
 
   factory.AddPrecompileShader(imageShader);
index c191b887c9693d1cf23e7b47f1260c5d1c55ee60..4720ae8f298612505e8fda40ad2c7fa2d6738fd9 100644 (file)
@@ -1,7 +1,6 @@
 INPUT mediump vec2 vPosition;
 
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 uniform mediump float thickness;
 uniform mediump float radius;
 uniform mediump float startAngle;
@@ -30,6 +29,6 @@ mediump float GetOpacity()
 
 void main()
 {
-  OUT_COLOR = vec4( mixColor, 1.0 ) * uColor;
+  OUT_COLOR = uColor;
   OUT_COLOR.a *= GetOpacity();
 }
index 8439290b609d076ec805ae747a40723f253c7c1b..a73cc9408447c2c7651bd5618e87fa34c2479c86 100644 (file)
@@ -1,7 +1,6 @@
 INPUT mediump vec2 vPosition;
 
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 uniform mediump float thickness;
 uniform mediump float radius;
 uniform mediump float startAngle;
@@ -27,6 +26,6 @@ mediump float GetOpacity()
 
 void main()
 {
-  OUT_COLOR = vec4( mixColor, 1.0 ) * uColor;
+  OUT_COLOR = uColor;
   OUT_COLOR.a *= GetOpacity();
 }
\ No newline at end of file
index 8853321b0d4d4396d017d94c80d236a0e98648b6..11950925c8556093deb810fedb29342ae74d2ce0 100644 (file)
@@ -2,11 +2,10 @@ INPUT mediump float vAlpha;
 
 uniform lowp vec4 uColor;
 uniform lowp vec4 borderColor;
-uniform lowp vec3 mixColor;
 uniform mediump float borderSize;
 
 void main()
 {
-  OUT_COLOR = vec4(mixColor, 1.0) * borderColor * uColor;
+  OUT_COLOR = borderColor * uColor;
   OUT_COLOR.a *= smoothstep(0.0, 1.5, vAlpha) * smoothstep( borderSize + 1.5, borderSize, vAlpha );
 }
\ No newline at end of file
index 971844565e022143816fdc22ee211e07ee597543..de9da9894d4470428dc2497e8fcfba39fb00d92e 100644 (file)
@@ -1,8 +1,7 @@
 uniform lowp vec4 uColor;
 uniform lowp vec4 borderColor;
-uniform lowp vec3 mixColor;
 
 void main()
 {
-  OUT_COLOR = vec4(mixColor, 1.0) * borderColor * uColor;
+  OUT_COLOR = borderColor * uColor;
 }
\ No newline at end of file
index 5b917c6b5825d597b5c0304006ce26db4082b58a..482ff7fbaaaee2f0aa6bb9f8bb42a5a6d56e3290 100644 (file)
@@ -15,7 +15,6 @@ FLAT INPUT highp vec4 vCutoutCornerRadius;
 #endif
 
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 #ifdef IS_REQUIRED_BLUR
 uniform highp float blurRadius;
 #elif defined(IS_REQUIRED_BORDERLINE)
@@ -169,7 +168,7 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
     // Manual blend operation with premultiplied colors.
     // Final alpha = borderlineColorAlpha + (1.0 - borderlineColorAlpha) * textureColor.a.
     // (Final rgb * alpha) =  borderlineColorRGB + (1.0 - borderlineColorAlpha) * textureColor.rgb
-    // If preMultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
+    // If premultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
     // Else, return vec4((rgb*alpha) / alpha, alpha)
 
     lowp float finalAlpha = mix(textureColor.a, 1.0, borderlineColorAlpha);
@@ -289,7 +288,7 @@ mediump float calculateBlurOpacity()
 
 void main()
 {
-  lowp vec4 targetColor = vec4(mixColor, 1.0) * uColor;
+  lowp vec4 targetColor = uColor;
 
 #ifdef IS_REQUIRED_CUTOUT
   mediump float discardOpacity = 1.0;
index 301a0a877de89310dabbd2c96c20f68bb58e07dc..0b1ea6b6e9756a5c646b64f827214644c64809fb 100644 (file)
@@ -14,7 +14,6 @@ uniform mediump float uTextureCoordinateScaleFactor;
 
 uniform sampler2D sTexture; // sampler1D?
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 #ifdef IS_REQUIRED_BORDERLINE
 uniform highp float borderlineWidth;
 uniform highp float borderlineOffset;
@@ -159,7 +158,7 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
     // Manual blend operation with premultiplied colors.
     // Final alpha = borderlineColorAlpha + (1.0 - borderlineColorAlpha) * textureColor.a.
     // (Final rgb * alpha) =  borderlineColorRGB + (1.0 - borderlineColorAlpha) * textureColor.rgb
-    // If preMultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
+    // If premultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
     // Else, return vec4((rgb*alpha) / alpha, alpha)
 
     lowp float finalAlpha = mix(textureColor.a, 1.0, borderlineColorAlpha);
@@ -196,9 +195,9 @@ void main()
 {
 #ifdef RADIAL
   mediump float radialTexCoord = ((length(vTexCoord) - 0.5) * uTextureCoordinateScaleFactor) + 0.5;
-  lowp vec4 textureColor = TEXTURE(sTexture, vec2(radialTexCoord, 0.5)) * vec4(mixColor, 1.0) * uColor;
+  lowp vec4 textureColor = TEXTURE(sTexture, vec2(radialTexCoord, 0.5)) * uColor;
 #else
-  lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0) * uColor;
+  lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * uColor;
 #endif
 
 #if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
index 9393692c531e5a2ccc93580e89c94fd97e09fb05..13ebeb972a4bcf3455f8f7313bf3c1a1c480917d 100644 (file)
@@ -38,8 +38,7 @@ uniform highp vec3 uScale;
 #endif
 
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-uniform lowp float preMultipliedAlpha;
+uniform lowp float premultipliedAlpha;
 #ifdef IS_REQUIRED_BORDERLINE
 uniform highp float borderlineWidth;
 uniform highp float borderlineOffset;
@@ -162,7 +161,7 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
 
   lowp vec3  borderlineColorRGB   = borderlineColor.rgb * uActorColor.rgb;
   lowp float borderlineColorAlpha = borderlineColor.a * uActorColor.a;
-  borderlineColorRGB *= mix(1.0, borderlineColorAlpha, preMultipliedAlpha);
+  borderlineColorRGB *= mix(1.0, borderlineColorAlpha, premultipliedAlpha);
 
   // Calculate inside of borderline when alpha is between (0.0  1.0). So we need to apply texture color.
   // If borderlineOpacity is exactly 0.0, we always use whole texture color. In this case, we don't need to run below code.
@@ -182,24 +181,24 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
       // potential is in texture range.
       lowp float textureAlphaScale = mix(1.0, 0.0, smoothstep(MinTexturelinePotential, MaxTexturelinePotential, potential));
       textureColor.a *= textureAlphaScale;
-      textureColor.rgb *= mix(textureColor.a, textureAlphaScale, preMultipliedAlpha);
+      textureColor.rgb *= mix(textureColor.a, textureAlphaScale, premultipliedAlpha);
     }
 
     borderlineColorAlpha *= borderlineOpacity;
-    borderlineColorRGB *= mix(borderlineColorAlpha, borderlineOpacity, preMultipliedAlpha);
+    borderlineColorRGB *= mix(borderlineColorAlpha, borderlineOpacity, premultipliedAlpha);
     // We use pre-multiplied color to reduce operations.
     // In here, textureColor and borderlineColorRGB is pre-multiplied color now.
 
     // Manual blend operation with premultiplied colors.
     // Final alpha = borderlineColorAlpha + (1.0 - borderlineColorAlpha) * textureColor.a.
     // (Final rgb * alpha) =  borderlineColorRGB + (1.0 - borderlineColorAlpha) * textureColor.rgb
-    // If preMultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
+    // If premultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
     // Else, return vec4((rgb*alpha) / alpha, alpha)
 
     lowp float finalAlpha = mix(textureColor.a, 1.0, borderlineColorAlpha);
     lowp vec3  finalMultipliedRGB = borderlineColorRGB + (1.0 - borderlineColorAlpha) * textureColor.rgb;
     // TODO : Need to find some way without division
-    return vec4(finalMultipliedRGB * mix(1.0 / finalAlpha, 1.0, preMultipliedAlpha), finalAlpha);
+    return vec4(finalMultipliedRGB * mix(1.0 / finalAlpha, 1.0, premultipliedAlpha), finalAlpha);
   }
   return mix(textureColor, vec4(borderlineColorRGB, borderlineColorAlpha), borderlineOpacity);
 }
@@ -364,7 +363,7 @@ mediump vec3 ApplyDebugMixColor(mediump vec4 originColor)
   mediump float colorRate = max(debugColorRateRed, max(debugColorRateGreen, debugColorRateBlue));
   mediump vec3 debugColor = vec3(debugColorRateRed, debugColorRateGreen, debugColorRateBlue);
 
-  debugColor *= mix(1.0, originColor.a, preMultipliedAlpha);
+  debugColor *= mix(1.0, originColor.a, premultipliedAlpha);
 
   return originColor.rgb * (1.0 - colorRate) + debugColor;
 }
@@ -382,9 +381,9 @@ void main()
 #endif
 
 #if defined(IS_REQUIRED_YUV_TO_RGB) || defined(IS_REQUIRED_UNIFIED_YUV_AND_RGB)
-  lowp vec4 textureColor = ConvertYuvToRgba(texCoord) * vec4( mixColor, 1.0 ) * uColor;
+  lowp vec4 textureColor = ConvertYuvToRgba(texCoord) * uColor;
 #else
-  lowp vec4 textureColor = TEXTURE( sTexture, texCoord ) * vec4( mixColor, 1.0 ) * uColor;
+  lowp vec4 textureColor = TEXTURE( sTexture, texCoord ) * uColor;
 #endif
 
 #ifdef IS_REQUIRED_ALPHA_MASKING
@@ -392,7 +391,7 @@ void main()
   maskTexCoord.y = mix(maskTexCoord.y, 1.0-maskTexCoord.y, uYFlipMaskTexture);
   mediump float maskAlpha = TEXTURE(sMaskTexture, maskTexCoord).a;
   textureColor.a *= maskAlpha;
-  textureColor.rgb *= mix(1.0, maskAlpha, preMultipliedAlpha);
+  textureColor.rgb *= mix(1.0, maskAlpha, premultipliedAlpha);
 #endif
 
 #if defined(IS_REQUIRED_DEBUG_VISUAL_SHADER) || defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
@@ -433,7 +432,7 @@ void main()
 #ifdef IS_REQUIRED_ROUNDED_CORNER
       mediump float opacity = calculateCornerOpacity();
       OUT_COLOR.a *= opacity;
-      OUT_COLOR.rgb *= mix(1.0, opacity, preMultipliedAlpha);
+      OUT_COLOR.rgb *= mix(1.0, opacity, premultipliedAlpha);
 #endif
     }
 
index 8c355ec2542e8374e2bc268e0188447c72cd43a9..b482d8c806857ad435f41de01696c688d2951311 100644 (file)
@@ -6,20 +6,17 @@ uniform sampler2D sDiffuse;
 uniform sampler2D sNormal;
 uniform sampler2D sGloss;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-uniform lowp float preMultipliedAlpha;
 
 void main()
 {
   vec4 texture = texture2D( sDiffuse, vTexCoord );
   vec3 normal = normalize( texture2D( sNormal, vTexCoord ).xyz * 2.0 - 1.0 );
   vec4 glossMap = texture2D( sGloss, vTexCoord );
-  vec4 visualMixColor = vec4( mixColor, 1.0 );
 
   float lightDiffuse = max( 0.0, dot( normal, normalize( vLightDirection ) ) );
   lightDiffuse = lightDiffuse * 0.5 + 0.5;
 
   float shininess = pow ( max ( dot ( normalize( vHalfVector ), normal ), 0.0 ), 16.0 );
 
-  gl_FragColor = vec4( texture.rgb * uColor.rgb * visualMixColor.rgb * lightDiffuse + shininess * glossMap.rgb, texture.a * uColor.a * visualMixColor.a );
+  gl_FragColor = vec4( texture.rgb * uColor.rgb * lightDiffuse + shininess * glossMap.rgb, texture.a * uColor.a );
 }
index 77f864968488877e3bd0863776e65e8ee1ce29bb..fd240fede562136d3e214aace0e0342f2868d963 100644 (file)
@@ -4,12 +4,9 @@ varying mediump vec3 vIllumination;
 varying mediump float vSpecular;
 uniform sampler2D sDiffuse;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-uniform lowp float preMultipliedAlpha;
 
 void main()
 {
   vec4 texture = texture2D( sDiffuse, vTexCoord );
-  vec4 visualMixColor = vec4( mixColor, 1.0 );
-  gl_FragColor = vec4( vIllumination.rgb * texture.rgb * uColor.rgb * visualMixColor.rgb + vSpecular * 0.3, texture.a * uColor.a * visualMixColor.a );
+  gl_FragColor = vec4( vIllumination.rgb * texture.rgb * uColor.rgb + vSpecular * 0.3, texture.a * uColor.a );
 }
index 52b1e47818231452ea770bb25ff1a3d9cb38fdd3..3f344a7568f1ea992138f9f356daf277c7ec8b9b 100644 (file)
@@ -1,10 +1,8 @@
 precision mediump float;
 varying mediump vec3 vIllumination;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-uniform lowp float preMultipliedAlpha;
 
 void main()
 {
-  gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a ) * vec4( mixColor, 1.0 );
+  gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a );
 }
index 626a3ff945cb45248a9b7948e2a24116b0efbe33..fbb4bdf8aa45ef7a605380bfcb0dbacb11329329 100644 (file)
@@ -3,8 +3,7 @@ varying mediump vec2 vMaskTexCoord;
 uniform sampler2D sTexture;
 uniform sampler2D sMask;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-uniform lowp float preMultipliedAlpha;
+uniform lowp float premultipliedAlpha;
 uniform mediump float auxiliaryImageAlpha;
 
 void main()
@@ -19,19 +18,19 @@ void main()
 
   mediump float maskAlpha = mask.a * auxiliaryImageAlpha;
 
-  lowp vec3 preMultipliedMaskRGB = mask.rgb * mix(mask.a, 1.0, preMultipliedAlpha) * auxiliaryImageAlpha;
-  lowp vec3 preMultipliedTextureRGB = color.rgb * mix(color.a, 1.0, preMultipliedAlpha);
+  lowp vec3 preMultipliedMaskRGB = mask.rgb * mix(mask.a, 1.0, premultipliedAlpha) * auxiliaryImageAlpha;
+  lowp vec3 preMultipliedTextureRGB = color.rgb * mix(color.a, 1.0, premultipliedAlpha);
 
   // Manual blend operation with premultiplied colors.
   // Final alpha = maskAlpha + (1.0 - maskAlpha) * color.a.
   // (Final rgb * alpha) =  preMultipliedMaskRGB + (1.0 - maskAlpha) * preMultipliedTextureRGB
-  // If preMultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
+  // If premultipliedAlpha == 1.0, just return vec4(rgb*alpha, alpha)
   // Else, return vec4((rgb*alpha) / alpha, alpha)
 
   lowp float finalAlpha = mix(color.a, 1.0, maskAlpha);
   lowp vec3  finalMultipliedRGB = preMultipliedMaskRGB + (1.0 - maskAlpha) * preMultipliedTextureRGB;
 
   // TODO : Need to find some way without division
-  lowp vec4 finalColor = vec4(finalMultipliedRGB * mix(1.0 / finalAlpha, 1.0, preMultipliedAlpha), finalAlpha);
-  gl_FragColor = finalColor * uColor * vec4(mixColor, 1.0);
+  lowp vec4 finalColor = vec4(finalMultipliedRGB * mix(1.0 / finalAlpha, 1.0, premultipliedAlpha), finalAlpha);
+  gl_FragColor = finalColor * uColor;
 }
index acfd7f5f436d6e5885ca31f0fefd5de64275ebc2..93f8fbce6c33d0161817206ff6534935c014a815 100644 (file)
@@ -1,10 +1,8 @@
 varying mediump vec2 vTexCoord;
 uniform sampler2D sTexture;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
-uniform lowp float preMultipliedAlpha;
 
 void main()
 {
-  gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor * vec4( mixColor, 1.0 );
+  gl_FragColor = texture2D( sTexture, vTexCoord ) * uColor;
 }
index 678a85205ab5bb46c5e52caf5912e8b83380e7b1..751f52773f7ce3e845fe66932f24ea0a2cf8ca8d 100644 (file)
@@ -3,10 +3,8 @@
 precision mediump float;
 varying mediump vec3 vIllumination;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 
 void main()
 {
-  vec4 baseColor = vec4(mixColor, 1.0) * uColor;
-  gl_FragColor = vec4( vIllumination.rgb * baseColor.rgb, baseColor.a );
+  gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a );
 }
index 25b85a3cfbd76d3d9b63f6542fbab2acd9913bf9..876628abc3f787e92deb1cf9a16ae329afbe03a8 100644 (file)
@@ -1,7 +1,6 @@
 varying highp vec2 vTexCoord;
 uniform sampler2D sTexture;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 
 void main()
 {
@@ -10,5 +9,5 @@ void main()
 
   mediump vec4 textTexture = texture2D( sTexture, vTexCoord );
 
-  gl_FragColor = textTexture * uColor * vec4( mixColor, 1.0 );
+  gl_FragColor = textTexture * uColor;
 }
index 0fc642e3c0b52740e20701c66d129afe66b7467a..8cd690a3ca4e1c8fc5021e1445f44c3797fc6950 100644 (file)
@@ -14,7 +14,6 @@ uniform lowp float uHasMultipleTextColors;
 #endif
 uniform lowp vec4 uTextColorAnimatable;
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 
 void main()
 {
@@ -48,7 +47,7 @@ void main()
 #endif
 
   // Draw the text as overlay above the style
-  OUT_COLOR = uColor * vec4(mixColor, 1.0) * (
+  OUT_COLOR = uColor * (
 #ifdef IS_REQUIRED_OVERLAY
                    (
 #endif
index 78d87592b16e5ed4b0e98d96ec400f4544de2db4..c75da53311f8460c5ca6881e19c3722491bbec0c 100644 (file)
@@ -1,7 +1,6 @@
 uniform lowp vec4 uColor;
-uniform lowp vec3 mixColor;
 
 void main()
 {
-  gl_FragColor = uColor * vec4( mixColor, 1.0 );
+  gl_FragColor = uColor;
 }
index 62dba00e960e0e5a5a2d82e9743aa8ac6b00c37b..4ccaa6641d431b7b7bfe33e948deaf11b288f155 100644 (file)
@@ -49,7 +49,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(5); // ltr, wrap, pixel area, crop to mask, mask texture ratio
+const int CUSTOM_PROPERTY_COUNT(6); // ltr, wrap, pixel area, crop to mask, mask texture ratio, pre-multiplied alph
 
 // fitting modes
 DALI_ENUM_TO_STRING_TABLE_BEGIN(FITTING_MODE)
@@ -259,6 +259,8 @@ AnimatedImageVisual::AnimatedImageVisual(VisualFactoryCache& factoryCache, Image
   mPlacementActor(),
   mImageVisualShaderFactory(shaderFactory),
   mPixelArea(FULL_TEXTURE_RECT),
+  mPixelAreaIndex(Property::INVALID_INDEX),
+  mPreMultipliedAlphaIndex(Property::INVALID_INDEX),
   mImageUrl(),
   mAnimatedImageLoading(),
   mFrameIndexForJumpTo(0),
@@ -387,7 +389,17 @@ void AnimatedImageVisual::DoCreatePropertyMap(Property::Map& map) const
     map.Insert(Toolkit::ImageVisual::Property::URL, value);
   }
 
-  map.Insert(Toolkit::ImageVisual::Property::PIXEL_AREA, mPixelArea);
+  if(mImpl->mRenderer && mPixelAreaIndex != Property::INVALID_INDEX)
+  {
+    // Update values from Renderer
+    Vector4 pixelArea = mImpl->mRenderer.GetProperty<Vector4>(mPixelAreaIndex);
+    map.Insert(Toolkit::ImageVisual::Property::PIXEL_AREA, pixelArea);
+  }
+  else
+  {
+    map.Insert(Toolkit::ImageVisual::Property::PIXEL_AREA, mPixelArea);
+  }
+
   map.Insert(Toolkit::ImageVisual::Property::WRAP_MODE_U, mWrapModeU);
   map.Insert(Toolkit::ImageVisual::Property::WRAP_MODE_V, mWrapModeV);
 
@@ -442,6 +454,22 @@ void AnimatedImageVisual::DoCreateInstancePropertyMap(Property::Map& map) const
   map.Insert(Toolkit::ImageVisual::Property::DESIRED_HEIGHT, mDesiredSize.GetHeight());
 }
 
+void AnimatedImageVisual::EnablePreMultipliedAlpha(bool preMultiplied)
+{
+  if(mImpl->mRenderer)
+  {
+    if(mPreMultipliedAlphaIndex != Property::INVALID_INDEX || !preMultiplied)
+    {
+      // RegisterUniqueProperty call SetProperty internally.
+      // Register PREMULTIPLIED_ALPHA only if it become false.
+      // Default PREMULTIPLIED_ALPHA value is 1.0f, at image-visual-shader-factory.cpp
+      mPreMultipliedAlphaIndex = mImpl->mRenderer.RegisterUniqueProperty(mPreMultipliedAlphaIndex, PREMULTIPLIED_ALPHA, preMultiplied ? 1.0f : 0.0f);
+    }
+  }
+
+  Visual::Base::EnablePreMultipliedAlpha(preMultiplied);
+}
+
 void AnimatedImageVisual::OnDoAction(const Dali::Property::Index actionId, const Dali::Property::Value& attributes)
 {
   // Make not set any action when the resource status is already failed.
@@ -943,7 +971,7 @@ void AnimatedImageVisual::OnInitialize()
 
   if(mPixelArea != FULL_TEXTURE_RECT)
   {
-    mImpl->mRenderer.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, mPixelArea);
+    mPixelAreaIndex = mImpl->mRenderer.RegisterProperty(mPixelAreaIndex, PIXEL_AREA_UNIFORM_NAME, mPixelArea);
   }
 
   if(mMaskingData)
@@ -951,7 +979,7 @@ void AnimatedImageVisual::OnInitialize()
     mImpl->mRenderer.RegisterProperty(CROP_TO_MASK_NAME, static_cast<float>(mMaskingData->mCropToMask));
   }
 
-  // Enable PreMultipliedAlpha if it need premultiplied
+  // Enable PreMultipliedAlpha if it need.
   auto preMultiplyOnLoad = IsPreMultipliedAlphaEnabled() && !mImpl->mCustomShader
                              ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD
                              : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
index 9bec65210055479d8c3cb8bd950c7d6058063453..63e87aeb152bc39af1b84d9a8867e1362aaa13e1 100644 (file)
@@ -133,6 +133,11 @@ public: // from Visual
    */
   void DoCreateInstancePropertyMap(Property::Map& map) const override;
 
+  /**
+   * @copydoc Visual::Base::EnablePreMultipliedAlpha
+   */
+  void EnablePreMultipliedAlpha(bool preMultiplied) override;
+
   /**
    * @copydoc Visual::Base::OnDoAction
    */
@@ -274,8 +279,12 @@ private:
   WeakHandle<Actor>         mPlacementActor;
   ImageVisualShaderFactory& mImageVisualShaderFactory;
 
+  // Variables for Image renderer
+  Vector4         mPixelArea;
+  Property::Index mPixelAreaIndex;
+  Property::Index mPreMultipliedAlphaIndex; ///< Index of premultipliedAlpha uniform.
+
   // Variables for Animated Image player
-  Vector4                    mPixelArea;
   VisualUrl                  mImageUrl;
   Dali::AnimatedImageLoading mAnimatedImageLoading; // Only needed for animated image
   uint32_t                   mFrameIndexForJumpTo;  // Frame index into textureRects
index 81e2b858bd5aee486f4135e7828c9d601ce1cb12..fb255978566bb78488ef60cc2025aed9a1dc486e 100644 (file)
@@ -36,6 +36,10 @@ namespace
 {
 const Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
 
+constexpr float ALPHA_PRE_MULTIPLIED(1.0f);
+
+constexpr int CUSTOM_PROPERTY_COUNT(2); // PixelArea, pre-multiplied alpha
+
 constexpr int              NATIVE_SHADER_TYPE_OFFSET = VisualFactoryCache::ShaderType::NATIVE_IMAGE_SHADER - VisualFactoryCache::ShaderType::IMAGE_SHADER;
 constexpr std::string_view Y_FLIP_MASK_TEXTURE       = "uYFlipMaskTexture";
 constexpr float            NOT_FLIP_MASK_TEXTURE     = 0.0f;
@@ -142,7 +146,16 @@ Shader ImageVisualShaderFactory::GetShader(VisualFactoryCache& factoryCache, con
   }
 
   shader = factoryCache.GenerateAndSaveShader(shaderType, vertexShader, fragmentShader);
+
+  shader.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT +
+                                 (featureBuilder.IsEnabledAlphaMaskingOnRendering() ? 1 : 0));
+
   shader.RegisterProperty(PIXEL_AREA_UNIFORM_NAME, FULL_TEXTURE_RECT);
+
+  // Most of image visual shader user (like svg, animated vector image visual) use pre-multiplied alpha.
+  // If the visual dont want to using pre-multiplied alpha, it should be set as 0.0f as renderer side.
+  shader.RegisterProperty(PREMULTIPLIED_ALPHA, ALPHA_PRE_MULTIPLIED);
+
   if(featureBuilder.IsEnabledAlphaMaskingOnRendering())
   {
     shader.RegisterProperty(Y_FLIP_MASK_TEXTURE, NOT_FLIP_MASK_TEXTURE);
@@ -178,7 +191,7 @@ bool ImageVisualShaderFactory::AddPrecompiledShader(PrecompileShaderOption& opti
 {
   ShaderFlagList shaderOption = option.GetShaderOptions();
 
-  auto featureBuilder = ImageVisualShaderFeature::FeatureBuilder();
+  auto        featureBuilder = ImageVisualShaderFeature::FeatureBuilder();
   std::string vertexPrefixList;
   std::string fragmentPrefixList;
   CreatePrecompileShader(featureBuilder, shaderOption);
@@ -186,7 +199,7 @@ bool ImageVisualShaderFactory::AddPrecompiledShader(PrecompileShaderOption& opti
   VisualFactoryCache::ShaderType type = featureBuilder.GetShaderType();
   featureBuilder.GetVertexShaderPrefixList(vertexPrefixList);
   featureBuilder.GetFragmentShaderPrefixList(fragmentPrefixList);
-  return SavePrecompileShader(type, vertexPrefixList, fragmentPrefixList );
+  return SavePrecompileShader(type, vertexPrefixList, fragmentPrefixList);
 }
 
 void ImageVisualShaderFactory::GetPreCompiledShader(RawShaderData& shaders)
@@ -197,7 +210,7 @@ void ImageVisualShaderFactory::GetPreCompiledShader(RawShaderData& shaders)
   shaders.shaderCount = 0;
   int shaderCount     = 0;
 
-  for(uint32_t i = 0u; i < mRequestedPrecompileShader.size(); i++ )
+  for(uint32_t i = 0u; i < mRequestedPrecompileShader.size(); i++)
   {
     vertexPrefix.push_back(mRequestedPrecompileShader[i].vertexPrefix);
     fragmentPrefix.push_back(mRequestedPrecompileShader[i].fragmentPrefix);
@@ -219,7 +232,7 @@ void ImageVisualShaderFactory::GetPreCompiledShader(RawShaderData& shaders)
   shaders.vertexShader   = SHADER_IMAGE_VISUAL_SHADER_VERT;
   shaders.fragmentShader = SHADER_IMAGE_VISUAL_SHADER_FRAG;
   shaders.shaderCount    = shaderCount;
-  shaders.custom = false;
+  shaders.custom         = false;
 }
 
 void ImageVisualShaderFactory::CreatePrecompileShader(ImageVisualShaderFeature::FeatureBuilder& builder, const ShaderFlagList& option)
@@ -261,7 +274,7 @@ void ImageVisualShaderFactory::CreatePrecompileShader(ImageVisualShaderFeature::
 
 bool ImageVisualShaderFactory::SavePrecompileShader(VisualFactoryCache::ShaderType shader, std::string& vertexPrefix, std::string& fragmentPrefix)
 {
-  for(uint32_t i = 0u; i< PREDEFINED_SHADER_TYPE_COUNT; i++)
+  for(uint32_t i = 0u; i < PREDEFINED_SHADER_TYPE_COUNT; i++)
   {
     if(ShaderTypePredefines[i] == shader)
     {
@@ -270,7 +283,7 @@ bool ImageVisualShaderFactory::SavePrecompileShader(VisualFactoryCache::ShaderTy
     }
   }
 
-  for(uint32_t i = 0u; i< mRequestedPrecompileShader.size(); i++)
+  for(uint32_t i = 0u; i < mRequestedPrecompileShader.size(); i++)
   {
     if(mRequestedPrecompileShader[i].type == shader)
     {
@@ -280,11 +293,11 @@ bool ImageVisualShaderFactory::SavePrecompileShader(VisualFactoryCache::ShaderTy
   }
 
   RequestShaderInfo info;
-  info.type = shader;
-  info.vertexPrefix = vertexPrefix;
+  info.type           = shader;
+  info.vertexPrefix   = vertexPrefix;
   info.fragmentPrefix = fragmentPrefix;
   mRequestedPrecompileShader.push_back(info);
-  DALI_LOG_RELEASE_INFO("Add precompile shader success!!(%s)",Scripting::GetLinearEnumerationName<VisualFactoryCache::ShaderType>(shader, VISUAL_SHADER_TYPE_TABLE, VISUAL_SHADER_TYPE_TABLE_COUNT));
+  DALI_LOG_RELEASE_INFO("Add precompile shader success!!(%s)", Scripting::GetLinearEnumerationName<VisualFactoryCache::ShaderType>(shader, VISUAL_SHADER_TYPE_TABLE, VISUAL_SHADER_TYPE_TABLE_COUNT));
   return true;
 }
 
index 65643e6e4623b896bdffacb0a11a7fe01aace277..f299975907ec23ed49f7e6a1fd61a0e35927fce0 100644 (file)
@@ -55,7 +55,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(7); // ltr, wrap, pixel area, atlas, pixalign, crop to mask, mask texture ratio
+const int CUSTOM_PROPERTY_COUNT(8); // ltr, wrap, pixel area, atlas, pixalign, crop to mask, mask texture ratio, pre-multiplied alpha
 
 // fitting modes
 DALI_ENUM_TO_STRING_TABLE_BEGIN(FITTING_MODE)
@@ -186,6 +186,7 @@ ImageVisual::ImageVisual(VisualFactoryCache&       factoryCache,
 : Visual::Base(factoryCache, Visual::FittingMode::DONT_CARE, Toolkit::Visual::IMAGE),
   mPixelArea(FULL_TEXTURE_RECT),
   mPixelAreaIndex(Property::INVALID_INDEX),
+  mPreMultipliedAlphaIndex(Property::INVALID_INDEX),
   mPlacementActor(),
   mImageUrl(imageUrl),
   mMaskingData(),
@@ -987,6 +988,22 @@ void ImageVisual::DoCreateInstancePropertyMap(Property::Map& map) const
   }
 }
 
+void ImageVisual::EnablePreMultipliedAlpha(bool preMultiplied)
+{
+  if(mImpl->mRenderer)
+  {
+    if(mPreMultipliedAlphaIndex != Property::INVALID_INDEX || !preMultiplied)
+    {
+      // RegisterUniqueProperty call SetProperty internally.
+      // Register PREMULTIPLIED_ALPHA only if it become false.
+      // Default PREMULTIPLIED_ALPHA value is 1.0f, at image-visual-shader-factory.cpp
+      mPreMultipliedAlphaIndex = mImpl->mRenderer.RegisterUniqueProperty(mPreMultipliedAlphaIndex, PREMULTIPLIED_ALPHA, preMultiplied ? 1.0f : 0.0f);
+    }
+  }
+
+  Visual::Base::EnablePreMultipliedAlpha(preMultiplied);
+}
+
 void ImageVisual::OnDoAction(const Dali::Property::Index actionId, const Dali::Property::Value& attributes)
 {
   // Check if action is valid for this visual type and perform action if possible
index dd1c6b1056d5e27e4814c5743b82c6bf0e3294cb..690624ce911cabefd000882e5578b993543d4e59 100644 (file)
@@ -170,6 +170,11 @@ public: // from Visual
    */
   void DoCreateInstancePropertyMap(Property::Map& map) const override;
 
+  /**
+   * @copydoc Visual::Base::EnablePreMultipliedAlpha
+   */
+  void EnablePreMultipliedAlpha(bool preMultiplied) override;
+
   /**
    * @copydoc Visual::Base::OnDoAction
    */
@@ -362,8 +367,10 @@ private:
   Geometry GenerateGeometry(TextureManager::TextureId textureId, bool createForce);
 
 private:
-  Vector4                            mPixelArea;
-  Property::Index                    mPixelAreaIndex;
+  Vector4         mPixelArea;
+  Property::Index mPixelAreaIndex;
+  Property::Index mPreMultipliedAlphaIndex; ///< Index of premultipliedAlpha uniform.
+
   WeakHandle<Actor>                  mPlacementActor;
   VisualUrl                          mImageUrl;
   TextureManager::MaskingDataPointer mMaskingData;
index 532d6e3da228f0f2287dd26dfa24277cd789f99c..cfb348a2542093417dc20d13ef599638c431f607 100644 (file)
@@ -49,7 +49,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(5); // fixed(3),stretch,aux
+const int CUSTOM_PROPERTY_COUNT(6); // fixed(3),stretch,aux,pre-muliplied alpha
 }
 
 /////////////////NPatchVisual////////////////
@@ -94,6 +94,9 @@ void NPatchVisual::LoadImages()
                                ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD
                                : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
 
+    // Register PREMULTIPLIED_ALPHA property here.
+    mPreMultipliedAlphaIndex = mImpl->mRenderer.RegisterUniqueProperty(mPreMultipliedAlphaIndex, PREMULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled() ? 1.0f : 0.0f);
+
     TextureManager::MaskingDataPointer maskingDataPtr       = nullptr;
     ImageAtlasManagerPtr               imageAtlasManagerPtr = nullptr;
 
@@ -287,6 +290,16 @@ void NPatchVisual::DoCreateInstancePropertyMap(Property::Map& map) const
   }
 }
 
+void NPatchVisual::EnablePreMultipliedAlpha(bool preMultiplied)
+{
+  if(mImpl->mRenderer && mPreMultipliedAlphaIndex != Property::INVALID_INDEX)
+  {
+    mImpl->mRenderer.SetProperty(mPreMultipliedAlphaIndex, preMultiplied ? 1.0f : 0.0f);
+  }
+
+  Visual::Base::EnablePreMultipliedAlpha(preMultiplied);
+}
+
 NPatchVisual::NPatchVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFactory& shaderFactory)
 : Visual::Base(factoryCache, Visual::FittingMode::DONT_CARE, Toolkit::Visual::N_PATCH),
   mPlacementActor(),
@@ -298,6 +311,7 @@ NPatchVisual::NPatchVisual(VisualFactoryCache& factoryCache, ImageVisualShaderFa
   mAuxiliaryTextureSet(),
   mAuxiliaryTextureId(TextureManager::INVALID_TEXTURE_ID),
   mAuxiliaryResourceStatus(Toolkit::Visual::ResourceStatus::PREPARING),
+  mPreMultipliedAlphaIndex(Property::INVALID_INDEX),
   mBorderOnly(false),
   mBorder(),
   mAuxiliaryImageAlpha(0.0f),
index c94e5b4a5336a0af0294a012843422a0940fa5bd..efb29c27d856381267815a8f94228323da7fb26d 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_N_PATCH_VISUAL_H
 
 /*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -99,6 +99,11 @@ public: // from Visual
    */
   void DoCreateInstancePropertyMap(Property::Map& map) const override;
 
+  /**
+   * @copydoc Visual::Base::EnablePreMultipliedAlpha
+   */
+  void EnablePreMultipliedAlpha(bool preMultiplied) override;
+
 protected:
   /**
    * @brief Constructor.
@@ -224,6 +229,7 @@ private:
   TextureSet                                mAuxiliaryTextureSet;     ///< TextureSet of the auxiliary mask image
   TextureManager::TextureId                 mAuxiliaryTextureId;      ///< id of the auxiliary mask image (from TextureManager)
   Toolkit::Visual::ResourceStatus           mAuxiliaryResourceStatus; ///< resource status for auxiliary mask image
+  Property::Index                           mPreMultipliedAlphaIndex; ///< Index of premultipliedAlpha uniform. Only be used for auxiliary image.
   bool                                      mBorderOnly;              ///< if only border is desired
   Rect<int>                                 mBorder;                  ///< The size of the border
   float                                     mAuxiliaryImageAlpha;     ///< The alpha value for the auxiliary image only
index 39b5720cdbad474244a3faf91d8d149738df320b..aab56eab8c0a0829f05f78953c48b65d9c064741 100644 (file)
@@ -300,9 +300,9 @@ TextVisual::~TextVisual()
 
 void TextVisual::OnInitialize()
 {
-  Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
-  auto featureBuilder = TextVisualShaderFeature::FeatureBuilder();
-  Shader shader = GetTextShader(mFactoryCache, featureBuilder);
+  Geometry geometry       = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
+  auto     featureBuilder = TextVisualShaderFeature::FeatureBuilder();
+  Shader   shader         = GetTextShader(mFactoryCache, featureBuilder);
 
   mImpl->mRenderer = VisualRenderer::New(geometry, shader);
   mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
@@ -715,7 +715,6 @@ void TextVisual::CreateTextureSet(TilingInfo& info, VisualRenderer& renderer, Sa
 
   // Enable the pre-multiplied alpha to improve the text quality
   renderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, true);
-  renderer.SetProperty(VisualRenderer::Property::VISUAL_PRE_MULTIPLIED_ALPHA, true);
 
   // Set size and offset for the tiling.
   renderer.SetProperty(VisualRenderer::Property::TRANSFORM_SIZE, Vector2(static_cast<float>(info.width), static_cast<float>(info.height)));
index 3ad9393bd414d82081d966515ee60bd8740feec9..e830fa9000bffa63fc6b562e6309053bdf1ba46f 100644 (file)
@@ -589,8 +589,7 @@ void Visual::Base::CreatePropertyMap(Property::Map& map) const
   if(mImpl->mRenderer)
   {
     // Update values from Renderer
-    mImpl->mMixColor   = mImpl->mRenderer.GetProperty<Vector3>(VisualRenderer::Property::VISUAL_MIX_COLOR);
-    mImpl->mMixColor.a = mImpl->mRenderer.GetProperty<float>(DevelRenderer::Property::OPACITY);
+    mImpl->mMixColor = mImpl->mRenderer.GetProperty<Vector4>(Renderer::Property::MIX_COLOR);
 
     mImpl->mTransform.mOffset = mImpl->mRenderer.GetProperty<Vector2>(VisualRenderer::Property::TRANSFORM_OFFSET);
     mImpl->mTransform.mSize   = mImpl->mRenderer.GetProperty<Vector2>(VisualRenderer::Property::TRANSFORM_SIZE);
@@ -668,7 +667,6 @@ void Visual::Base::EnablePreMultipliedAlpha(bool preMultiplied)
   if(mImpl->mRenderer)
   {
     mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, preMultiplied);
-    mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_PRE_MULTIPLIED_ALPHA, preMultiplied);
   }
 }
 
@@ -750,15 +748,9 @@ void Visual::Base::RegisterMixColor()
   if(mImpl->mRenderer)
   {
     // All visual renderers now use same mix color / opacity properties.
-    mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_MIX_COLOR, Vector3(mImpl->mMixColor));
-    mImpl->mRenderer.SetProperty(DevelRenderer::Property::OPACITY, mImpl->mMixColor.a);
+    mImpl->mRenderer.SetProperty(Renderer::Property::MIX_COLOR, mImpl->mMixColor);
 
-    float preMultipliedAlpha = 0.0f;
-    if(IsPreMultipliedAlphaEnabled())
-    {
-      preMultipliedAlpha = 1.0f;
-    }
-    mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_PRE_MULTIPLIED_ALPHA, preMultipliedAlpha);
+    mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA, IsPreMultipliedAlphaEnabled());
   }
 }
 
@@ -794,8 +786,7 @@ void Visual::Base::SetMixColor(const Vector4& color)
 
   if(mImpl->mRenderer)
   {
-    mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_MIX_COLOR, Vector3(color));
-    mImpl->mRenderer.SetProperty(DevelRenderer::Property::OPACITY, color.a);
+    mImpl->mRenderer.SetProperty(Renderer::Property::MIX_COLOR, color);
   }
 }
 
@@ -807,7 +798,9 @@ void Visual::Base::SetMixColor(const Vector3& color)
 
   if(mImpl->mRenderer)
   {
-    mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_MIX_COLOR, color);
+    mImpl->mRenderer.SetProperty(Renderer::Property::MIX_COLOR_RED, color.r);
+    mImpl->mRenderer.SetProperty(Renderer::Property::MIX_COLOR_GREEN, color.g);
+    mImpl->mRenderer.SetProperty(Renderer::Property::MIX_COLOR_BLUE, color.b);
   }
 }
 
@@ -1011,15 +1004,15 @@ Property::Index Visual::Base::GetPropertyIndex(Property::Key key)
     }
     case Dali::Toolkit::Visual::Property::MIX_COLOR:
     {
-      return VisualRenderer::Property::VISUAL_MIX_COLOR;
+      return Renderer::Property::MIX_COLOR;
     }
     case Dali::Toolkit::Visual::Property::OPACITY:
     {
-      return DevelRenderer::Property::OPACITY;
+      return Renderer::Property::OPACITY;
     }
     case Dali::Toolkit::Visual::Property::PREMULTIPLIED_ALPHA:
     {
-      return VisualRenderer::Property::VISUAL_PRE_MULTIPLIED_ALPHA;
+      return Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA;
     }
     case Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS:
     {
@@ -1075,8 +1068,8 @@ void Visual::Base::SetupTransition(
   Dali::Animation&                    transition,
   Internal::TransitionData::Animator& animator,
   Property::Index                     index,
-  Property::Value&                    initialValue,
-  Property::Value&                    targetValue)
+  const Property::Value&              initialValue,
+  const Property::Value&              targetValue)
 {
   if(index != Property::INVALID_INDEX)
   {
@@ -1169,7 +1162,7 @@ void Visual::Base::AnimateOpacityProperty(
     mImpl->mMixColor.a = targetOpacity;
   }
 
-  SetupTransition(transition, animator, DevelRenderer::Property::OPACITY, animator.initialValue, animator.targetValue);
+  SetupTransition(transition, animator, Renderer::Property::OPACITY, animator.initialValue, animator.targetValue);
 }
 
 void Visual::Base::AnimateRendererProperty(
@@ -1209,45 +1202,41 @@ void Visual::Base::AnimateMixColorProperty(
 {
   bool animateOpacity = false;
 
-  Property::Value initialOpacity;
-  Property::Value targetOpacity;
-  Property::Value initialMixColor;
-  Property::Value targetMixColor;
-
-  Vector4 initialColor;
-  if(animator.initialValue.Get(initialColor))
+  Vector4 initialMixColor;
+  Vector4 targetMixColor;
+  if(animator.initialValue.Get(initialMixColor))
   {
-    if(animator.initialValue.GetType() == Property::VECTOR4)
+    if(animator.initialValue.GetType() != Property::VECTOR4)
     {
-      // if there is an initial color specifying alpha, test it
-      initialOpacity = initialColor.a;
+      // if there is non initial color specifying alpha, get from cached mix color
+      initialMixColor.a = mImpl->mMixColor.a;
     }
-    initialMixColor = Vector3(initialColor);
   }
 
   // Set target value into data store
   if(animator.targetValue.GetType() != Property::NONE)
   {
-    Vector4 mixColor;
-    animator.targetValue.Get(mixColor);
+    animator.targetValue.Get(targetMixColor);
     if(animator.targetValue.GetType() == Property::VECTOR4)
     {
-      mImpl->mMixColor.a = mixColor.a;
-      targetOpacity      = mixColor.a;
+      mImpl->mMixColor.a = targetMixColor.a;
       animateOpacity     = true;
     }
 
-    mImpl->mMixColor.r = mixColor.r;
-    mImpl->mMixColor.g = mixColor.g;
-    mImpl->mMixColor.b = mixColor.b;
-    targetMixColor     = Vector3(mixColor);
+    mImpl->mMixColor.r = targetMixColor.r;
+    mImpl->mMixColor.g = targetMixColor.g;
+    mImpl->mMixColor.b = targetMixColor.b;
   }
 
-  SetupTransition(transition, animator, VisualRenderer::Property::VISUAL_MIX_COLOR, initialMixColor, targetMixColor);
-
   if(animateOpacity)
   {
-    SetupTransition(transition, animator, DevelRenderer::Property::OPACITY, initialOpacity, targetOpacity);
+    SetupTransition(transition, animator, Renderer::Property::MIX_COLOR, initialMixColor, targetMixColor);
+  }
+  else
+  {
+    SetupTransition(transition, animator, Renderer::Property::MIX_COLOR_RED, initialMixColor.r, targetMixColor.r);
+    SetupTransition(transition, animator, Renderer::Property::MIX_COLOR_GREEN, initialMixColor.g, targetMixColor.g);
+    SetupTransition(transition, animator, Renderer::Property::MIX_COLOR_BLUE, initialMixColor.b, targetMixColor.b);
   }
 }
 
@@ -1264,11 +1253,11 @@ Dali::Property Visual::Base::GetPropertyObject(Dali::Property::Key key)
     // Default animatable properties from VisualRenderer
     case Toolkit::Visual::Property::MIX_COLOR:
     {
-      return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
+      return Dali::Property(mImpl->mRenderer, Renderer::Property::MIX_COLOR);
     }
     case Toolkit::Visual::Property::OPACITY:
     {
-      return Dali::Property(mImpl->mRenderer, DevelRenderer::Property::OPACITY);
+      return Dali::Property(mImpl->mRenderer, Renderer::Property::OPACITY);
     }
     case Toolkit::Visual::Transform::Property::OFFSET:
     {
@@ -1343,7 +1332,7 @@ Dali::Property Visual::Base::GetPropertyObject(Dali::Property::Key key)
          ((mImpl->mType == Toolkit::Visual::COLOR && key.indexKey == ColorVisual::Property::MIX_COLOR) ||
           (mImpl->mType == Toolkit::Visual::PRIMITIVE && key.indexKey == PrimitiveVisual::Property::MIX_COLOR)))
       {
-        return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
+        return Dali::Property(mImpl->mRenderer, Renderer::Property::MIX_COLOR);
       }
 
       // Special case for BLUR_RADIUS
index c5662ed6f1b289c9957f619494c27c970a9ae91c..b5c002e0f815f6ff168e24025f99b8e4309d3875 100644 (file)
@@ -494,8 +494,8 @@ private:
   void SetupTransition(Dali::Animation&                    transition,
                        Internal::TransitionData::Animator& animator,
                        Property::Index                     index,
-                       Property::Value&                    initialValue,
-                       Property::Value&                    targetValue);
+                       const Property::Value&              initialValue,
+                       const Property::Value&              targetValue);
 
   /**
    * Animate the opacity property - Special handling to
index 12236a8f26fe90463fb4f58b2f87bfcc01f0a5fe..068fb03503bebc0411924c53283aa0f0ca152c56 100644 (file)
@@ -812,16 +812,10 @@ void Control::MakeVisualTransition(Dali::Property::Map& sourcePropertyMap, Dali:
   float   destinationBorderlineOffset = findValueFloat(destinationMap, Toolkit::DevelVisual::Property::BORDERLINE_OFFSET, defaultBorderlineOffset);
 
   // If the value of the source Control and that of destination Control is different, the property should be transitioned.
-  if(Vector3(sourceMixColor) != Vector3(destinationMixColor))
+  if(sourceMixColor != destinationMixColor)
   {
-    sourcePropertyMap.Add(Dali::Toolkit::Visual::Property::MIX_COLOR, Vector3(sourceMixColor));
-    destinationPropertyMap.Add(Dali::Toolkit::Visual::Property::MIX_COLOR, Vector3(destinationMixColor));
-  }
-
-  if(std::abs(sourceMixColor.a - destinationMixColor.a) > Math::MACHINE_EPSILON_1)
-  {
-    sourcePropertyMap.Add(Dali::Toolkit::Visual::Property::OPACITY, sourceMixColor.a);
-    destinationPropertyMap.Add(Dali::Toolkit::Visual::Property::OPACITY, destinationMixColor.a);
+    sourcePropertyMap.Add(Dali::Toolkit::Visual::Property::MIX_COLOR, sourceMixColor);
+    destinationPropertyMap.Add(Dali::Toolkit::Visual::Property::MIX_COLOR, destinationMixColor);
   }
 
   if(sourceCornerRadius != destinationCornerRadius)
index 6f19efcc95e7d5ce07cb07449bae7f8532a59e44..61866f0eacc3801b03c4a46e72bc2a529619fe27 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_VISUAL_PROPERTIES_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -110,7 +110,7 @@ enum
    * @details Name "mixColor", type Property::VECTOR3 or Property::VECTOR4, animatable
    * @SINCE_1_2.60
    * @note Optional
-   * @note To animate an opacity, OPACITY property should be used.
+   * @note Animate support for Property::VECTOR4, which OPACITY property included.
    */
   MIX_COLOR,