Blending enum clean-up 06/67006/13
authorPaul Wisbey <p.wisbey@samsung.com>
Fri, 22 Apr 2016 10:15:52 +0000 (11:15 +0100)
committerPaul Wisbey <p.wisbey@samsung.com>
Wed, 4 May 2016 10:29:12 +0000 (11:29 +0100)
We were previously using a mixture of BLEND and BLENDING in enums.
The order of the BLEND_FACTOR enums & string names was also inconsistent.

As a rule of thumb always use Blend & BLEND for namespaces & enums/constants
(not Blending or BLENDING)

Change-Id: I464f9471dd6fdd4f865a2c1362a7c874fc3c315c

16 files changed:
automated-tests/src/dali-toolkit/utc-Dali-Control.cpp
automated-tests/src/dali-toolkit/utc-Dali-ControlRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-DebugRenderer.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-RendererFactory.cpp
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/renderers/border/border-renderer.cpp
dali-toolkit/internal/controls/renderers/color/color-renderer.cpp
dali-toolkit/internal/controls/renderers/color/color-renderer.h
dali-toolkit/internal/text/clipping/text-clipper.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/public-api/controls/control-impl.cpp
docs/content/shared-javascript-and-cpp-documentation/control-renderers.md
plugins/dali-script-v8/src/constants/constants-wrapper.cpp
plugins/dali-script-v8/src/rendering/renderer-api.cpp

index 9a7e6ff..1ecf233 100644 (file)
@@ -397,8 +397,8 @@ int UtcDaliControlBackgroundColor(void)
   Property::Map* resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
   DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get<std::string>() == "color" );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" ) );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" )->Get<Vector4>() == Color::RED );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get<Vector4>() == Color::RED );
 
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::RED, TEST_LOCATION );
 
@@ -406,8 +406,8 @@ int UtcDaliControlBackgroundColor(void)
 
   propValue = control.GetProperty( Control::Property::BACKGROUND );
   resultMap = propValue.GetMap();
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" ) );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" )->Get<Vector4>() == Color::YELLOW );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get<Vector4>() == Color::YELLOW );
 
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::YELLOW, TEST_LOCATION );
 
@@ -463,14 +463,14 @@ int UtcDaliControlBackgroundProperties(void)
 
   Property::Map rendererMap;
   rendererMap["rendererType"] = "color";
-  rendererMap["blendColor"] = Color::CYAN;
+  rendererMap["mixColor"] = Color::CYAN;
   control.SetProperty( Control::Property::BACKGROUND, rendererMap );
   propValue = control.GetProperty( Control::Property::BACKGROUND );
   resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
   DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get<std::string>() == "color" );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" ) );
-  DALI_TEST_CHECK( resultMap->Find( "blendColor" )->Get<Vector4>() == Color::CYAN );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" ) );
+  DALI_TEST_CHECK( resultMap->Find( "mixColor" )->Get<Vector4>() == Color::CYAN );
 
   Property::Map emptyMap;
   control.SetProperty( Control::Property::BACKGROUND, emptyMap );
index 55fa608..f5a2d96 100644 (file)
@@ -50,7 +50,7 @@ int UtcDaliControlRendererCopyAndAssignment(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
 
   ControlRenderer controlRendererCopy( controlRenderer );
@@ -83,7 +83,7 @@ int UtcDaliControlRendererSetGetDepthIndex(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
 
   controlRenderer.SetDepthIndex( 1.f );
@@ -187,7 +187,7 @@ int UtcDaliControlRendererSetOnOffStage(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
 
   Actor actor = Actor::New();
@@ -260,7 +260,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
   RendererFactory factory = RendererFactory::Get();
   Property::Map propertyMap;
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  Color::BLUE);
+  propertyMap.Insert("mixColor",  Color::BLUE);
   ControlRenderer colorRenderer = factory.GetControlRenderer( propertyMap );
 
   Property::Map resultMap;
@@ -270,7 +270,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
   DALI_TEST_CHECK( typeValue );
   DALI_TEST_CHECK( typeValue->Get<std::string>() == "color" );
 
-  Property::Value* colorValue = resultMap.Find( "blendColor",  Property::VECTOR4 );
+  Property::Value* colorValue = resultMap.Find( "mixColor",  Property::VECTOR4 );
   DALI_TEST_CHECK( colorValue );
   DALI_TEST_CHECK( colorValue->Get<Vector4>() == Color::BLUE );
 
@@ -279,7 +279,7 @@ int UtcDaliControlRendererGetPropertyMap1(void)
   factory.ResetRenderer( colorRenderer, actor, Color::CYAN );
   colorRenderer.CreatePropertyMap( resultMap );
 
-  colorValue = resultMap.Find( "blendColor",  Property::VECTOR4 );
+  colorValue = resultMap.Find( "mixColor",  Property::VECTOR4 );
   DALI_TEST_CHECK( colorValue );
   DALI_TEST_CHECK( colorValue->Get<Vector4>() == Color::CYAN );
 
index 28999a0..702f726 100644 (file)
@@ -73,7 +73,7 @@ int UtcDaliDebugRendererGetRenderer1(void)
   // Test that color renderer is replaced with debug renderer
   Property::Map propertyMap1;
   propertyMap1.Insert("rendererType",  "color");
-  propertyMap1.Insert("blendColor",  Color::BLUE);
+  propertyMap1.Insert("mixColor",  Color::BLUE);
   ControlRenderer colorRenderer = factory.GetControlRenderer(propertyMap1);
   DALI_TEST_CHECK( colorRenderer );
   DALI_TEST_CHECK( IsDebugRenderer( colorRenderer ) );
index cbba3e0..67f054c 100644 (file)
@@ -328,18 +328,8 @@ int UtcDaliImageViewSetGetProperty03(void)
   application.SendNotification();
   application.Render();
 
- // conventional alpha blending
 // conventional alpha blending
   Renderer renderer = imageView.GetRendererAt( 0 );
-  BlendingFactor::Type srcFactorRgb;
-  BlendingFactor::Type destFactorRgb;
-  BlendingFactor::Type srcFactorAlpha;
-  BlendingFactor::Type destFactorAlpha;
-  renderer.GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
-  DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::SRC_ALPHA );
-  DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA );
-  DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE );
-  DALI_TEST_CHECK( destFactorAlpha == BlendingFactor::ONE_MINUS_SRC_ALPHA );
-
   Property::Value value = renderer.GetProperty( Renderer::Property::BLEND_PRE_MULTIPLIED_ALPHA );
   bool enable;
   DALI_TEST_CHECK( value.Get( enable ) );
@@ -350,7 +340,10 @@ int UtcDaliImageViewSetGetProperty03(void)
   application.SendNotification();
   application.Render();
 
-  renderer.GetBlendFunc(srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha);
+  int srcFactorRgb    = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_RGB );
+  int destFactorRgb   = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_RGB );
+  int srcFactorAlpha  = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_SRC_ALPHA );
+  int destFactorAlpha = renderer.GetProperty<int>( Renderer::Property::BLEND_FACTOR_DEST_ALPHA );
   DALI_TEST_CHECK( srcFactorRgb == BlendingFactor::ONE );
   DALI_TEST_CHECK( destFactorRgb == BlendingFactor::ONE_MINUS_SRC_ALPHA );
   DALI_TEST_CHECK( srcFactorAlpha == BlendingFactor::ONE );
index f37298c..89bc1a1 100644 (file)
@@ -290,7 +290,7 @@ int UtcDaliRendererFactoryGetColorRenderer1(void)
   Property::Map propertyMap;
   Vector4 testColor( 1.f, 0.5f, 0.3f, 0.2f );
   propertyMap.Insert("rendererType",  "color");
-  propertyMap.Insert("blendColor",  testColor);
+  propertyMap.Insert("mixColor",  testColor);
 
   ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
@@ -300,7 +300,7 @@ int UtcDaliRendererFactoryGetColorRenderer1(void)
 
   Vector4 actualValue(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION );
 
   END_TEST;
@@ -323,7 +323,7 @@ int UtcDaliRendererFactoryGetColorRenderer2(void)
 
   Vector4 actualValue(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, testColor, TEST_LOCATION );
 
   controlRenderer.SetOffStage( actor );
@@ -357,7 +357,7 @@ int UtcDaliRendererFactoryGetBorderRenderer1(void)
   controlRenderer.SetOnStage( actor );
 
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
-  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLENDING_MODE );
+  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::ON, TEST_LOCATION );
 
   TestGlAbstraction& gl = application.GetGlAbstraction();
@@ -406,7 +406,7 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
   application.SendNotification();
   application.Render(0);
 
-  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLENDING_MODE );
+  int blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::AUTO, TEST_LOCATION );
 
   Vector4 actualColor(Vector4::ZERO);
@@ -425,7 +425,7 @@ int UtcDaliRendererFactoryGetBorderRenderer2(void)
 
   application.SendNotification();
   application.Render(0);
-  blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLENDING_MODE );
+  blendMode = actor.GetRendererAt(0u).GetProperty<int>( Renderer::Property::BLEND_MODE );
   DALI_TEST_EQUALS( static_cast<BlendingMode::Type>(blendMode), BlendingMode::ON, TEST_LOCATION );
 
   END_TEST;
@@ -949,13 +949,13 @@ int UtcDaliRendererFactoryResetRenderer1(void)
 
   Vector4 actualValue(Vector4::ZERO);
   TestGlAbstraction& gl = application.GetGlAbstraction();
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", 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<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::GREEN, TEST_LOCATION );
 
   Image bufferImage = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) );
@@ -1009,7 +1009,7 @@ int UtcDaliRendererFactoryResetRenderer2(void)
   application.SendNotification();
   application.Render(0);
   Vector4 actualValue(Vector4::ZERO);
-  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "blendColor", actualValue ) );
+  DALI_TEST_CHECK( gl.GetUniformValue<Vector4>( "mixColor", actualValue ) );
   DALI_TEST_EQUALS( actualValue, Color::RED, TEST_LOCATION );
 
   END_TEST;
index 5e6340f..0f64ac0 100644 (file)
@@ -525,7 +525,7 @@ void Model3dView::CreateGeometry()
     if( mRenderer )
     {
       mRenderer.SetGeometry( mMesh );
-      mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, Renderer::DEPTH_WRITE_ON );
+      mRenderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
     }
   }
 }
@@ -580,7 +580,7 @@ void Model3dView::CreateMaterial()
   {
     mRenderer.SetTextures( mTextureSet );
     mRenderer.SetShader( mShader );
-    mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, Renderer::CULL_NONE);
+    mRenderer.SetProperty( Renderer::Property::FACE_CULLING_MODE, FaceCullingMode::BACK );
   }
 
   UpdateShaderUniforms();
index a0d5d9f..5104216 100644 (file)
@@ -320,7 +320,7 @@ void PageTurnView::Page::UseEffect(Shader newShader, Geometry geometry)
     }
 
     renderer.SetTextures( textureSet );
-    renderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, Renderer::DEPTH_WRITE_ON );
+    renderer.SetProperty( Renderer::Property::DEPTH_WRITE_MODE, DepthWriteMode::ON );
     actor.AddRenderer( renderer );
   }
 }
index 3594538..d765ac7 100644 (file)
@@ -150,7 +150,7 @@ void BorderRenderer::DoSetOnStage( Actor& actor )
   mBorderColorIndex = (mImpl->mRenderer).RegisterProperty( COLOR_NAME, mBorderColor );
   if( mBorderColor.a < 1.f || mAntiAliasing)
   {
-    mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
   mBorderSizeIndex = (mImpl->mRenderer).RegisterProperty( SIZE_NAME, mBorderSize );
 }
@@ -187,7 +187,7 @@ void BorderRenderer::SetBorderColor(const Vector4& color)
     (mImpl->mRenderer).SetProperty( mBorderColorIndex, color );
     if( color.a < 1.f )
     {
-      mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
     }
   }
 }
@@ -213,7 +213,7 @@ void BorderRenderer::RequireAntiAliasing( bool antiAliasing )
       mImpl->mRenderer.SetShader( borderShader );
       if( mAntiAliasing )
       {
-        mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+        mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
       }
     }
   }
index c054a5e..c09f86f 100644 (file)
@@ -38,7 +38,7 @@ namespace Internal
 
 namespace
 {
-const char * const COLOR_NAME("blendColor");
+const char * const COLOR_NAME("mixColor");
 
 const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
   attribute mediump vec2 aPosition;\n
@@ -55,18 +55,18 @@ const char* VERTEX_SHADER = DALI_COMPOSE_SHADER(
 
 const char* FRAGMENT_SHADER = DALI_COMPOSE_SHADER(
   uniform lowp vec4 uColor;\n
-  uniform lowp vec4 blendColor;\n
+  uniform lowp vec4 mixColor;\n
   \n
   void main()\n
   {\n
-    gl_FragColor = blendColor*uColor;\n
+    gl_FragColor = mixColor*uColor;\n
   }\n
 );
 }
 
 ColorRenderer::ColorRenderer( RendererFactoryCache& factoryCache )
 : ControlRenderer( factoryCache ),
-  mBlendColorIndex( Property::INVALID_INDEX )
+  mMixColorIndex( Property::INVALID_INDEX )
 {
 }
 
@@ -77,7 +77,7 @@ ColorRenderer::~ColorRenderer()
 void ColorRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
 {
   Property::Value* color = propertyMap.Find( COLOR_NAME );
-  if( !( color && color->Get(mBlendColor) ) )
+  if( !( color && color->Get(mMixColor) ) )
   {
     DALI_LOG_ERROR( "Fail to provide a color to the ColorRenderer object" );
   }
@@ -111,7 +111,7 @@ void ColorRenderer::DoCreatePropertyMap( Property::Map& map ) const
 {
   map.Clear();
   map.Insert( RENDERER_TYPE, COLOR_RENDERER );
-  map.Insert( COLOR_NAME, mBlendColor );
+  map.Insert( COLOR_NAME, mMixColor );
 }
 
 void ColorRenderer::InitializeRenderer()
@@ -132,23 +132,23 @@ void ColorRenderer::InitializeRenderer()
 
   mImpl->mRenderer = Renderer::New( geometry, shader );
 
-  mBlendColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mBlendColor );
-  if( mBlendColor.a < 1.f )
+  mMixColorIndex = mImpl->mRenderer.RegisterProperty( COLOR_NAME, mMixColor );
+  if( mMixColor.a < 1.f )
   {
-    mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+    mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
   }
 }
 
 void ColorRenderer::SetColor(const Vector4& color)
 {
-  mBlendColor = color;
+  mMixColor = color;
 
   if( mImpl->mRenderer )
   {
-    (mImpl->mRenderer).SetProperty( mBlendColorIndex, color );
+    (mImpl->mRenderer).SetProperty( mMixColorIndex, color );
     if( color.a < 1.f )
     {
-      mImpl->mRenderer.SetProperty( Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+      mImpl->mRenderer.SetProperty( Renderer::Property::BLEND_MODE, BlendMode::ON );
     }
   }
 }
index 6d13204..d5c7a94 100644 (file)
@@ -37,7 +37,7 @@ namespace Internal
  *
  * | %Property Name  | Type        |
  * |-----------------|-------------|
- * | blendColor      | VECTOR4     |
+ * | mixColor        | VECTOR4     |
  */
 class ColorRenderer: public ControlRenderer
 {
@@ -113,8 +113,8 @@ private:
 
 private:
 
-  Vector4 mBlendColor;
-  Property::Index mBlendColorIndex;
+  Vector4 mMixColor;
+  Property::Index mMixColorIndex;
 
 };
 
index c4d9a87..f9cc430 100644 (file)
@@ -138,8 +138,10 @@ void Clipper::Initialize( const Vector2& size )
 void Clipper::OnStageConnect( Dali::Actor actor )
 {
   Renderer renderer = mImageActor.GetRendererAt(0);
-  renderer.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
-                        BlendingFactor::ONE, BlendingFactor::ONE);
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_RGB,    BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_RGB,   BlendFactor::ONE_MINUS_SRC_ALPHA );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_SRC_ALPHA,  BlendFactor::ONE );
+  renderer.SetProperty( Renderer::Property::BLEND_FACTOR_DEST_ALPHA, BlendFactor::ONE );
 }
 
 Clipper::Clipper()
index 966deff..2db0faa 100644 (file)
@@ -493,7 +493,7 @@ struct AtlasRenderer::Impl
     Shader shader( mGlyphManager.GetShader( meshRecord.mAtlasId ) );
     Dali::Renderer renderer = Dali::Renderer::New( quadGeometry, shader );
     renderer.SetTextures( textureSet );
-    renderer.SetProperty( Dali::Renderer::Property::BLENDING_MODE, BlendingMode::ON );
+    renderer.SetProperty( Dali::Renderer::Property::BLEND_MODE, BlendMode::ON );
     renderer.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, DepthIndex::CONTENT + mDepth );
     Actor actor = Actor::New();
 #if defined(DEBUG_ENABLED)
index 45fbe44..33acab9 100644 (file)
@@ -163,8 +163,6 @@ TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &Do
 
 DALI_TYPE_REGISTRATION_END()
 
-const char * const COLOR_RENDERER_COLOR_NAME("blendColor");
-
 } // unnamed namespace
 
 namespace Internal
@@ -179,6 +177,7 @@ public:
 : mControlImpl( controlImpl ),
   mStyleName(""),
   mBackgroundRenderer(),
+  mBackgroundColor(Color::TRANSPARENT),
   mStartingPinchScale( NULL ),
   mKeyEventSignal(),
   mPinchGestureDetector(),
@@ -369,6 +368,7 @@ public:
   Control& mControlImpl;
   std::string mStyleName;
   Toolkit::ControlRenderer mBackgroundRenderer;   ///< The control renderer to render the background
+  Vector4 mBackgroundColor;                       ///< The color of the background renderer
   Vector3* mStartingPinchScale;      ///< The scale when a pinch gesture starts, TODO: consider removing this
   Toolkit::Control::KeyEventSignalType mKeyEventSignal;
   Toolkit::Control::KeyInputFocusSignalType mKeyInputFocusGainedSignal;
@@ -441,6 +441,8 @@ const std::string& Control::GetStyleName() const
 
 void Control::SetBackgroundColor( const Vector4& color )
 {
+  mImpl->mBackgroundColor = color;
+
   Actor self( Self() );
   Toolkit::RendererFactory factory = Toolkit::RendererFactory::Get();
   factory.ResetRenderer( mImpl->mBackgroundRenderer, self, color );
@@ -449,19 +451,7 @@ void Control::SetBackgroundColor( const Vector4& color )
 
 Vector4 Control::GetBackgroundColor() const
 {
-  if( mImpl->mBackgroundRenderer && ( &typeid( GetImplementation(mImpl->mBackgroundRenderer) ) == &typeid( ColorRenderer ) ) )
-  {
-     Property::Map map;
-     mImpl->mBackgroundRenderer.CreatePropertyMap( map );
-     const Property::Value* colorValue = map.Find( COLOR_RENDERER_COLOR_NAME );
-     Vector4 color;
-     if( colorValue && colorValue->Get(color))
-     {
-       return color;
-     }
-  }
-
-  return Color::TRANSPARENT;
+  return mImpl->mBackgroundColor;
 }
 
 void Control::SetBackground(const Property::Map& map)
index 8f77b8d..b19b5dd 100644 (file)
@@ -34,7 +34,7 @@ Renders a solid color to the control's quad.
 
 | Property Name | Type    | Required | Description               |
 |---------------|:-------:|:--------:|---------------------------|
-| blendColor    | VECTOR4 | Yes      | The solid color required. |
+| mixColor      | VECTOR4 | Yes      | The solid color required. |
 
 ### Usage
 
@@ -44,7 +44,7 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
 
 Dali::Property::Map map;
 map[ "rendererType" ] = "color";
-map[ "blendColor" ] = Color::RED;
+map[ "mixColor" ] = Color::RED;
 
 control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
 ~~~
@@ -56,7 +56,7 @@ var control = new dali.Control( "Control" );
 control.background =
 {
   rendererType : "color",
-  blendColor : dali.COLOR_RED
+  mixColor : dali.COLOR_RED
 };
 ~~~
 ___________________________________________________________________________________________________
index 1c3b826..eab1614 100644 (file)
@@ -178,29 +178,29 @@ const IntegerPair EnumTable[] =
     { "SAMPLING_MODE_NO_FILTER",        SamplingMode::NO_FILTER },
     { "SAMPLING_MODE_DONT_CARE",        SamplingMode::DONT_CARE },
 
-    { "BLEND_FACTOR_ZERO",                                  BlendingFactor::ZERO                    },
-    { "BLEND_FACTOR_ONE",                                   BlendingFactor::ONE                     },
-    { "BLEND_FACTOR_SRC_COLOR",                             BlendingFactor::SRC_COLOR               },
-    { "BLEND_FACTOR_ONE_MINUS_SRC_COLOR",                   BlendingFactor::ONE_MINUS_SRC_COLOR     },
-    { "BLEND_FACTOR_SRC_ALPHA",                             BlendingFactor::SRC_ALPHA               },
-    { "BLEND_FACTOR_ONE_MINUS_SRC_ALPHA",                   BlendingFactor::ONE_MINUS_SRC_ALPHA     },
-    { "BLEND_FACTOR_DST_ALPHA",                             BlendingFactor::DST_ALPHA                },
-    { "BLEND_FACTOR_ONE_MINUS_DST_ALPHA",                   BlendingFactor::ONE_MINUS_DST_ALPHA      },
-    { "BLEND_FACTOR_DST_COLOR",                             BlendingFactor::DST_COLOR                },
-    { "BLEND_FACTOR_ONE_MINUS_DST_COLOR",                   BlendingFactor::ONE_MINUS_DST_COLOR      },
-    { "BLEND_FACTOR_SRC_ALPHA_SATURATE",                    BlendingFactor::SRC_ALPHA_SATURATE       },
-    { "BLEND_FACTOR_CONSTANT_COLOR",                        BlendingFactor::CONSTANT_COLOR           },
-    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR",              BlendingFactor::ONE_MINUS_CONSTANT_COLOR },
-    { "BLEND_FACTOR_CONSTANT_ALPHA" ,                       BlendingFactor::CONSTANT_ALPHA           },
-    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA",              BlendingFactor::ONE_MINUS_CONSTANT_ALPHA },
-
-    { "BLENDING_OFF",                                      BlendingMode::OFF             },
-    { "BLENDING_AUTO",                                     BlendingMode::AUTO            },
-    { "BLENDING_ON",                                       BlendingMode::ON              },
-
-    { "BLEND_EQUATION_ADD",                                BlendingEquation::ADD              },
-    { "BLEND_EQUATION_SUBTRACT",                           BlendingEquation::SUBTRACT         },
-    { "BLEND_EQUATION_REVERSE_SUBTRACT",                   BlendingEquation::REVERSE_SUBTRACT },
+    { "BLEND_FACTOR_ZERO",                                  BlendFactor::ZERO                    },
+    { "BLEND_FACTOR_ONE",                                   BlendFactor::ONE                     },
+    { "BLEND_FACTOR_SRC_COLOR",                             BlendFactor::SRC_COLOR               },
+    { "BLEND_FACTOR_ONE_MINUS_SRC_COLOR",                   BlendFactor::ONE_MINUS_SRC_COLOR     },
+    { "BLEND_FACTOR_SRC_ALPHA",                             BlendFactor::SRC_ALPHA               },
+    { "BLEND_FACTOR_ONE_MINUS_SRC_ALPHA",                   BlendFactor::ONE_MINUS_SRC_ALPHA     },
+    { "BLEND_FACTOR_DST_ALPHA",                             BlendFactor::DST_ALPHA                },
+    { "BLEND_FACTOR_ONE_MINUS_DST_ALPHA",                   BlendFactor::ONE_MINUS_DST_ALPHA      },
+    { "BLEND_FACTOR_DST_COLOR",                             BlendFactor::DST_COLOR                },
+    { "BLEND_FACTOR_ONE_MINUS_DST_COLOR",                   BlendFactor::ONE_MINUS_DST_COLOR      },
+    { "BLEND_FACTOR_SRC_ALPHA_SATURATE",                    BlendFactor::SRC_ALPHA_SATURATE       },
+    { "BLEND_FACTOR_CONSTANT_COLOR",                        BlendFactor::CONSTANT_COLOR           },
+    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR",              BlendFactor::ONE_MINUS_CONSTANT_COLOR },
+    { "BLEND_FACTOR_CONSTANT_ALPHA" ,                       BlendFactor::CONSTANT_ALPHA           },
+    { "BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA",              BlendFactor::ONE_MINUS_CONSTANT_ALPHA },
+
+    { "BLEND_MODE_OFF",                                      BlendMode::OFF             },
+    { "BLEND_MODE_AUTO",                                     BlendMode::AUTO            },
+    { "BLEND_MODE_ON",                                       BlendMode::ON              },
+
+    { "BLEND_EQUATION_ADD",                                BlendEquation::ADD              },
+    { "BLEND_EQUATION_SUBTRACT",                           BlendEquation::SUBTRACT         },
+    { "BLEND_EQUATION_REVERSE_SUBTRACT",                   BlendEquation::REVERSE_SUBTRACT },
 
     { "CAMERA_FREE_LOOK"             ,      Camera::FREE_LOOK                   },
     { "CAMERA_LOOK_AT_TARGET"        ,      Camera::LOOK_AT_TARGET              },
@@ -217,14 +217,14 @@ const IntegerPair EnumTable[] =
     { "WRAP_MODE_REPEAT",                     WrapMode::REPEAT           },
     { "WRAP_MODE_MIRRORED_REPEAT",            WrapMode::MIRRORED_REPEAT  },
 
-    { "RENDERER_CULL_NONE",                   Renderer::CULL_NONE                 },
-    { "RENDERER_CULL_BACK",                   Renderer::CULL_BACK                 },
-    { "RENDERER_CULL_FRONT",                  Renderer::CULL_FRONT                },
-    { "RENDERER_CULL_BACK_AND_FRONT",         Renderer::CULL_BACK_AND_FRONT       },
+    { "FACE_CULLING_NONE",                    FaceCullingMode::NONE           },
+    { "FACE_CULLING_BACK",                    FaceCullingMode::BACK           },
+    { "FACE_CULLING_FRONT",                   FaceCullingMode::FRONT          },
+    { "FACE_CULLING_FRONT_AND_BACK",          FaceCullingMode::FRONT_AND_BACK },
 
-    { "RENDERER_DEPTH_WRITE_OFF",             Renderer::DEPTH_WRITE_OFF   },
-    { "RENDERER_DEPTH_WRITE_AUTO",            Renderer::DEPTH_WRITE_AUTO  },
-    { "RENDERER_DEPTH_WRITE_ON",              Renderer::DEPTH_WRITE_ON    },
+    { "DEPTH_WRITE_OFF",                      DepthWriteMode::OFF   },
+    { "DEPTH_WRITE_AUTO",                     DepthWriteMode::AUTO  },
+    { "DEPTH_WRITE_ON",                       DepthWriteMode::ON    },
 
     { "GEOMETRY_POINTS",                      Geometry::POINTS          },
     { "GEOMETRY_LINES",                       Geometry::LINES           },
index 5efcd94..8834c35 100644 (file)
@@ -205,162 +205,6 @@ void RendererApi::GetTextures( const v8::FunctionCallbackInfo<v8::Value>& args )
   args.GetReturnValue().Set( localObject );
 }
 
-/**
- * Specify the pixel arithmetic used when the actor is blended.
- *
- * @for Renderer
- * @method setBlendFunc
- * @param {integer} srcFactorRgb Source Blending RGB
- * @param {integer} destFactorRgb Destination Blending RGB
- * @param {integer} srcFactorAlpha Source Blending Alpha
- * @param {integer} destFactorAlpha Destination Blending Alpha
- * @example
- *    //blending constants
- *    dali.BLEND_FACTOR_ZERO
- *    dali.BLEND_FACTOR_ONE
- *    dali.BLEND_FACTOR_SRC_COLOR
- *    dali.BLEND_FACTOR_ONE_MINUS_SRC_COLOR
- *    dali.BLEND_FACTOR_SRC_ALPHA
- *    dali.BLEND_FACTOR_ONE_MINUS_SRC_ALPHA
- *    dali.BLEND_FACTOR_DST_ALPHA
- *    dali.BLEND_FACTOR_ONE_MINUS_DST_ALPHA
- *    dali.BLEND_FACTOR_DST_COLOR
- *    dali.BLEND_FACTOR_ONE_MINUS_DST_COLOR
- *    dali.BLEND_FACTOR_SRC_ALPHA_SATURATE
- *    dali.BLEND_FACTOR_CONSTANT_COLOR
- *    dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR
- *    dali.BLEND_FACTOR_CONSTANT_ALPHA
- *    dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA
- *
- *    renderer.setBlendFunc( dali.BLEND_FACTOR_CONSTANT_COLOR, dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_COLOR,
- *                           dali.BLEND_FACTOR_CONSTANT_ALPHA, dali.BLEND_FACTOR_ONE_MINUS_CONSTANT_ALPHA );
- */
-void RendererApi::SetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  int params[4];
-  bool foundAllParams(false);
-  V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 4, args, 0 );
-  if( foundAllParams )
-  {
-    renderer.SetBlendFunc( static_cast< Dali::BlendingFactor::Type>(params[0]),
-                           static_cast< Dali::BlendingFactor::Type>(params[1]),
-                           static_cast< Dali::BlendingFactor::Type>(params[2]),
-                           static_cast< Dali::BlendingFactor::Type>(params[3]) );
-  }
-  else
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid blendFunc parameter");
-  }
-}
-
-/**
- * Query the pixel arithmetic used when the actor is blended.
- *
- * @for Renderer
- * @method getBlendFunc
- * @return {Object} Blend properties
- * @example Blend properties object has 4 fields
- *
- *      blendProperties.sourceRgb // source rgb enum
- *      blendProperties.destinationRgb // destination rgb enum
- *      blendProperties.sourceAlpha source // alpha enum
- *      blendProperties.destinationAlpha // destination alpha enum
- */
-void RendererApi::GetBlendFunc( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  // Pass by reference doesn't work in Javascript
-  // For now just return a vector 4...
-
-  BlendingFactor::Type srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha;
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  renderer.GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
-
-  v8::Local<v8::Object> blendProperties = v8::Object::New( isolate );
-
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "sourceRgb" ),        v8::Integer::New( isolate, srcFactorRgb) );
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "destinationRgb" ),   v8::Integer::New( isolate, destFactorRgb ) );
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "sourceAlpha" ),      v8::Integer::New( isolate, srcFactorAlpha  ) );
-  blendProperties->Set( v8::String::NewFromUtf8( isolate, "destinationAlpha" ), v8::Integer::New( isolate, destFactorAlpha ) );
-
-  args.GetReturnValue().Set( blendProperties );
-}
-
-/**
- * Specify the equation used when the actor is blended.
- *
- * @for Renderer
- * @method setBlendEquation
- * @param { integer } equationRgb The equation used for combining red, green, and blue components.
- * @param { integer } equationAlpha The equation used for combining the alpha component.
- * @example
- *      // blend equation is one of the following
- *      dali.BLEND_EQUATION_ADD
- *      dali.BLEND_EQUATION_SUBTRACT
- *      dali.BLEND_EQUATION_REVERSE_SUBTRACT
- *
- *      renderer.setBlendEquation( dali.BLEND_EQUATION_ADD, dali.BLEND_EQUATION_REVERSE_SUBTRACT );
- */
-void RendererApi::SetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  int params[2];
-  bool foundAllParams(false);
-  V8Utils::ReadIntegerArguments( foundAllParams, &params[0], 2, args, 0 );
-  if( foundAllParams )
-  {
-    renderer.SetBlendEquation( static_cast< BlendingEquation::Type>(params[0]), static_cast< BlendingEquation::Type>(params[1]) );
-  }
-  else
-  {
-    DALI_SCRIPT_EXCEPTION( isolate, "invalid BlendEquation parameter");
-  }
-}
-
-/**
- * Query the equation used when the actor is blended.
- *
- * @for Renderer
- * @method getBlendEquation
- * @return {Object} Blend equations
- * @example Blend equations object has 2 fields
- *
- *      blendEquations.equationRgb // equation used for combining rgb components
- *      blendEquations.equationAlpha // equation used for combining alpha components
- */
-void RendererApi::GetBlendEquation( const v8::FunctionCallbackInfo< v8::Value >& args )
-{
-  // Pass by reference doesn't work in Javascript
-  // For now just return a vector 2...
-
-  BlendingEquation::Type equationRgb, equationAlpha;
-  v8::Isolate* isolate = args.GetIsolate();
-  v8::HandleScope handleScope( isolate );
-
-  Renderer renderer = GetRenderer( isolate, args );
-
-  renderer.GetBlendEquation( equationRgb, equationAlpha );
-
-  v8::Local<v8::Object> blendEquations = v8::Object::New( isolate );
-
-  blendEquations->Set( v8::String::NewFromUtf8( isolate, "equationRgb" ),   v8::Integer::New( isolate, equationRgb) );
-  blendEquations->Set( v8::String::NewFromUtf8( isolate, "equationAlpha" ), v8::Integer::New( isolate, equationAlpha ) );
-
-  args.GetReturnValue().Set( blendEquations );
-}
-
 } // namespace V8Plugin
 
 } // namespace Dali