[dali_1.1.29] Merge branch 'devel/master' 26/65326/1
authorXiangyin Ma <x1.ma@samsung.com>
Fri, 8 Apr 2016 10:25:14 +0000 (11:25 +0100)
committerXiangyin Ma <x1.ma@samsung.com>
Fri, 8 Apr 2016 10:25:14 +0000 (11:25 +0100)
Change-Id: I10e304291306a3ff634c2423a686d53ffbb92c8f

53 files changed:
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-MultiLanguage.cpp
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-RendererFactory.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-ToolBar.cpp
dali-toolkit/devel-api/controls/popup/confirmation-popup.cpp
dali-toolkit/devel-api/controls/shadow-view/shadow-view.h
dali-toolkit/devel-api/shader-effects/motion-blur-effect.h
dali-toolkit/devel-api/shader-effects/motion-stretch-effect.h
dali-toolkit/internal/accessibility-manager/accessibility-manager-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.cpp
dali-toolkit/internal/controls/bubble-effect/bubble-emitter-impl.h
dali-toolkit/internal/controls/bubble-effect/color-adjuster.h
dali-toolkit/internal/controls/buttons/button-impl.cpp
dali-toolkit/internal/controls/buttons/push-button-impl.cpp
dali-toolkit/internal/controls/buttons/radio-button-impl.h
dali-toolkit/internal/controls/magnifier/magnifier-impl.h
dali-toolkit/internal/controls/model3d-view/model3d-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/popup/confirmation-popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.cpp
dali-toolkit/internal/controls/popup/popup-impl.h
dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.cpp
dali-toolkit/internal/controls/renderers/gradient/gradient-renderer.h
dali-toolkit/internal/controls/slider/slider-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h
dali-toolkit/internal/controls/text-controls/text-selection-toolbar-impl.cpp
dali-toolkit/internal/controls/tool-bar/tool-bar-impl.cpp
dali-toolkit/internal/text/clipping/text-clipper.cpp
dali-toolkit/internal/text/clipping/text-clipper.h
dali-toolkit/internal/text/decorator/text-decorator.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/multi-language-support-impl.h
dali-toolkit/public-api/accessibility-manager/accessibility-manager.h
dali-toolkit/public-api/controls/buttons/button.cpp
dali-toolkit/public-api/controls/buttons/push-button.cpp
dali-toolkit/public-api/controls/control-impl.cpp
dali-toolkit/public-api/controls/default-controls/solid-color-actor.cpp
dali-toolkit/public-api/controls/default-controls/solid-color-actor.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/styles/480x800/dali-toolkit-default-theme.json
dali-toolkit/styles/720x1280/dali-toolkit-default-theme.json
dali-toolkit/styles/images-common/B16-8_TTS_focus.9.png [new file with mode: 0644]
dali-toolkit/styles/images-common/B16-8_TTS_focus.png [deleted file]
doc/dali-toolkit-doc.h
docs/content/images/dali-modules.png [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/control-renderers.md
packaging/dali-toolkit.spec

index 7fc8f71..eea51a6 100644 (file)
@@ -1243,15 +1243,26 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
   const std::string pathName( pathNamePtr );
   free( pathNamePtr );
 
+  const PointSize26Dot6 pointSize01 = static_cast<PointSize26Dot6>( 21.f * 64.f );
+  const PointSize26Dot6 pointSize02 = static_cast<PointSize26Dot6>( 35.f * 64.f );
+
   // Load some fonts.
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansArabicRegular.ttf" );
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf" );
   fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenColorEmoji.ttf", EMOJI_FONT_SIZE );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf", pointSize01 );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansRegular.ttf", pointSize02 );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf", pointSize01 );
+  fontClient.GetFontId( pathName + DEFAULT_FONT_DIR + "/tizen/TizenSansHebrewRegular.ttf", pointSize02 );
 
   // Font id 1 --> TizenSansArabicRegular.ttf
   // Font id 2 --> TizenSansHebrewRegular.ttf
   // Font id 3 --> TizenColorEmoji.ttf
-  // Font id 4 --> (default)
+  // Font id 4 --> TizenSansRegular.ttf, size 8
+  // Font id 5 --> TizenSansRegular.ttf, size 16
+  // Font id 6 --> TizenSansHebrewRegular.ttf, size 8
+  // Font id 7 --> TizenSansHebrewRegular.ttf, size 16
+  // Font id 8 --> (default)
 
   Vector<FontRun> fontRuns01;
   Vector<FontDescriptionRun> fontDescriptions01;
@@ -1262,7 +1273,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
       0u,
       11u
     },
-    4u
+    8u
   };
   Vector<FontRun> fontRuns02;
   fontRuns02.PushBack( fontRun0201 );
@@ -1294,7 +1305,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
       0u,
       12u
     },
-    4u
+    8u
   };
   FontRun fontRun0302 =
   {
@@ -1302,7 +1313,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
       12u,
       12u
     },
-    4u
+    8u
   };
   FontRun fontRun0303 =
   {
@@ -1310,7 +1321,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
       24u,
       4u
     },
-    4u
+    8u
   };
   Vector<FontRun> fontRuns03;
   fontRuns03.PushBack( fontRun0301 );
@@ -1333,7 +1344,7 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
       4u,
       1u
     },
-    4u
+    8u
   };
   FontRun fontRun0703 =
   {
@@ -1433,6 +1444,122 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
   };
   fontDescriptions09.PushBack( fontDescription0901 );
 
+  FontRun fontRun1001 =
+  {
+    {
+      0u,
+      13u
+    },
+    4u
+  };
+  FontRun fontRun1002 =
+  {
+    {
+      13u,
+      9u
+    },
+    6u
+  };
+  FontRun fontRun1003 =
+  {
+    {
+      22u,
+      15u
+    },
+    5u
+  };
+  FontRun fontRun1004 =
+  {
+    {
+      37u,
+      9u
+    },
+    7u
+  };
+  Vector<FontRun> fontRuns10;
+  fontRuns10.PushBack( fontRun1001 );
+  fontRuns10.PushBack( fontRun1002 );
+  fontRuns10.PushBack( fontRun1003 );
+  fontRuns10.PushBack( fontRun1004 );
+
+  FontDescriptionRun fontDescription1001 =
+  {
+    {
+      0u,
+      13u
+    },
+    const_cast<char*>( "TizenSans" ),
+    9u,
+    TextAbstraction::FontWeight::NORMAL,
+    TextAbstraction::FontWidth::NORMAL,
+    TextAbstraction::FontSlant::NORMAL,
+    pointSize01,
+    true,
+    false,
+    false,
+    false,
+    true
+  };
+  FontDescriptionRun fontDescription1002 =
+  {
+    {
+      13u,
+      9u
+    },
+    const_cast<char*>( "TizenSansHebrew" ),
+    15u,
+    TextAbstraction::FontWeight::NORMAL,
+    TextAbstraction::FontWidth::NORMAL,
+    TextAbstraction::FontSlant::NORMAL,
+    pointSize01,
+    true,
+    false,
+    false,
+    false,
+    true
+  };
+  FontDescriptionRun fontDescription1003 =
+  {
+    {
+      22u,
+      15u
+    },
+    const_cast<char*>( "TizenSans" ),
+    9u,
+    TextAbstraction::FontWeight::NORMAL,
+    TextAbstraction::FontWidth::NORMAL,
+    TextAbstraction::FontSlant::NORMAL,
+    pointSize02,
+    true,
+    false,
+    false,
+    false,
+    true
+  };
+  FontDescriptionRun fontDescription1004 =
+  {
+    {
+      37u,
+      9u
+    },
+    const_cast<char*>( "TizenSansHebrew" ),
+    15u,
+    TextAbstraction::FontWeight::NORMAL,
+    TextAbstraction::FontWidth::NORMAL,
+    TextAbstraction::FontSlant::NORMAL,
+    pointSize02,
+    true,
+    false,
+    false,
+    false,
+    true
+  };
+  Vector<FontDescriptionRun> fontDescriptions10;
+  fontDescriptions10.PushBack( fontDescription1001 );
+  fontDescriptions10.PushBack( fontDescription1002 );
+  fontDescriptions10.PushBack( fontDescription1003 );
+  fontDescriptions10.PushBack( fontDescription1004 );
+
   const ValidateFontsData data[] =
   {
     {
@@ -1525,8 +1652,18 @@ int UtcDaliTextMultiLanguageValidateFonts01(void)
       fontDescriptions09,
       fontRuns09
     },
+    {
+      "Mix text. Default font: latin. Different font sizes",
+      "Hello world, שלום עולם, hello world, שלום עולם",
+      "/tizen/TizenSansRegular.ttf",
+      TextAbstraction::FontClient::DEFAULT_POINT_SIZE,
+      0u,
+      46u,
+      fontDescriptions10,
+      fontRuns10
+    },
   };
-  const unsigned int numberOfTests = 9u;
+  const unsigned int numberOfTests = 10u;
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
index 2163a19..588c7c5 100644 (file)
@@ -450,21 +450,12 @@ int UtcDaliControlBackgroundProperties(void)
   DALI_TEST_EQUALS( control.GetBackgroundColor(), Color::TRANSPARENT, TEST_LOCATION );
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND ).Get< Property::Map >().Empty() );
 
-  Property::Map colorMap;
-  colorMap["color"] = Color::RED;
-  control.SetProperty( Control::Property::BACKGROUND, colorMap );
-  Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
-  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 );
-
   Property::Map imageMap;
-  imageMap[ "filename" ] = "TestImage";
+  imageMap[ "rendererType" ] = "image";
+  imageMap[ "imageUrl" ] = "TestImage";
   control.SetProperty( Control::Property::BACKGROUND, imageMap );
-  propValue = control.GetProperty( Control::Property::BACKGROUND );
-  resultMap = propValue.GetMap();
+  Property::Value propValue = control.GetProperty( Control::Property::BACKGROUND );
+  Property::Map* resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "rendererType" ) );
   DALI_TEST_CHECK( resultMap->Find( "rendererType" )->Get<std::string>() == "image" );
   DALI_TEST_CHECK( resultMap->Find( "imageUrl" ) );
@@ -490,7 +481,10 @@ int UtcDaliControlBackgroundProperties(void)
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >() == Color::YELLOW );
   DALI_TEST_CHECK( control.GetProperty( Control::Property::BACKGROUND_COLOR ).Get< Vector4 >() == control.GetBackgroundColor() );
   control.ClearBackground();
-  control.SetProperty( Control::Property::BACKGROUND_IMAGE, imageMap );
+
+  Property::Map deprecatedImageMap;
+  deprecatedImageMap[ "filename" ] = "TestImage";
+  control.SetProperty( Control::Property::BACKGROUND_IMAGE, deprecatedImageMap );
   propValue = control.GetProperty( Control::Property::BACKGROUND_IMAGE );
   resultMap = propValue.GetMap();
   DALI_TEST_CHECK( resultMap->Find( "imageUrl" )->Get< std::string >() == "TestImage" );
index 5010576..28bb29a 100644 (file)
@@ -153,13 +153,13 @@ int UtcDaliControlRendererSize(void)
   propertyMap.Insert("rendererType",  "gradient");
   Vector2 start(-1.f, -1.f);
   Vector2 end(1.f, 1.f);
-  propertyMap.Insert("gradientStartPosition",   start);
-  propertyMap.Insert("gradientEndPosition",   end);
-  propertyMap.Insert("gradientStopOffset",   Vector2(0.f, 1.f));
+  propertyMap.Insert("startPosition",   start);
+  propertyMap.Insert("endPosition",   end);
+  propertyMap.Insert("stopOffset",   Vector2(0.f, 1.f));
   Property::Array stopColors;
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::GREEN );
-  propertyMap.Insert("gradientStopColor",   stopColors);
+  propertyMap.Insert("stopColor",   stopColors);
   ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap);
   gradientRenderer.SetSize( rendererSize );
   DALI_TEST_EQUALS( gradientRenderer.GetSize(), rendererSize, TEST_LOCATION );
@@ -345,16 +345,16 @@ int UtcDaliControlRendererGetPropertyMap3(void)
 
   Vector2 start(-1.f, -1.f);
   Vector2 end(1.f, 1.f);
-  propertyMap.Insert("gradientStartPosition",   start);
-  propertyMap.Insert("gradientEndPosition",   end);
-  propertyMap.Insert("gradientSpreadMethod",   "repeat");
+  propertyMap.Insert("startPosition",   start);
+  propertyMap.Insert("endPosition",   end);
+  propertyMap.Insert("spreadMethod",   "repeat");
 
-  propertyMap.Insert("gradientStopOffset",   Vector2(0.2f, 0.8f));
+  propertyMap.Insert("stopOffset",   Vector2(0.2f, 0.8f));
 
   Property::Array stopColors;
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::GREEN );
-  propertyMap.Insert("gradientStopColor",   stopColors);
+  propertyMap.Insert("stopColor",   stopColors);
 
   ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap);
 
@@ -366,30 +366,30 @@ int UtcDaliControlRendererGetPropertyMap3(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == "gradient" );
 
-  value = resultMap.Find( "gradientUnits",  Property::STRING );
+  value = resultMap.Find( "units",  Property::STRING );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == "objectBoundingBox" );
 
-  value = resultMap.Find( "gradientSpreadMethod",   Property::STRING );
+  value = resultMap.Find( "spreadMethod",   Property::STRING );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == "repeat" );
 
-  value = resultMap.Find( "gradientStartPosition",   Property::VECTOR2 );
+  value = resultMap.Find( "startPosition",   Property::VECTOR2 );
   DALI_TEST_CHECK( value );
   DALI_TEST_EQUALS( value->Get<Vector2>(), start , Math::MACHINE_EPSILON_100, TEST_LOCATION );
 
-  value = resultMap.Find( "gradientEndPosition",   Property::VECTOR2 );
+  value = resultMap.Find( "endPosition",   Property::VECTOR2 );
   DALI_TEST_CHECK( value );
   DALI_TEST_EQUALS( value->Get<Vector2>(), end , Math::MACHINE_EPSILON_100, TEST_LOCATION );
 
-  value = resultMap.Find( "gradientStopOffset",   Property::ARRAY );
+  value = resultMap.Find( "stopOffset",   Property::ARRAY );
   DALI_TEST_CHECK( value );
   Property::Array* offsetArray = value->GetArray();
   DALI_TEST_CHECK( offsetArray->Count() == 2 );
   DALI_TEST_EQUALS( offsetArray->GetElementAt(0).Get<float>(), 0.2f , Math::MACHINE_EPSILON_100, TEST_LOCATION );
   DALI_TEST_EQUALS( offsetArray->GetElementAt(1).Get<float>(), 0.8f , Math::MACHINE_EPSILON_100, TEST_LOCATION );
 
-  value = resultMap.Find( "gradientStopColor",   Property::ARRAY );
+  value = resultMap.Find( "stopColor",   Property::ARRAY );
   DALI_TEST_CHECK( value );
   Property::Array* colorArray = value->GetArray();
   DALI_TEST_CHECK( colorArray->Count() == 2 );
@@ -412,16 +412,16 @@ int UtcDaliControlRendererGetPropertyMap4(void)
 
   Vector2 center(100.f, 100.f);
   float radius = 100.f;
-  propertyMap.Insert("gradientUnits",  "userSpace");
-  propertyMap.Insert("gradientCenter",  center);
-  propertyMap.Insert("gradientRadius",  radius);
-  propertyMap.Insert("gradientStopOffset",   Vector3(0.1f, 0.3f, 1.1f));
+  propertyMap.Insert("units",  "userSpace");
+  propertyMap.Insert("center",  center);
+  propertyMap.Insert("radius",  radius);
+  propertyMap.Insert("stopOffset",   Vector3(0.1f, 0.3f, 1.1f));
 
   Property::Array stopColors;
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::BLACK );
   stopColors.PushBack( Color::GREEN );
-  propertyMap.Insert("gradientStopColor",   stopColors);
+  propertyMap.Insert("stopColor",   stopColors);
 
   ControlRenderer gradientRenderer = factory.GetControlRenderer(propertyMap);
   DALI_TEST_CHECK( gradientRenderer );
@@ -434,23 +434,23 @@ int UtcDaliControlRendererGetPropertyMap4(void)
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == "gradient" );
 
-  value = resultMap.Find( "gradientUnits",  Property::STRING );
+  value = resultMap.Find( "units",  Property::STRING );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == "userSpace" );
 
-  value = resultMap.Find( "gradientSpreadMethod",   Property::STRING );
+  value = resultMap.Find( "spreadMethod",   Property::STRING );
   DALI_TEST_CHECK( value );
   DALI_TEST_CHECK( value->Get<std::string>() == "pad" );
 
-  value = resultMap.Find( "gradientCenter",  Property::VECTOR2 );
+  value = resultMap.Find( "center",  Property::VECTOR2 );
   DALI_TEST_CHECK( value );
   DALI_TEST_EQUALS( value->Get<Vector2>(), center , Math::MACHINE_EPSILON_100, TEST_LOCATION );
 
-  value = resultMap.Find( "gradientRadius",  Property::FLOAT );
+  value = resultMap.Find( "radius",  Property::FLOAT );
   DALI_TEST_CHECK( value );
   DALI_TEST_EQUALS( value->Get<float>(), radius , Math::MACHINE_EPSILON_100, TEST_LOCATION );
 
-  value = resultMap.Find( "gradientStopOffset",   Property::ARRAY );
+  value = resultMap.Find( "stopOffset",   Property::ARRAY );
   DALI_TEST_CHECK( value );
   Property::Array* offsetArray = value->GetArray();
   DALI_TEST_CHECK( offsetArray->Count() == 3 );
@@ -459,7 +459,7 @@ int UtcDaliControlRendererGetPropertyMap4(void)
   // any stop value will be clamped to [0.0, 1.0];
   DALI_TEST_EQUALS( offsetArray->GetElementAt(2).Get<float>(), 1.0f , Math::MACHINE_EPSILON_100, TEST_LOCATION );
 
-  value = resultMap.Find( "gradientStopColor",   Property::ARRAY );
+  value = resultMap.Find( "stopColor",   Property::ARRAY );
   DALI_TEST_CHECK( value );
   Property::Array* colorArray = value->GetArray();
   DALI_TEST_CHECK( colorArray->Count() == 3 );
index 98cf674..6707da6 100644 (file)
@@ -444,19 +444,19 @@ int UtcDaliRendererFactoryGetLinearGradientRenderer(void)
 
   Vector2 start(-1.f, -1.f);
   Vector2 end(1.f, 1.f);
-  propertyMap.Insert("gradientStartPosition",   start);
-  propertyMap.Insert("gradientEndPosition",   end);
-  propertyMap.Insert("gradientSpreadMethod",   "repeat");
+  propertyMap.Insert("startPosition",   start);
+  propertyMap.Insert("endPosition",   end);
+  propertyMap.Insert("spreadMethod",   "repeat");
 
   Property::Array stopOffsets;
   stopOffsets.PushBack( 0.2f );
   stopOffsets.PushBack( 0.8f );
-  propertyMap.Insert("gradientStopOffset",   stopOffsets);
+  propertyMap.Insert("stopOffset",   stopOffsets);
 
   Property::Array stopColors;
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::GREEN );
-  propertyMap.Insert("gradientStopColor",   stopColors);
+  propertyMap.Insert("stopColor",   stopColors);
 
   ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
@@ -484,19 +484,19 @@ int UtcDaliRendererFactoryGetRadialGradientRenderer(void)
 
   Vector2 center(100.f, 100.f);
   float radius = 100.f;
-  propertyMap.Insert("gradientUnits",  "userSpace");
-  propertyMap.Insert("gradientCenter",  center);
-  propertyMap.Insert("gradientRadius",  radius);
+  propertyMap.Insert("units",  "userSpace");
+  propertyMap.Insert("center",  center);
+  propertyMap.Insert("radius",  radius);
 
   Property::Array stopOffsets;
   stopOffsets.PushBack( 0.0f );
   stopOffsets.PushBack( 1.f );
-  propertyMap.Insert("gradientStopOffset",   stopOffsets);
+  propertyMap.Insert("stopOffset",   stopOffsets);
 
   Property::Array stopColors;
   stopColors.PushBack( Color::RED );
   stopColors.PushBack( Color::GREEN );
-  propertyMap.Insert("gradientStopColor",   stopColors);
+  propertyMap.Insert("stopColor",   stopColors);
 
   ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
   DALI_TEST_CHECK( controlRenderer );
@@ -516,6 +516,41 @@ int UtcDaliRendererFactoryGetRadialGradientRenderer(void)
   END_TEST;
 }
 
+int UtcDaliRendererFactoryDefaultOffsetsGradientRenderer(void)
+{
+  ToolkitTestApplication application;
+  tet_infoline("UtcDaliRendererFactoryGetRadialGradientRenderer");
+
+  RendererFactory factory = RendererFactory::Get();
+  DALI_TEST_CHECK( factory );
+
+  Property::Map propertyMap;
+  propertyMap.Insert("rendererType",  "gradient");
+
+  Vector2 start(-1.f, -1.f);
+  Vector2 end(1.f, 1.f);
+  propertyMap.Insert("startPosition",   start);
+  propertyMap.Insert("endPosition",   end);
+  propertyMap.Insert("spreadMethod",   "repeat");
+
+  Property::Array stopColors;
+  stopColors.PushBack( Color::RED );
+  stopColors.PushBack( Color::GREEN );
+  propertyMap.Insert("stopColor",   stopColors);
+
+  ControlRenderer controlRenderer = factory.GetControlRenderer(propertyMap);
+  DALI_TEST_CHECK( controlRenderer );
+
+  // A lookup texture is generated and pass to shader as sampler
+  Actor actor = Actor::New();
+  TestControlRendererRender( application, actor, controlRenderer, 1u );
+
+  controlRenderer.SetOffStage( actor );
+  DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
+
+  END_TEST;
+}
+
 int UtcDaliRendererFactoryGetImageRenderer1(void)
 {
   ToolkitTestApplication application;
@@ -537,6 +572,9 @@ int UtcDaliRendererFactoryGetImageRenderer1(void)
 
   const int width=512;
   const int height=513;
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
 
   Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height,width, height );
@@ -545,10 +583,7 @@ int UtcDaliRendererFactoryGetImageRenderer1(void)
                              ImageDimensions(width, height),
                              Integration::ResourcePointer( bitmap ) );
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  int textureUnit = -1;
-  DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-  DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
   controlRenderer.SetOffStage( actor );
   DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
@@ -577,14 +612,15 @@ int UtcDaliRendererFactoryGetImageRenderer2(void)
   Integration::Bitmap* bitmap = Integration::Bitmap::New( Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD );
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, width, height,width, height );
 
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
   TestControlRendererRender( application, actor, controlRenderer, 1u,
                              ImageDimensions(width, height),
                              Integration::ResourcePointer(bitmap) );
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  int textureUnit = -1;
-  DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-  DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -614,14 +650,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer1(void)
     DALI_TEST_CHECK( controlRenderer );
 
     Actor actor = Actor::New();
+
+    TestGlAbstraction& gl = application.GetGlAbstraction();
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
+
     TestControlRendererRender( application, actor, controlRenderer, 1u,
                                ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
                                ninePatchResource );
 
-    TestGlAbstraction& gl = application.GetGlAbstraction();
-    int textureUnit = -1;
-    DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-    DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+    DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
   }
 
   propertyMap.Insert( "borderOnly",  true );
@@ -631,14 +669,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer1(void)
     DALI_TEST_CHECK( controlRenderer );
 
     Actor actor = Actor::New();
+
+    TestGlAbstraction& gl = application.GetGlAbstraction();
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
+
     TestControlRendererRender( application, actor, controlRenderer, 1u,
                                ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
                                ninePatchResource );
 
-    TestGlAbstraction& gl = application.GetGlAbstraction();
-    int textureUnit = -1;
-    DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-    DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+    DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
   }
 
   END_TEST;
@@ -673,14 +713,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer2(void)
     DALI_TEST_CHECK( controlRenderer );
 
     Actor actor = Actor::New();
+    TestGlAbstraction& gl = application.GetGlAbstraction();
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
+
     TestControlRendererRender( application, actor, controlRenderer, 1u,
                                ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
                                ninePatchResource );
 
-    TestGlAbstraction& gl = application.GetGlAbstraction();
-    int textureUnit = -1;
-    DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-    DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+
+    DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
     controlRenderer.SetOffStage( actor );
     DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
@@ -692,15 +734,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer2(void)
     ControlRenderer controlRenderer = factory.GetControlRenderer( propertyMap );
     DALI_TEST_CHECK( controlRenderer );
 
+    TestGlAbstraction& gl = application.GetGlAbstraction();
+    TraceCallStack& textureTrace = gl.GetTextureTrace();
+    textureTrace.Enable(true);
     Actor actor = Actor::New();
     TestControlRendererRender( application, actor, controlRenderer, 1u,
                                ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
                                ninePatchResource );
 
-    TestGlAbstraction& gl = application.GetGlAbstraction();
-    int textureUnit = -1;
-    DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-    DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+
+    DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
     controlRenderer.SetOffStage( actor );
     DALI_TEST_CHECK( actor.GetRendererCount() == 0u );
@@ -729,14 +772,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer3(void)
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
   TestControlRendererRender( application, actor, controlRenderer, 1u,
                              ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
                              ninePatchResource );
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  int textureUnit = -1;
-  DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-  DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -766,14 +811,16 @@ int UtcDaliRendererFactoryGetNPatchRenderer4(void)
   DALI_TEST_CHECK( controlRenderer );
 
   Actor actor = Actor::New();
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
   TestControlRendererRender( application, actor, controlRenderer, 1u,
                              ImageDimensions(ninePatchImageWidth, ninePatchImageHeight),
                              ninePatchResource );
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  int textureUnit = -1;
-  DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-  DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -796,14 +843,16 @@ int UtcDaliRendererFactoryGetNPatchRendererN1(void)
   //The testkit still has to load a bitmap for the broken renderer image
   Integration::Bitmap* bitmap = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD);
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 100, 100, 100, 100 );
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
   TestControlRendererRender( application, actor, controlRenderer, 1u,
                              ImageDimensions(),
                              Integration::ResourcePointer(bitmap) );
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  int textureUnit = -1;
-  DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-  DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -830,14 +879,16 @@ int UtcDaliRendererFactoryGetNPatchRendererN2(void)
   //The testkit still has to load a bitmap for the broken renderer image
   Integration::Bitmap* bitmap = Integration::Bitmap::New(Integration::Bitmap::BITMAP_2D_PACKED_PIXELS, ResourcePolicy::OWNED_DISCARD);
   bitmap->GetPackedPixelsProfile()->ReserveBuffer( Pixel::RGBA8888, 100, 100, 100, 100 );
+
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
   TestControlRendererRender( application, actor, controlRenderer, 1u,
                              ImageDimensions(),
                              Integration::ResourcePointer(bitmap) );
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  int textureUnit = -1;
-  DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-  DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
   END_TEST;
 }
@@ -851,6 +902,10 @@ int UtcDaliRendererFactoryGetSvgRenderer(void)
   ControlRenderer controlRenderer = factory.GetControlRenderer( TEST_SVG_FILE_NAME );
   DALI_TEST_CHECK( controlRenderer );
 
+  TestGlAbstraction& gl = application.GetGlAbstraction();
+  TraceCallStack& textureTrace = gl.GetTextureTrace();
+  textureTrace.Enable(true);
+
   Actor actor = Actor::New();
   actor.SetSize( 200.f, 200.f );
   Stage::GetCurrent().Add( actor );
@@ -872,14 +927,12 @@ int UtcDaliRendererFactoryGetSvgRenderer(void)
   DALI_TEST_CHECK( actor.GetRendererCount() == 1u );
   DALI_TEST_CHECK( actor.GetRendererAt(0u).GetMaterial().GetNumberOfTextures() == 1 );
 
+
   // waiting for the resource uploading
   application.SendNotification();
   application.Render();
 
-  TestGlAbstraction& gl = application.GetGlAbstraction();
-  int textureUnit = -1;
-  DALI_TEST_CHECK( gl.GetUniformValue< int >( "sTexture", textureUnit ) );
-  DALI_TEST_EQUALS( textureUnit, 0, TEST_LOCATION );
+  DALI_TEST_EQUALS( textureTrace.FindMethod("BindTexture"), true, TEST_LOCATION );
 
   END_TEST;
 }
index 61fba59..ee941cc 100644 (file)
@@ -812,7 +812,7 @@ int UtcDaliToolkitScrollViewSignalsUpdate(void)
   scrollView.ScrollUpdatedSignal().Connect( &OnScrollUpdate );
   scrollView.ScrollCompletedSignal().Connect( &OnScrollComplete );
 
-  ImageActor image = CreateSolidColorActor( Color::RED );
+  Actor image = Actor::New();
   image.SetSize(stageSize);
   image.SetParentOrigin(ParentOrigin::TOP_LEFT);
   image.SetAnchorPoint(AnchorPoint::TOP_LEFT);
index fc49de9..4bb5f56 100644 (file)
@@ -545,8 +545,7 @@ int utcDaliTextEditorEvent02(void)
   DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
 
   Actor offscreenImage = editor.GetChildAt( 2u );
-  ImageActor imageActor = ImageActor::DownCast( offscreenImage );
-  DALI_TEST_CHECK( imageActor );
+  DALI_TEST_CHECK( offscreenImage );
 
   // Create a tap event to touch the text editor.
   application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
index 31e5126..982dffe 100644 (file)
@@ -669,8 +669,7 @@ int utcDaliTextFieldEvent02(void)
   DALI_TEST_EQUALS( offscreenRoot.GetChildCount(), 1u, TEST_LOCATION ); // The camera actor.
 
   Actor offscreenImage = field.GetChildAt( 2u );
-  ImageActor imageActor = ImageActor::DownCast( offscreenImage );
-  DALI_TEST_CHECK( imageActor );
+  DALI_TEST_CHECK( offscreenImage );
 
   // Create a tap event to touch the text field.
   application.ProcessEvent( GenerateTap( Gesture::Possible, 1u, 1u, Vector2( 150.0f, 25.0f ) ) );
index 36e8f8c..fec7948 100644 (file)
@@ -21,6 +21,7 @@
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-toolkit/devel-api/controls/tool-bar/tool-bar.h>
+#include <dali-toolkit/devel-api/controls/renderer-factory/renderer-factory.h>
 
 using namespace Dali;
 using namespace Toolkit;
@@ -33,6 +34,18 @@ static void TestCallback(BaseHandle handle)
 {
   gObjectCreatedCallBackCalled = true;
 }
+
+Actor CreateColorActor( const Vector4& color )
+{
+  Actor solidColorActor = Actor::New();
+
+  RendererFactory factory = RendererFactory::Get();
+  ControlRenderer colorRenderer = factory.GetControlRenderer( color );
+  colorRenderer.SetOnStage( solidColorActor );
+
+  return solidColorActor;
+}
+
 } // namespace
 
 void dali_toolbar_startup(void)
@@ -88,15 +101,15 @@ int UtcDaliToolBarAddControl01(void)
 
   try
   {
-    ImageActor control1 = CreateSolidColorActor( Color::RED );
+    Actor control1 = CreateColorActor( Color::RED );
     control1.SetSize( Vector2( 100.f, 100.f ) );
-    ImageActor control2 = CreateSolidColorActor( Color::RED );
+    Actor control2 = CreateColorActor( Color::RED );
     control2.SetSize( Vector2( 100.f, 100.f ) );
-    ImageActor control3 = CreateSolidColorActor( Color::RED );
+    Actor control3 = CreateColorActor( Color::RED );
     control3.SetSize( Vector2( 100.f, 100.f ) );
-    ImageActor control4 = CreateSolidColorActor( Color::RED );
+    Actor control4 = CreateColorActor( Color::RED );
     control4.SetSize( Vector2( 100.f, 100.f ) );
-    ImageActor control5 = CreateSolidColorActor( Color::RED );
+    Actor control5 = CreateColorActor( Color::RED );
     control5.SetSize( Vector2( 100.f, 100.f ) );
 
     ToolBar toolbar = ToolBar::New();
@@ -113,11 +126,11 @@ int UtcDaliToolBarAddControl01(void)
     toolbar.AddControl( control4, 0.1f, Alignment::HorizontalCenter, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
     toolbar.AddControl( control5, 0.1f, Alignment::HorizontalRight, Alignment::Padding( 1.f, 1.f, 1.f, 1.f ) );
 
-    ImageActor control6 = CreateSolidColorActor( Color::RED );
+    Actor control6 = CreateColorActor( Color::RED );
     control6.SetSize( Vector2( 100.f, 100.f ) );
-    ImageActor control7 = CreateSolidColorActor( Color::RED );
+    Actor control7 = CreateColorActor( Color::RED );
     control7.SetSize( Vector2( 100.f, 100.f ) );
-    ImageActor control8 = CreateSolidColorActor( Color::RED );
+    Actor control8 = CreateColorActor( Color::RED );
     control8.SetSize( Vector2( 100.f, 100.f ) );
 
     application.Render();
@@ -147,7 +160,7 @@ int UtcDaliToolBarAddControl02(void)
 
   try
   {
-    ImageActor control = CreateSolidColorActor( Color::RED );
+    Actor control = CreateColorActor( Color::RED );
 
     ToolBar toolbar = ToolBar::New();
 
@@ -177,7 +190,7 @@ int UtcDaliToolBarRemoveControl01(void)
 
   try
   {
-    ImageActor control = CreateSolidColorActor( Color::RED );
+    Actor control = CreateColorActor( Color::RED );
 
     ToolBar toolbar = ToolBar::New();
     toolbar.AddControl( control, 0.1f, Alignment::HorizontalLeft );
@@ -200,8 +213,8 @@ int UtcDaliToolBarRemoveControl02(void)
 
   try
   {
-    ImageActor control01 = CreateSolidColorActor( Color::RED );
-    ImageActor control02 = CreateSolidColorActor( Color::RED );
+    Actor control01 = CreateColorActor( Color::RED );
+    Actor control02 = CreateColorActor( Color::RED );
 
     ToolBar toolbar01 = ToolBar::New();
     ToolBar toolbar02 = ToolBar::New();
@@ -222,7 +235,7 @@ int UtcDaliToolBarRemoveControl02(void)
 
   try
   {
-    ImageActor control = CreateSolidColorActor( Color::RED );
+    Actor control = CreateColorActor( Color::RED );
 
     ToolBar toolbar = ToolBar::New();
     toolbar.AddControl( control, 0.1f, Alignment::HorizontalLeft );
index de7e116..686e81a 100644 (file)
@@ -22,7 +22,6 @@
 // INTERNAL INCLUDES
 
 #include <dali-toolkit/internal/controls/popup/confirmation-popup-impl.h>
-#include <dali/public-api/actors/image-actor.h>
 
 using namespace Dali;
 
index 9ddea7c..188c3c3 100644 (file)
@@ -18,9 +18,6 @@
  *
  */
 
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
-
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
 
index 2151444..310e3ce 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/shader-effects/shader-effect.h>
 
 namespace Dali
index 332fa48..326c7bd 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/shader-effects/shader-effect.h>
 
 namespace Dali
index 7a5ad48..a3eac2c 100644 (file)
@@ -31,6 +31,7 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
 namespace Dali
 {
@@ -57,8 +58,7 @@ Debug::Filter* gLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_FOC
 const char* const ACTOR_FOCUSABLE("focusable");
 const char* const IS_FOCUS_GROUP("isFocusGroup");
 
-const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.png";
-const Vector4 FOCUS_BORDER_IMAGE_BORDER = Vector4(7.0f, 7.0f, 7.0f, 7.0f);
+const char* FOCUS_BORDER_IMAGE_PATH = DALI_IMAGE_DIR "B16-8_TTS_focus.9.png";
 
 const char* FOCUS_SOUND_FILE = DALI_SOUND_DIR "Focus.ogg";
 const char* FOCUS_CHAIN_END_SOUND_FILE = DALI_SOUND_DIR "End_of_List.ogg";
@@ -663,12 +663,8 @@ void AccessibilityManager::SetFocusable(Actor actor, bool focusable)
 void AccessibilityManager::CreateDefaultFocusIndicatorActor()
 {
   // Create a focus indicator actor shared by all the focusable actors
-  Image borderImage = ResourceImage::New(FOCUS_BORDER_IMAGE_PATH);
-
-  ImageActor focusIndicator = ImageActor::New(borderImage);
+  Toolkit::ImageView focusIndicator = Toolkit::ImageView::New(FOCUS_BORDER_IMAGE_PATH);
   focusIndicator.SetParentOrigin( ParentOrigin::CENTER );
-  focusIndicator.SetStyle( ImageActor::STYLE_NINE_PATCH );
-  focusIndicator.SetNinePatchBorder(FOCUS_BORDER_IMAGE_BORDER);
   focusIndicator.SetPosition(Vector3(0.0f, 0.0f, 1.0f));
 
   // Apply size constraint to the focus indicator
index cc42f64..ea3f7e5 100644 (file)
@@ -22,7 +22,6 @@
 #include <sstream>
 #include <cmath>
 #include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/render-tasks/render-task.h>
 
 // INTERNAL INCLUDES
index 1f5b966..392fa9c 100644 (file)
@@ -27,6 +27,8 @@
 #include <dali-toolkit/internal/controls/bubble-effect/bubble-actor.h>
 #include <dali-toolkit/internal/controls/bubble-effect/color-adjuster.h>
 #include <dali-toolkit/internal/controls/bubble-effect/bubble-effect.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+
 
 namespace
 {
@@ -174,13 +176,15 @@ void BubbleEmitter::SetBackground( Image bgImage, const Vector3& hsvDelta )
   mBackgroundImage = bgImage;
   mHSVDelta = hsvDelta;
 
-  ImageActor sourceActor = ImageActor::New( bgImage );
+  Toolkit::ImageView sourceActor = Toolkit::ImageView::New( bgImage );
   sourceActor.SetSize( mMovementArea );
   sourceActor.SetParentOrigin(ParentOrigin::CENTER);
-  Stage::GetCurrent().Add( sourceActor );
 
-  ShaderEffect colorAdjuster = CreateColorAdjuster( hsvDelta, true /*ignore alpha to make bubble color always*/ );
-  sourceActor.SetShaderEffect( colorAdjuster );
+  Property::Map colorAdjuster = CreateColorAdjuster();
+  sourceActor.SetProperty( Toolkit::ImageView::Property::IMAGE, colorAdjuster);
+  SetColorAdjusterProperties( sourceActor, hsvDelta, true /*ignore alpha to make bubble color always*/ );
+
+  Stage::GetCurrent().Add( sourceActor );
 
   RenderTaskList taskList = Stage::GetCurrent().GetRenderTaskList();
   RenderTask task = taskList.CreateTask();
@@ -231,15 +235,6 @@ void BubbleEmitter::OnRenderFinished(RenderTask& source)
 {
   mRenderTaskRunning = false;
   Actor sourceActor = source.GetSourceActor();
-  if( sourceActor )
-  {
-    ImageActor renderable = ImageActor::DownCast( sourceActor );
-    if( renderable )
-    {
-      renderable.RemoveShaderEffect();
-    }
-  }
-
   Stage stage = Stage::GetCurrent();
   stage.Remove(sourceActor);
   stage.GetRenderTaskList().RemoveTask(source);
index 37cbbb9..1509248 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/camera-actor.h>
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/images/frame-buffer-image.h>
 #include <dali/public-api/render-tasks/render-task.h>
index 8e24326..c48dfe7 100644 (file)
@@ -18,7 +18,9 @@
  *
  */
 #include <dali/public-api/math/vector3.h>
-#include <dali/public-api/shader-effects/shader-effect.h>
+#include <dali/public-api/object/property-map.h>
+
+#define DALI_COMPOSE_SHADER(STR) #STR
 
 namespace Dali
 {
@@ -29,6 +31,12 @@ namespace Toolkit
 namespace Internal
 {
 
+inline void SetColorAdjusterProperties( Actor& actor, const Vector3& hsvDelta, bool ignoreAlpha = false )
+{
+  actor.RegisterProperty( "uHSVDelta", hsvDelta );
+  actor.RegisterProperty( "uIgnoreAlpha", ignoreAlpha ? 1.f : 0.f );
+}
+
 /**
 * Creates a new ColorAdjuster effect.
 * ColorAdjuster is a custom shader effect to adjust the image color in HSV space.
@@ -36,12 +44,14 @@ namespace Internal
 * @param[in] ignoreAlpha If true, the result color will be opaque even though source has alpha value
 * @return A handle to a newly allocated Dali resource.
 */
-inline ShaderEffect CreateColorAdjuster( const Vector3& hsvDelta, bool ignoreAlpha = false )
+inline Property::Map CreateColorAdjuster()
 {
   std::string fragmentShader = DALI_COMPOSE_SHADER(
     precision highp float;\n
     uniform vec3 uHSVDelta;\n
     uniform float uIgnoreAlpha;\n
+    varying mediump vec2 vTexCoord;\n
+    uniform sampler2D sTexture;\n
     float rand(vec2 co) \n
     {\n
       return fract(sin(dot(co.xy ,vec2(12.9898,78.233))) * 43758.5453); \n}
@@ -78,11 +88,13 @@ inline ShaderEffect CreateColorAdjuster( const Vector3& hsvDelta, bool ignoreAlp
     }\n
   );
 
-  ShaderEffect shaderEffect = ShaderEffect::New("", fragmentShader);
-  shaderEffect.SetUniform( "uHSVDelta", hsvDelta );
-  shaderEffect.SetUniform( "uIgnoreAlpha", ignoreAlpha?1.0f:0.0f );
+  Property::Map customShader;
+  customShader[ "fragmentShader" ] = fragmentShader;
+
+  Property::Map map;
+  map[ "shader" ] = customShader;
 
-  return shaderEffect;
+  return map;
 }
 
 } // namespace Internal
index f8b0fb2..3132b20 100644 (file)
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/object/type-registry-helper.h>
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/devel-api/scripting/scripting.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
@@ -541,7 +539,9 @@ void Button::SetUnselectedColor( const Vector4& color )
   else
   {
     // If there is no existing content, create a new actor to use for flat color.
-    SetupContent( mUnselectedContent, CreateSolidColorActor( mUnselectedColor ) );
+    Toolkit::Control unselectedContentActor = Toolkit::Control::New();
+    unselectedContentActor.SetBackgroundColor( mUnselectedColor );
+    SetupContent( mUnselectedContent, unselectedContentActor );
     mUnselectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   }
 }
@@ -563,7 +563,9 @@ void Button::SetSelectedColor( const Vector4& color )
   else
   {
     // If there is no existing content, create a new actor to use for flat color.
-    SetupContent( mSelectedContent, CreateSolidColorActor( mSelectedColor ) );
+    Toolkit::Control selectedContentActor = Toolkit::Control::New();
+    selectedContentActor.SetBackgroundColor( mSelectedColor );
+    SetupContent( mSelectedContent, selectedContentActor );
     mSelectedContent.SetResizePolicy( ResizePolicy::FILL_TO_PARENT, Dimension::ALL_DIMENSIONS );
   }
 }
index 49d84fb..50d85e5 100644 (file)
@@ -19,7 +19,6 @@
 #include "push-button-impl.h"
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/object/type-registry-helper.h>
 #include <dali/public-api/images/resource-image.h>
index 039a2f0..34130ae 100644 (file)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/common/dali-vector.h>
 
 // INTERNAL INCLUDES
index 63d0a43..df095b0 100644 (file)
@@ -22,7 +22,6 @@
 #include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/render-tasks/render-task.h>
-#include <dali/public-api/actors/image-actor.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
index ce4169f..7799287 100644 (file)
@@ -80,28 +80,22 @@ const char* SIMPLE_VERTEX_SHADER = MAKE_SHADER(
   uniform mediump mat3 uNormalMatrix;
   uniform mediump mat4 uObjectMatrix;\n
   uniform mediump vec3 uLightPosition;\n
-  \n
+
   void main()\n
   {\n
     vec4 vertexPosition = vec4(aPosition*min(uSize.x, uSize.y), 1.0);\n
     vertexPosition = uObjectMatrix * vertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
-    \n
+
     //Illumination in Model-View space - Transform attributes and uniforms\n
-    vec4 vertPos4 = uModelView * vec4(aPosition.xyz, 1.0);\n
-    vec3 vertPos = vec3(vertPos4) / vertPos4.w;\n
-    \n
-    vec3 normalInterp = uNormalMatrix * aNormal;\n
-    \n
-    vec4 lightPos4 = uModelView * vec4(uLightPosition, 1.0);\n
-    vec3 lightPos = vec3(lightPos4) / lightPos4.w;\n
-    \n
+    vec4 vertPos = uModelView * vec4(aPosition.xyz, 1.0);\n
+    vec3 normal = uNormalMatrix * aNormal;\n
+    vec4 lightPos = uModelView * vec4(uLightPosition, 1.0);\n
     vec3 vecToLight = normalize( lightPos.xyz - vertPos.xyz );\n
-    \n
-    float lightDiffuse = dot( vecToLight, normalInterp );\n
-    lightDiffuse = max(0.0,lightDiffuse);\n
+
+    float lightDiffuse = max( dot( vecToLight, normal ), 0.0 );\n
     vIllumination = vec3(lightDiffuse * 0.5 + 0.5);\n
-    \n
+
     gl_Position = vertexPosition;\n
   }\n
 );
@@ -110,11 +104,10 @@ const char* SIMPLE_FRAGMENT_SHADER = MAKE_SHADER(
   precision mediump float;\n
   varying mediump vec3 vIllumination;\n
   uniform lowp vec4 uColor;\n
-  \n
+
   void main()\n
   {\n
-    gl_FragColor.rgb = vIllumination.rgb * uColor.rgb;\n
-    gl_FragColor.a = uColor.a;\n
+    gl_FragColor = vec4( vIllumination.rgb * uColor.rgb, uColor.a);\n
   }\n
 );
 
@@ -133,41 +126,30 @@ const char* VERTEX_SHADER = MAKE_SHADER(
   uniform mediump mat3 uNormalMatrix;
   uniform mediump mat4 uObjectMatrix;\n
   uniform mediump vec3 uLightPosition;\n
-  \n
+
   void main()
   {\n
     vec4 vertexPosition = vec4(aPosition*min(uSize.x, uSize.y), 1.0);\n
     vertexPosition = uObjectMatrix * vertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
-    \n
+
     //Illumination in Model-View space - Transform attributes and uniforms\n
-    vec4 vertPos4 = uModelView * vec4(aPosition.xyz, 1.0);\n
-    vec3 vertPos = vec3(vertPos4) / vertPos4.w;\n
-    \n
-    vec4 lightPos4 = uModelView * vec4(uLightPosition, 1.0);\n
-    vec3 lightPos = vec3(lightPos4) / lightPos4.w;\n
-    \n
-    vec3 normalInterp = normalize(uNormalMatrix * aNormal);\n
-    \n
+    vec4 vertPos = uModelView * vec4(aPosition.xyz, 1.0);\n
+    vec4 lightPos = uModelView * vec4(uLightPosition, 1.0);\n
+    vec3 normal = normalize(uNormalMatrix * aNormal);\n
+
     vec3 vecToLight = normalize( lightPos.xyz - vertPos.xyz );\n
-    vec3 viewDir = normalize(-vertPos);
-    \n
+    vec3 viewDir = normalize(-vertPos.xyz);
+
     vec3 halfVector = normalize(viewDir + vecToLight);
-    \n
-    float lightDiffuse = dot( vecToLight, normalInterp );\n
+
+    float lightDiffuse = dot( vecToLight, normal );\n
     lightDiffuse = max(0.0,lightDiffuse);\n
     vIllumination = vec3(lightDiffuse * 0.5 + 0.5);\n
-    \n
-    // this is blinn phong
-    //float specAngle = max(dot(halfVector, normalInterp), 0.0);\n
-    //vSpecular = pow(specAngle, 16.0);\n
-    \n
-    // this is phong (for comparison)
-    vec3 reflectDir = reflect(-vecToLight, normalInterp);
-    float specAngle = max(dot(reflectDir, viewDir), 0.0);
-    // note that the exponent is different here
-    vSpecular = pow(specAngle, 16.0/4.0);
-    \n
+
+    vec3 reflectDir = reflect(-vecToLight, normal);
+    vSpecular = pow( max(dot(reflectDir, viewDir), 0.0), 4.0 );
+
     vTexCoord = aTexCoord;\n
     gl_Position = vertexPosition;\n
   }\n
@@ -180,12 +162,11 @@ const char* FRAGMENT_SHADER = MAKE_SHADER(
   varying mediump float vSpecular;\n
   uniform sampler2D sDiffuse;\n
   uniform lowp vec4 uColor;\n
-  \n
+
   void main()\n
   {\n
     vec4 texture = texture2D( sDiffuse, vTexCoord );\n
-    gl_FragColor.rgb = vIllumination.rgb * texture.rgb * uColor.rgb + vSpecular * 0.3;\n
-    gl_FragColor.a = texture.a * uColor.a;\n
+    gl_FragColor = vec4( vIllumination.rgb * texture.rgb * uColor.rgb + vSpecular * 0.3, texture.a * uColor.a);\n
   }\n
 );
 
@@ -206,41 +187,33 @@ const char* NRMMAP_VERTEX_SHADER = MAKE_SHADER(
   uniform mediump mat3 uNormalMatrix;
   uniform mediump mat4 uObjectMatrix;\n
   uniform mediump vec3 uLightPosition;\n
-  \n
+
   void main()
   {\n
     vec4 vertexPosition = vec4(aPosition*min(uSize.x, uSize.y), 1.0);\n
     vertexPosition = uObjectMatrix * vertexPosition;\n
     vertexPosition = uMvpMatrix * vertexPosition;\n
-    \n
-    vTexCoord = aTexCoord;\n
-    \n
-    vec3 vNormal = normalize(uNormalMatrix * aNormal);\n
-    vec3 vTangent = normalize(uNormalMatrix * aTangent);\n
-    vec3 vBiNormal = normalize(uNormalMatrix * aBiNormal);\n
-    \n
-    vec4 vertPos4 = uModelView * vec4(aPosition.xyz, 1.0);\n
-    vec3 vertPos = vec3(vertPos4) / vertPos4.w;\n
-    \n
-    vec4 lightPos4 = uModelView * vec4(uLightPosition, 1.0);\n
-    vec3 lightPos = vec3(lightPos4) / lightPos4.w;\n
-    \n
-    vec3 vecToLight = lightPos - vertPos;
-    vLightDirection.x = dot(vecToLight, vTangent);
-    vLightDirection.y = dot(vecToLight, vBiNormal);
-    vLightDirection.z = dot(vecToLight, vNormal);
-    vLightDirection = normalize(vLightDirection);
-    \n
-    vec3 viewDir = normalize(vertPos);
-    \n
+
+    vec4 vertPos = uModelView * vec4(aPosition.xyz, 1.0);\n
+    vec4 lightPos = uModelView * vec4(uLightPosition, 1.0);\n
+
+    vec3 tangent = normalize(uNormalMatrix * aTangent);
+    vec3 binormal = normalize(uNormalMatrix * aBiNormal);
+    vec3 normal = normalize(uNormalMatrix * aNormal);
+
+    vec3 vecToLight = normalize( lightPos.xyz - vertPos.xyz );\n
+    vLightDirection.x = dot(vecToLight, tangent);
+    vLightDirection.y = dot(vecToLight, binormal);
+    vLightDirection.z = dot(vecToLight, normal);
+
+    vec3 viewDir = normalize(-vertPos.xyz);
     vec3 halfVector = normalize(viewDir + vecToLight);
-    vHalfVector.x = dot (halfVector, vTangent);
-    vHalfVector.y = dot (halfVector, vBiNormal);
-    vHalfVector.z = dot (halfVector, vNormal);
-    \n
-    gl_Position = vertexPosition;\n
+    vHalfVector.x = dot(halfVector, tangent);
+    vHalfVector.y = dot(halfVector, binormal);
+    vHalfVector.z = dot(halfVector, normal);
 
-    //vHalfVector = aTangent;
+    vTexCoord = aTexCoord;\n
+    gl_Position = vertexPosition;\n
   }\n
 );
 
@@ -253,23 +226,19 @@ const char* NRMMAP_FRAGMENT_SHADER = MAKE_SHADER(
   uniform sampler2D sNormal;\n
   uniform sampler2D sGloss;\n
   uniform lowp vec4 uColor;\n
-  \n
+
   void main()\n
   {\n
     vec4 texture = texture2D( sDiffuse, vTexCoord );\n
-    vec4 nrmMap = texture2D( sNormal, vTexCoord ) * 2.0 - 1.0;\n
+    vec3 normal = normalize( texture2D( sNormal, vTexCoord ).xyz * 2.0 - 1.0 );\n
     vec4 glossMap = texture2D( sGloss, vTexCoord );\n
-    \n
-    vec3 normalizedLightDirection = normalize(vLightDirection);\n
-    float lightDiffuse = max( 0.0, dot( nrmMap.xyz, normalizedLightDirection ) );\n
+
+    float lightDiffuse = max( 0.0, dot( normal, normalize(vLightDirection) ) );\n
     lightDiffuse = lightDiffuse * 0.5 + 0.5;\n
-    \n
-    float shininess = pow (max (dot (vHalfVector, nrmMap.xyz), 0.0), 16.0)  ;
-    \n
-    gl_FragColor.rgb = texture.rgb * uColor.rgb * lightDiffuse + shininess * glossMap.rgb;\n
-    gl_FragColor.a = texture.a * uColor.a;\n
 
-    //gl_FragColor.rgb = vHalfVector.rgb;
+    float shininess = pow (max (dot (normalize( vHalfVector ), normal), 0.0), 16.0)  ;
+
+    gl_FragColor = vec4( texture.rgb * uColor.rgb * lightDiffuse + shininess * glossMap.rgb, texture.a * uColor.a);\n
   }\n
 );
 
index 5be63cf..91a714f 100644 (file)
@@ -22,6 +22,7 @@
 #include <dali/devel-api/common/map-wrapper.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/images/frame-buffer-image.h>
 #include <dali/public-api/render-tasks/render-task.h>
 
index 183c613..b521cff 100644 (file)
@@ -19,7 +19,6 @@
 #include "confirmation-popup-impl.h"
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/images/resource-image.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/object/type-registry-helper.h>
index bbdb9a1..4a260c5 100755 (executable)
@@ -36,7 +36,6 @@
 // INTERNAL INCLUDES
 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/public-api/accessibility-manager/accessibility-manager.h>
 #include <dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.h>
index f01d498..6893716 100755 (executable)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/actors/layer.h>
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/animation/animation.h>
index 23c148b..e11f3ff 100644 (file)
@@ -47,18 +47,18 @@ const char * const RENDERER_TYPE("rendererType");
 const char * const RENDERER_TYPE_VALUE("gradient");
 
 // properties: linear gradient
-const char * const GRADIENT_START_POSITION_NAME("gradientStartPosition"); // Property::VECTOR2
-const char * const GRADIENT_END_POSITION_NAME("gradientEndPosition"); // Property::VECTOR2
+const char * const START_POSITION_NAME("startPosition"); // Property::VECTOR2
+const char * const END_POSITION_NAME("endPosition"); // Property::VECTOR2
 
 // properties: radial gradient
-const char * const GRADIENT_CENTER_NAME("gradientCenter"); // Property::VECTOR2
-const char * const GRADIENT_RADIUS_NAME("gradientRadius"); // Property::FLOAT
+const char * const CENTER_NAME("center"); // Property::VECTOR2
+const char * const RADIUS_NAME("radius"); // Property::FLOAT
 
 // properties: linear&radial gradient
-const char * const GRADIENT_STOP_OFFSET_NAME("gradientStopOffset"); // Property::Array FLOAT
-const char * const GRADIENT_STOP_COLOR_NAME("gradientStopColor"); // Property::Array VECTOR4
-const char * const GRADIENT_UNITS_NAME("gradientUnits"); // Property::String  "userSpaceOnUse | objectBoundingBox"
-const char * const GRADIENT_SPREAD_METHOD_NAME("gradientSpreadMethod"); // Property::String  "pad | reflect | repeat"
+const char * const STOP_OFFSET_NAME("stopOffset"); // Property::Array FLOAT
+const char * const STOP_COLOR_NAME("stopColor"); // Property::Array VECTOR4
+const char * const UNITS_NAME("units"); // Property::String  "userSpaceOnUse | objectBoundingBox"
+const char * const SPREAD_METHOD_NAME("spreadMethod"); // Property::String  "pad | reflect | repeat"
 
 // string values
 const char * const UNIT_USER_SPACE("userSpace");
@@ -71,6 +71,10 @@ const char * const SPREAD_REPEAT("repeat");
 const char * const UNIFORM_ALIGNMENT_MATRIX_NAME( "uAlignmentMatrix" );
 const char * const UNIFORM_TEXTULRE_NAME("sTexture");
 
+// default offset value
+const unsigned int DEFAULT_OFFSET_MINIMUM = 0.0f;
+const unsigned int DEFAULT_OFFSET_MAXIMUM = 1.0f;
+
 RendererFactoryCache::ShaderType GetShaderType( GradientRenderer::Type type, Gradient::GradientUnits units)
 {
   if( type==GradientRenderer::LINEAR )
@@ -191,7 +195,7 @@ GradientRenderer::~GradientRenderer()
 void GradientRenderer::DoInitialize( Actor& actor, const Property::Map& propertyMap )
 {
   Gradient::GradientUnits gradientUnits = Gradient::OBJECT_BOUNDING_BOX;
-  Property::Value* unitsValue = propertyMap.Find( GRADIENT_UNITS_NAME );
+  Property::Value* unitsValue = propertyMap.Find( UNITS_NAME );
   std::string units;
   // The default unit is OBJECT_BOUNDING_BOX.
   // Only need to set new units if 'user-space'
@@ -201,7 +205,7 @@ void GradientRenderer::DoInitialize( Actor& actor, const Property::Map& property
   }
 
   mGradientType = LINEAR;
-  if( propertyMap.Find( GRADIENT_RADIUS_NAME ))
+  if( propertyMap.Find( RADIUS_NAME ))
   {
     mGradientType = RADIAL;
   }
@@ -247,25 +251,25 @@ void GradientRenderer::DoCreatePropertyMap( Property::Map& map ) const
   Gradient::GradientUnits units = mGradient->GetGradientUnits();
   if( units == Gradient::USER_SPACE_ON_USE )
   {
-    map.Insert( GRADIENT_UNITS_NAME, UNIT_USER_SPACE );
+    map.Insert( UNITS_NAME, UNIT_USER_SPACE );
   }
   else // if( units == Gradient::OBJECT_BOUNDING_BOX )
   {
-    map.Insert( GRADIENT_UNITS_NAME, UNIT_BOUNDING_BOX );
+    map.Insert( UNITS_NAME, UNIT_BOUNDING_BOX );
   }
 
   Gradient::SpreadMethod spread = mGradient->GetSpreadMethod();
   if( spread == Gradient::PAD )
   {
-    map.Insert( GRADIENT_SPREAD_METHOD_NAME, SPREAD_PAD );
+    map.Insert( SPREAD_METHOD_NAME, SPREAD_PAD );
   }
   else if( spread == Gradient::REFLECT )
   {
-    map.Insert( GRADIENT_SPREAD_METHOD_NAME, SPREAD_REFLECT );
+    map.Insert( SPREAD_METHOD_NAME, SPREAD_REFLECT );
   }
   else // if( units == Gradient::REPEAT )
   {
-    map.Insert( GRADIENT_SPREAD_METHOD_NAME, SPREAD_REPEAT );
+    map.Insert( SPREAD_METHOD_NAME, SPREAD_REPEAT );
   }
 
   const Vector<Gradient::GradientStop>& stops( mGradient->GetStops() );
@@ -277,20 +281,20 @@ void GradientRenderer::DoCreatePropertyMap( Property::Map& map ) const
     colors.PushBack( stops[i].mStopColor );
   }
 
-  map.Insert( GRADIENT_STOP_OFFSET_NAME, offsets );
-  map.Insert( GRADIENT_STOP_COLOR_NAME, colors );
+  map.Insert( STOP_OFFSET_NAME, offsets );
+  map.Insert( STOP_COLOR_NAME, colors );
 
   if( &typeid( *mGradient ) == &typeid(LinearGradient) )
   {
     LinearGradient* gradient = static_cast<LinearGradient*>( mGradient.Get() );
-    map.Insert( GRADIENT_START_POSITION_NAME, gradient->GetStartPosition() );
-    map.Insert( GRADIENT_END_POSITION_NAME, gradient->GetEndPosition() );
+    map.Insert( START_POSITION_NAME, gradient->GetStartPosition() );
+    map.Insert( END_POSITION_NAME, gradient->GetEndPosition() );
   }
   else // if( &typeid( *mGradient ) == &typeid(RadialGradient) )
   {
     RadialGradient* gradient = static_cast<RadialGradient*>( mGradient.Get() );
-    map.Insert( GRADIENT_CENTER_NAME, gradient->GetCenter() );
-    map.Insert( GRADIENT_RADIUS_NAME, gradient->GetRadius() );
+    map.Insert( CENTER_NAME, gradient->GetCenter() );
+    map.Insert( RADIUS_NAME, gradient->GetRadius() );
   }
 }
 
@@ -330,8 +334,8 @@ bool GradientRenderer::NewGradient(Type gradientType, const Property::Map& prope
 {
   if( gradientType==LINEAR )
   {
-    Property::Value* startPositionValue = propertyMap.Find( GRADIENT_START_POSITION_NAME );
-    Property::Value* endPositionValue = propertyMap.Find( GRADIENT_END_POSITION_NAME );
+    Property::Value* startPositionValue = propertyMap.Find( START_POSITION_NAME );
+    Property::Value* endPositionValue = propertyMap.Find( END_POSITION_NAME );
     Vector2 startPosition;
     Vector2 endPosition;
 
@@ -347,8 +351,8 @@ bool GradientRenderer::NewGradient(Type gradientType, const Property::Map& prope
   }
   else // type==RADIAL
   {
-    Property::Value* centerValue = propertyMap.Find( GRADIENT_CENTER_NAME );
-    Property::Value* radiusValue = propertyMap.Find( GRADIENT_RADIUS_NAME );
+    Property::Value* centerValue = propertyMap.Find( CENTER_NAME );
+    Property::Value* radiusValue = propertyMap.Find( RADIUS_NAME );
     Vector2 center;
     float radius;
     if( centerValue && centerValue->Get(center)
@@ -363,14 +367,15 @@ bool GradientRenderer::NewGradient(Type gradientType, const Property::Map& prope
   }
 
   unsigned int numValidStop = 0u;
-  Property::Value* stopOffsetValue = propertyMap.Find( GRADIENT_STOP_OFFSET_NAME );
-  Property::Value* stopColorValue = propertyMap.Find( GRADIENT_STOP_COLOR_NAME );
-  if( stopOffsetValue && stopColorValue )
+  Property::Value* stopOffsetValue = propertyMap.Find( STOP_OFFSET_NAME );
+  Property::Value* stopColorValue = propertyMap.Find( STOP_COLOR_NAME );
+  if( stopColorValue )
   {
     Vector<float> offsetArray;
     Property::Array* colorArray = stopColorValue->GetArray();
-    if( colorArray && GetStopOffsets( stopOffsetValue, offsetArray ))
+    if( colorArray )
     {
+      GetStopOffsets( stopOffsetValue, offsetArray );
       unsigned int numStop = offsetArray.Count() < colorArray->Count() ?
                              offsetArray.Count() : colorArray->Count();
       Vector4 color;
@@ -390,7 +395,7 @@ bool GradientRenderer::NewGradient(Type gradientType, const Property::Map& prope
     return false;
   }
 
-  Property::Value* spread = propertyMap.Find( GRADIENT_SPREAD_METHOD_NAME );
+  Property::Value* spread = propertyMap.Find( SPREAD_METHOD_NAME );
   std::string stringValue ;
   // The default spread method is PAD.
   // Only need to set new spread if 'reflect' or 'repeat"
@@ -409,51 +414,68 @@ bool GradientRenderer::NewGradient(Type gradientType, const Property::Map& prope
   return true;
 }
 
-bool GradientRenderer::GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets)
+void GradientRenderer::GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets)
 {
-  Vector2 offset2;
-  if( value->Get( offset2 ) )
-  {
-    stopOffsets.PushBack( offset2.x );
-    stopOffsets.PushBack( offset2.y );
-    return true;
-  }
-
-  Vector3 offset3;
-  if( value->Get( offset3 ) )
-  {
-    stopOffsets.PushBack( offset3.x );
-    stopOffsets.PushBack( offset3.y );
-    stopOffsets.PushBack( offset3.z );
-    return true;
-  }
 
-  Vector4 offset4;
-  if( value->Get( offset4 ) )
+  if ( value ) // Only check valve type if a valid Property has been passed in
   {
-    stopOffsets.PushBack( offset4.x );
-    stopOffsets.PushBack( offset4.y );
-    stopOffsets.PushBack( offset4.z );
-    stopOffsets.PushBack( offset4.w );
-    return true;
-  }
-
-  Property::Array* offsetArray = value->GetArray();
-  if( offsetArray )
-  {
-    unsigned int numStop = offsetArray->Count();
-    float offset;
-    for( unsigned int i=0; i<numStop; i++ )
+    switch ( value->GetType() )
     {
-      if( offsetArray->GetElementAt(i).Get(offset) )
+      case Property::VECTOR2:
+      {
+        Vector2 offset2;
+        value->Get( offset2 );
+        stopOffsets.PushBack( offset2.x );
+        stopOffsets.PushBack( offset2.y );
+        break;
+      }
+      case Property::VECTOR3:
       {
-        stopOffsets.PushBack( offset );
+        Vector3 offset3;
+        value->Get( offset3 );
+        stopOffsets.PushBack( offset3.x );
+        stopOffsets.PushBack( offset3.y );
+        stopOffsets.PushBack( offset3.z );
+        break;
+      }
+      case Property::VECTOR4:
+      {
+        Vector4 offset4;
+        value->Get( offset4 );
+        stopOffsets.PushBack( offset4.x );
+        stopOffsets.PushBack( offset4.y );
+        stopOffsets.PushBack( offset4.z );
+        stopOffsets.PushBack( offset4.w );
+        break;
+      }
+      case Property::ARRAY:
+      {
+        Property::Array* offsetArray = value->GetArray();
+        unsigned int numStop = offsetArray->Count();
+        float offset;
+        for( unsigned int i=0; i<numStop; i++ )
+        {
+          if( offsetArray->GetElementAt(i).Get(offset) )
+          {
+            stopOffsets.PushBack( offset );
+          }
+        }
+        break;
+      }
+      default:
+      {
+        DALI_LOG_WARNING("GetStopOffsets passed unsupported Property Map\n");
+        // Unsupported Type
       }
     }
-    return true;
   }
 
-  return false;
+  if ( stopOffsets.Empty() )
+  {
+    // Set default offset if none set by Property system, need a minimum and maximum
+    stopOffsets.PushBack( DEFAULT_OFFSET_MINIMUM );
+    stopOffsets.PushBack( DEFAULT_OFFSET_MAXIMUM );
+  }
 }
 
 } // namespace Internal
index 87cb854..f0079f8 100644 (file)
@@ -42,29 +42,27 @@ class Gradient;
  *
  * | %Property Name          | Type             |
  * |-------------------------|------------------|
- * | gradientStartPosition   | VECTOR2          |
- * | gradientEndPosition     | VECTOR2          |
- * | gradientStopOffset      | ARRAY of FLOAT   |
- * | gradientStopColor       | ARRAY of VECTOR4 |
+ * | startPosition           | VECTOR2          |
+ * | endPosition             | VECTOR2          |
+ * | stopColor               | ARRAY of VECTOR4 |
  *
  * The following properties are essential for create a RADIAL GradientRender
  *
  * | %Property Name          | Type             |
  * |-------------------------|------------------|
- * | gradientCenter          | VECTOR2          |
- * | gradientRadius          | FLOAT            |
- * | gradientStopOffset      | ARRAY of FLOAT   |
- * | gradientStopColor       | ARRAY of VECTOR4 |
+ * | center                  | VECTOR2          |
+ * | radius                  | FLOAT            |
+ * | stopColor               | ARRAY of VECTOR4 |
  *
  * The following properties are optional for both LINEAR and RADIAL GradientRender.
  *
  * | %Property Name          | Type             |
  * |-------------------------|------------------|
- * | gradientUnits           | STRING           |
- * | gradientSpreadMethod    | STRING           |
+ * | units                   | STRING           |
+ * | spreadMethod            | STRING           |
  *
- * Valid values for gradientUnits are 'userSpace' and 'objectBoundingBox'.
- * Valid values for gradientSpreadMethod are 'pad', 'repeat' and 'reflect.'
+ * Valid values for units are 'userSpace' and 'objectBoundingBox'.
+ * Valid values for spreadMethod are 'pad', 'repeat' and 'reflect.'
  * If not provided, 'objectBoundingBox' is used as default gradient units, and 'pad' is used as default spread method.
  */
 class GradientRenderer: public ControlRenderer
@@ -146,7 +144,7 @@ private:
    * @param[in] value The property value of stop-offsets
    * @param[out] stopOffsets The vector contains the stop offset values.
    */
-  static bool GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);
+  static void GetStopOffsets(const Property::Value* value, Vector<float>& stopOffsets);
 
   // Undefined
   GradientRenderer( const GradientRenderer& gradientRenderer );
index 9e25fcc..c9fdc60 100755 (executable)
@@ -19,7 +19,6 @@
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/adaptor-framework/timer.h>
 #include <dali/public-api/object/property-array.h>
 
index 61388ac..742e111 100644 (file)
@@ -31,7 +31,6 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/controls/text-controls/text-label.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-popup-callback-interface.h>
index 4444d0c..e2a9497 100644 (file)
@@ -26,7 +26,6 @@
 #include <dali-toolkit/devel-api/controls/text-controls/text-selection-toolbar.h>
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/actors/layer.h>
 
 namespace Dali
index 81ec840..b010199 100644 (file)
@@ -27,7 +27,6 @@
 #include <dali/devel-api/object/type-registry-helper.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 
index 5ce8db6..a3e4d00 100644 (file)
@@ -19,7 +19,6 @@
 #include "tool-bar-impl.h"
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/animation/constraints.h>
 #include <dali/public-api/object/type-registry.h>
 #include <dali/devel-api/object/type-registry-helper.h>
index 826ee4f..c4d9a87 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/common/stage.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/devel-api/rendering/renderer.h>
 
 namespace
 {
@@ -55,7 +56,7 @@ Actor Clipper::GetRootActor() const
   return mOffscreenRootActor;
 }
 
-ImageActor Clipper::GetImageActor() const
+Actor Clipper::GetImageActor() const
 {
   return mImageActor;
 }
@@ -103,10 +104,8 @@ void Clipper::Initialize( const Vector2& size )
   mOffscreenRootActor.SetDepthTestDisabled( true );
   mOffscreenRootActor.SetSize( offscreenSize );
 
-  mImageActor = ImageActor::New();
+  mImageActor = ImageView::New();
   mImageActor.SetParentOrigin( ParentOrigin::CENTER );
-  mImageActor.SetBlendFunc( BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
-                            BlendingFactor::ONE, BlendingFactor::ONE );
   mImageActor.SetScale( Vector3( 1.0f, -1.0f, 1.0f ) );
   mImageActor.SetSize( offscreenSize );
 
@@ -130,11 +129,19 @@ void Clipper::Initialize( const Vector2& size )
                                                              Pixel::RGBA8888 );
   mImageActor.SetImage( frameBufferImage );
   mRenderTask.SetTargetFrameBuffer( frameBufferImage );
+  mImageActor.OnStageSignal().Connect(this, &Clipper::OnStageConnect);
 
   // Stores current size to avoid create new Dali resources if text changes.
   mCurrentOffscreenSize = offscreenSize;
 }
 
+void Clipper::OnStageConnect( Dali::Actor actor )
+{
+  Renderer renderer = mImageActor.GetRendererAt(0);
+  renderer.SetBlendFunc(BlendingFactor::ONE, BlendingFactor::ONE_MINUS_SRC_ALPHA,
+                        BlendingFactor::ONE, BlendingFactor::ONE);
+}
+
 Clipper::Clipper()
 {
 }
index 26bff0b..a05855c 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/layer.h>
-#include <dali/public-api/actors/image-actor.h>
 #include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/render-tasks/render-task.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
+#include <dali/public-api/signals/connection-tracker.h>
 
 namespace Dali
 {
@@ -39,7 +40,7 @@ typedef IntrusivePtr<Clipper> ClipperPtr;
 /**
  * @brief A helper class for clipping actors using a FrameBufferImage.
  */
-class Clipper : public RefObject
+class Clipper : public RefObject, public ConnectionTracker
 {
 public:
 
@@ -63,7 +64,7 @@ public:
    *
    * @return The image actor.
    */
-  ImageActor GetImageActor() const;
+  Actor GetImageActor() const;
 
   /**
    * @brief Refresh the contents of the FrameBufferImage.
@@ -82,6 +83,13 @@ private: // Implementation
   void Initialize( const Vector2& size );
 
   /**
+   * The renderer is not created until the clipper actor is set on stage, only by then the blend function could be set.
+   *
+   * @param[in] actor The actor connected to stage.
+   */
+  void OnStageConnect( Dali::Actor actor );
+
+  /**
    * Construct a new Clipper.
    */
   Clipper();
@@ -101,7 +109,7 @@ private: // Data
 
   Layer mOffscreenRootActor;
   CameraActor mOffscreenCameraActor;
-  ImageActor mImageActor;
+  ImageView mImageActor;
   RenderTask mRenderTask;
   Vector2 mCurrentOffscreenSize;
 };
index 1791a8d..43ccb78 100644 (file)
@@ -33,7 +33,6 @@
 #include <dali/devel-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/controls/default-controls/solid-color-actor.h>
 #include <dali-toolkit/public-api/controls/image-view/image-view.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/internal/controls/image-view/image-view-impl.h>
@@ -529,7 +528,7 @@ struct Decorator::Impl : public ConnectionTracker
   {
     cursor = Control::New();
     cursor.SetBackgroundColor( color );
-    cursor.SetParentOrigin( ParentOrigin::TOP_LEFT ); // Need to set the default parent origin as CreateSolidColorActor() sets a different one.
+    cursor.SetParentOrigin( ParentOrigin::TOP_LEFT );
     cursor.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   }
 
index 81598d9..ec9167b 100644 (file)
@@ -63,13 +63,30 @@ bool ValidateFontsPerScript::FindValidFont( FontId fontId ) const
   return false;
 }
 
+FontId DefaultFonts::FindFont( TextAbstraction::FontClient& fontClient, PointSize26Dot6 size ) const
+{
+  for( Vector<FontId>::ConstIterator it = mFonts.Begin(),
+         endIt = mFonts.End();
+       it != endIt;
+       ++it )
+  {
+    const FontId fontId = *it;
+    if( size == fontClient.GetPointSize( fontId ) )
+    {
+      return fontId;
+    }
+  }
+
+  return 0u;
+}
+
 MultilanguageSupport::MultilanguageSupport()
 : mDefaultFontPerScriptCache(),
   mValidFontsPerScriptCache()
 {
   // Initializes the default font cache to zero (invalid font).
   // Reserves space to cache the default fonts and access them with the script as an index.
-  mDefaultFontPerScriptCache.Resize( TextAbstraction::UNKNOWN, 0u );
+  mDefaultFontPerScriptCache.Resize( TextAbstraction::UNKNOWN, NULL );
 
   // Initializes the valid fonts cache to NULL (no valid fonts).
   // Reserves space to cache the valid fonts and access them with the script as an index.
@@ -78,8 +95,16 @@ MultilanguageSupport::MultilanguageSupport()
 
 MultilanguageSupport::~MultilanguageSupport()
 {
-  // Destroy the valid fonts per script cache.
+  // Destroy the default font per script cache.
+  for( Vector<DefaultFonts*>::Iterator it = mDefaultFontPerScriptCache.Begin(),
+         endIt = mDefaultFontPerScriptCache.End();
+       it != endIt;
+       ++it )
+  {
+    delete *it;
+  }
 
+  // Destroy the valid fonts per script cache.
   for( Vector<ValidateFontsPerScript*>::Iterator it = mValidFontsPerScriptCache.Begin(),
          endIt = mValidFontsPerScriptCache.End();
        it != endIt;
@@ -363,7 +388,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
   // Traverse the characters and validate/set the fonts.
 
   // Get the caches.
-  FontId* defaultFontPerScriptCacheBuffer = mDefaultFontPerScriptCache.Begin();
+  DefaultFonts** defaultFontPerScriptCacheBuffer = mDefaultFontPerScriptCache.Begin();
   ValidateFontsPerScript** validFontsPerScriptCacheBuffer = mValidFontsPerScriptCache.Begin();
 
   // Stores the validated font runs.
@@ -403,6 +428,9 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
   Vector<ScriptRun>::ConstIterator scriptRunEndIt = scripts.End();
   bool isNewParagraphCharacter = false;
 
+  PointSize26Dot6 currentPointSize = defaultPointSize;
+  FontId currentFontId = 0u;
+
   CharacterIndex lastCharacter = startIndex + numberOfCharacters;
   for( Length index = startIndex; index < lastCharacter; ++index )
   {
@@ -417,6 +445,13 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
                                scriptRunIt,
                                scriptRunEndIt );
 
+    // Get the current point size.
+    if( currentFontId != fontId )
+    {
+      currentPointSize = fontClient.GetPointSize( fontId );
+      currentFontId = fontId;
+    }
+
 #ifdef DEBUG_ENABLED
     {
       Dali::TextAbstraction::FontDescription description;
@@ -438,8 +473,15 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
 
     // Check first in the caches.
 
+    DefaultFonts* defaultFonts = *( defaultFontPerScriptCacheBuffer + script );
+    FontId cachedDefaultFontId = 0u;
+    if( NULL != defaultFonts )
+    {
+      cachedDefaultFontId = defaultFonts->FindFont( fontClient, currentPointSize );
+    }
+
     // The user may have set the default font. Check it. Otherwise check in the valid fonts cache.
-    if( fontId != *( defaultFontPerScriptCacheBuffer + script ) )
+    if( fontId != cachedDefaultFontId )
     {
       // Check in the valid fonts cache.
       ValidateFontsPerScript* validateFontsPerScript = *( validFontsPerScriptCacheBuffer + script );
@@ -508,7 +550,7 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
     if( 0u == fontId )
     {
       // The character has no font assigned. Get a default one from the cache
-      fontId = *( defaultFontPerScriptCacheBuffer + script );
+      fontId = cachedDefaultFontId;
 
       // If the cache has not a default font, get one from the font client.
       if( 0u == fontId )
@@ -517,20 +559,31 @@ void MultilanguageSupport::ValidateFonts( const Vector<Character>& text,
         bool preferColor = ( TextAbstraction::EMOJI == script );
 
         // Find a fallback-font.
-        fontId = fontClient.FindFallbackFont( preferredFont, character, defaultPointSize, preferColor );
+        fontId = fontClient.FindFallbackFont( preferredFont, character, currentPointSize, preferColor );
 
         // If the system does not support a suitable font, fallback to Latin
+        DefaultFonts* latinDefaults = NULL;
         if( 0u == fontId )
         {
-          fontId = *( defaultFontPerScriptCacheBuffer + TextAbstraction::LATIN );
+          latinDefaults = *( defaultFontPerScriptCacheBuffer + TextAbstraction::LATIN );
+          if( NULL != latinDefaults )
+          {
+            fontId = latinDefaults->FindFont( fontClient, currentPointSize );
+          }
         }
+
         if( 0u == fontId )
         {
-          fontId = fontClient.FindDefaultFont( UTF32_A, defaultPointSize );
+          fontId = fontClient.FindDefaultFont( UTF32_A, currentPointSize );
         }
 
         // Cache the font.
-        *( defaultFontPerScriptCacheBuffer + script ) = fontId;
+        if( NULL == latinDefaults )
+        {
+          latinDefaults = new DefaultFonts();
+          *( defaultFontPerScriptCacheBuffer + script ) = latinDefaults;
+        }
+        latinDefaults->mFonts.PushBack( fontId );
       }
     }
 
index 781aed5..283b021 100644 (file)
 namespace Dali
 {
 
+namespace TextAbstraction
+{
+//Forward declaration
+class FontClient;
+}
+
 namespace Toolkit
 {
 
@@ -67,6 +73,37 @@ struct ValidateFontsPerScript
 };
 
 /**
+ * @brief Stores default font ids per script. It can be different sizes for a default font family.
+ */
+struct DefaultFonts
+{
+  /**
+   * Default constructor.
+   */
+  DefaultFonts()
+  : mFonts()
+  {}
+
+  /**
+   * Default destructor.
+   */
+  ~DefaultFonts()
+  {}
+
+  /**
+   * @brief Finds a default font for the given @p size.
+   *
+   * @param[in] fontClient The font client.
+   * @param[in] size The given size.
+   *
+   * @return The font id of a default font for the given @p size. If there isn't any font cached it returns 0.
+   */
+  FontId FindFont( TextAbstraction::FontClient& fontClient, PointSize26Dot6 size ) const;
+
+  Vector<FontId> mFonts;
+};
+
+/**
  * @brief Multi-language support implementation. @see Text::MultilanguageSupport.
  */
 class MultilanguageSupport : public BaseObject
@@ -110,7 +147,7 @@ public:
                       Vector<FontRun>& fonts );
 
 private:
-  Vector<FontId>                  mDefaultFontPerScriptCache; ///< Caches the default font for a script.
+  Vector<DefaultFonts*>           mDefaultFontPerScriptCache; ///< Caches default fonts for a script.
   Vector<ValidateFontsPerScript*> mValidFontsPerScriptCache;  ///< Caches valid fonts for a script.
 };
 
index 8cfd434..ac61e9e 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
-#include <dali/public-api/actors/image-actor.h>
 
 namespace Dali
 {
index f472375..56cd667 100644 (file)
@@ -22,9 +22,7 @@
 // INTERNAL INCLUDES
 
 #include <dali-toolkit/internal/controls/buttons/button-impl.h>
-
-// EXTERNAL INCLUDES
-#include <dali/public-api/actors/image-actor.h>
+#include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
 namespace Dali
 {
@@ -202,14 +200,14 @@ void Button::SetLabel( Actor label )
 
 void Button::SetButtonImage( Image image )
 {
-  Actor imageActor = ImageActor::New( image );
+  Actor imageActor = Toolkit::ImageView::New( image );
   imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   Dali::Toolkit::GetImplementation( *this ).SetButtonImage( imageActor );
 }
 
 void Button::SetSelectedImage( Image image )
 {
-  Actor imageActor = ImageActor::New( image );
+  Actor imageActor = Toolkit::ImageView::New( image );
   imageActor.SetResizePolicy( ResizePolicy::USE_NATURAL_SIZE, Dimension::ALL_DIMENSIONS );
   Dali::Toolkit::GetImplementation( *this ).SetSelectedImage( imageActor );
 }
index 24b98b5..90fcefd 100644 (file)
@@ -22,7 +22,6 @@
 // INTERNAL INCLUDES
 
 #include <dali-toolkit/internal/controls/buttons/push-button-impl.h>
-#include <dali/public-api/actors/image-actor.h>
 
 namespace Dali
 {
index df7bb8c..7cc7571 100644 (file)
@@ -163,7 +163,6 @@ TypeAction registerAction( typeRegistration, ACTION_ACCESSIBILITY_ACTIVATED, &Do
 
 DALI_TYPE_REGISTRATION_END()
 
-const char * const BACKGROUND_COLOR_NAME("color");
 const char * const COLOR_RENDERER_COLOR_NAME("blendColor");
 
 } // unnamed namespace
@@ -283,21 +282,16 @@ public:
 
         case Toolkit::Control::Property::BACKGROUND:
         {
-          Image image = Scripting::NewImage( value );
-          if ( image )
-          {
-            controlImpl.SetBackgroundImage( image );
-            break;
-          }
           const Property::Map* map = value.GetMap();
           if( map )
           {
             controlImpl.SetBackground( *map );
-            break;
           }
-
-          // The background is neither a valid image nor a property map, so it is no longer required
-          controlImpl.ClearBackground();
+          else
+          {
+            // The background is not a property map, so we should clear the background
+            controlImpl.ClearBackground();
+          }
           break;
         }
       }
@@ -474,14 +468,6 @@ Vector4 Control::GetBackgroundColor() const
 
 void Control::SetBackground(const Property::Map& map)
 {
-  const Property::Value* colorValue = map.Find( BACKGROUND_COLOR_NAME );
-  Vector4 color;
-  if( colorValue && colorValue->Get(color))
-  {
-    SetBackgroundColor( color );
-    return;
-  }
-
   Actor self( Self() );
   mImpl->mBackgroundRenderer.RemoveAndReset( self );
   Toolkit::RendererFactory factory = Toolkit::RendererFactory::Get();
index 95d3f93..62ea7a1 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 28;
+const unsigned int TOOLKIT_MICRO_VERSION = 29;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 113055a..46ee52d 100644 (file)
@@ -94,7 +94,8 @@
       "popupIconColor":[1.0,1.0,1.0,1.0],
       "popupPressedColor":[0.24,0.72,0.8,0.11],
       "background": {
-        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        "rendererType": "nPatch",
+        "imageUrl": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
         },
       "popupFadeInDuration":0.25,
       "popupFadeOutDuration":0.25
index 0dae29e..26b3c80 100644 (file)
@@ -94,7 +94,8 @@
       "popupIconColor":[1.0,1.0,1.0,1.0],
       "popupPressedColor":[0.24,0.72,0.8,0.11],
       "background": {
-        "filename": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
+        "rendererType": "nPatch",
+        "imageUrl": "{DALI_IMAGE_DIR}selection-popup-bg.9.png"
         },
       "popupFadeInDuration":0.25,
       "popupFadeOutDuration":0.25
diff --git a/dali-toolkit/styles/images-common/B16-8_TTS_focus.9.png b/dali-toolkit/styles/images-common/B16-8_TTS_focus.9.png
new file mode 100644 (file)
index 0000000..535d0e9
Binary files /dev/null and b/dali-toolkit/styles/images-common/B16-8_TTS_focus.9.png differ
diff --git a/dali-toolkit/styles/images-common/B16-8_TTS_focus.png b/dali-toolkit/styles/images-common/B16-8_TTS_focus.png
deleted file mode 100644 (file)
index c03deba..0000000
Binary files a/dali-toolkit/styles/images-common/B16-8_TTS_focus.png and /dev/null differ
index fb83355..784cb4d 100644 (file)
@@ -1,6 +1,23 @@
 #ifndef __DALI_TOOLKIT_DOC_H__
 #define __DALI_TOOLKIT_DOC_H__
 
+/*
+ * Copyright (c) 2016 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.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
 /**
  * @defgroup dali DALi
  * @ingroup CAPI_UI_FRAMEWORK
  * @brief DALi is a cross-platform 3D UI Toolkit for embedded systems.
  *
  * @section dali-overview Overview
+ *
  * DALi's 3D user interface engine enables you to create rich and high-performance
  * UI applications. DALi is based on OpenGL ES 2.0, but provides a clean
  * cross-platform C++ framework.
  * This means that you can use high-level DALi APIs instead of accessing
  * low-level OpenGL APIs directly.
- * <ul>
- * <li>DALi Core: This module provides scene graph-based rendering, animation, and event handling.</li>
- * <li>DALi Adaptor: This module is a platform adaptation layer.</li>
- * <li>DALi Toolkit: This module provides UI components and various effects on top of the DALi Core.</li>
- * </ul>
+ *
+ * DALi consists of the following modules:
+ * <table>
+ * <tr>
+ *    <th>Module</th>
+ *    <th>Description</th>
+ * </tr>
+ * <tr>
+ *    <td>@ref dali_core</td>
+ *    <td>DALi Core provides core functionalities such as scene graph-based rendering, animation, and event handling.</td>
+ * </tr>
+ * <tr>
+ *    <td>@ref dali_adaptor</td>
+ *    <td>DALi Adaptor is a platform adaptation layer.</td>
+ * </tr>
+ * <tr>
+ *    <td>@ref dali_toolkit</td>
+ *    <td>DALi Toolkit provides UI components and various effects on top of the DALi Core.</td>
+ * </tr>
+ * </table>
+ *
+ * The layer diagram for DALi modules is shown below:
+ * @image html dali-modules.png "Figure: DALi modules"
  *
  * @defgroup dali_toolkit DALi Toolkit
- * @ingroup dali
  *
- * @brief This module provides UI components and various effects on top of the DALi Core.
+ * @brief DALi Toolkit provides UI components and various effects on top of the DALi Core.
+ *
+ * @section dali_core_overview Overview
+ *
+ * DALi Toolkit consists of the following groups of API:
  *
+ * <table>
+ * <tr>
+ *    <th>API Group</th>
+ *    <th>Description</th>
+ * </tr>
+ * <tr>
+ *    <td>@ref dali_toolkit_controls</td>
+ *    <td>Controls are interactive components for layouting the user interface.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_alignment</td>
+ *    <td>Alignment is a container which provides an easy way to align other actors inside its boundary.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_buttons</td>
+ *    <td>Button is a small object on UI that you can press.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_gaussian_blur_view</td>
+ *    <td>GaussianBlurView provides a render process that blurs an image.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_image_view</td>
+ *    <td>ImageView is a control displying an image.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_scroll_bar</td>
+ *    <td>ScrollBar control.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_scrollable</td>
+ *    <td>Scrollable container controls.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:2em">@ref dali_toolkit_controls_item_view</td>
+ *    <td>ItemView class is a scrollable container that can contain many items.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:2em">@ref dali_toolkit_controls_scroll_view</td>
+ *    <td>ScrollView class provides scrollable view which contains actors and can be scrolled automatically or manually by panning.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_table_view</td>
+ *    <td>TableView class is a layout container for aligning child actors in a grid like layout.</td>
+ * </tr>
+ * <tr>
+ *    <td style="padding-left:1em">@ref dali_toolkit_controls_text_controls</td>
+ *    <td>Controls for displaying text or text input.</td>
+ * </tr>
+ * <tr>
+ *    <td>@ref dali_toolkit_managers</td>
+ *    <td>Singleton classes for managing application-wide functionalities.</td>
+ * </tr>
+ * </table>
+ *
+ * @ingroup dali
  * @{
- *   @defgroup dali_toolkit_accessibility_manager Accessibility Manager
- *   @brief AccessibilityManager manages a accessibility focus chain.
-
  *   @defgroup dali_toolkit_controls Controls
  *   @brief Controls are interactive components for layouting the user interface.
 
  *     @brief Controls for displaying text or text input.
 
  *   @}
- *   @defgroup dali_toolkit_focus_manager Focus Manager
- *   @brief Classes for handling keyboard navigation and maintaining the two dimensional keyboard focus chain.
+
+ *   @defgroup dali_toolkit_managers Managers
+ *   @brief Singleton classes for managing application-wide functionalities.
 
  * @}
  */
diff --git a/docs/content/images/dali-modules.png b/docs/content/images/dali-modules.png
new file mode 100644 (file)
index 0000000..d85303c
Binary files /dev/null and b/docs/content/images/dali-modules.png differ
index 6966e42..2b1c272 100644 (file)
@@ -77,18 +77,18 @@ Both Linear and Radial gradients are supported.
 
 **RendererType:** "gradient"
 
-| Property Name                                                | Type             | Required   | Description                                                       |
-|--------------------------------------------------------------|:----------------:|:----------:|-------------------------------------------------------------------|
-| gradientStartPosition                                        | VECTOR2          | For Linear | The start position of the linear gradient.                        |
-| gradientEndPosition                                          | VECTOR2          | For Linear | The end position of the linear gradient.                          |
-| gradientCenter                                               | VECTOR2          | For Radial | The center point of the gradient.                                 |
-| gradientRadius                                               | FLOAT            | For Radial | The size of the radius.                                           |
-| gradientStopOffset                                           | ARRAY of FLOAT   | Yes        | All the stop offsets.                                             |
-| gradientStopColor                                            | ARRAY of VECTOR4 | Yes        | The color at those stop offsets.                                  |
-| [gradientUnits](@ref gradient-renderer-units)                | STRING           | No         | *objectBoundingBox* or *userSpace*. Default: *objectBoundingBox*. |
-| [gradientSpreadMethod](@ref gradient-renderer-spread-method) | STRING           | No         | *pad*, *repeat* or *reflect*. Default: *pad*                      |
-
-If the *gradientStopOffset* and *gradientStopColor* arrays do not have the same number of elements, then the minimum of the two is used as the stop points.
+| Property Name                                                | Type             | Required   | Description                                                             |
+|--------------------------------------------------------------|:----------------:|:----------:|-------------------------------------------------------------------------|
+| startPosition                                                | VECTOR2          | For Linear | The start position of the linear gradient.                              |
+| endPosition                                                  | VECTOR2          | For Linear | The end position of the linear gradient.                                |
+| center                                                       | VECTOR2          | For Radial | The center point of the gradient.                                       |
+| radius                                                       | FLOAT            | For Radial | The size of the radius.                                                 |
+| stopOffset                                                   | ARRAY of FLOAT   | No         | All the stop offsets. If not supplied default is 0.0 and 1.0            |
+| stopColor                                                    | ARRAY of VECTOR4 | Yes        | The color at those stop offsets. At least 2 required to show a gradient |
+| [gradientUnits](@ref gradient-renderer-units)                | STRING           | No         | *objectBoundingBox* or *userSpace*. Default: *objectBoundingBox*.       |
+| [gradientSpreadMethod](@ref gradient-renderer-spread-method) | STRING           | No         | *pad*, *repeat* or *reflect*. Default: *pad*                            |
+
+If the *stopOffset* and *stopColor* arrays do not have the same number of elements, then the minimum of the two is used as the stop points.
 
 ### Units {#gradient-renderer-units}
 
@@ -120,8 +120,8 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
 
 Dali::Property::Map map;
 map[ "rendererType" ] = "gradient";
-map[ "gradientStartPosition" ] = Vector2( 0.5f, 0.5f );
-map[ "gradientEndPosition" ] = Vector2( -0.5f, -0.5f );
+map[ "startPosition" ] = Vector2( 0.5f, 0.5f );
+map[ "endPosition" ] = Vector2( -0.5f, -0.5f );
 
 Dali::Property::Array stopOffsets;
 stopOffsets.PushBack( 0.0f );
@@ -129,7 +129,7 @@ stopOffsets.PushBack( 0.3f );
 stopOffsets.PushBack( 0.6f );
 stopOffsets.PushBack( 0.8f );
 stopOffsets.PushBack( 1.f );
-map[ "gradientStopOffset" ] = stopOffsets;
+map[ "stopOffset" ] = stopOffsets;
 
 Dali::Property::Array stopColors;
 stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f );
@@ -137,7 +137,7 @@ stopColors.PushBack( Vector4( 196.f, 198.f, 71.f, 122.f )/255.f );
 stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f );
 stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f );
 stopColors.PushBack( Color::YELLOW );
-map[ "gradientStopColor" ] = stopColors;
+map[ "stopColor" ] = stopColors;
 
 control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
 ~~~
@@ -149,10 +149,10 @@ var control = new dali.Control( "Control" );
 control.background =
 {
   rendererType : "gradient",
-  gradientStartPosition : [ 0.5, 0.5 ],
-  gradientEndPosition : [ -0.5, -0.5 ],
-  gradientStopOffset : [ 0.0, 0.3, 0.6, 0.8, 1.0 ],
-  gradientStopColor : [
+  startPosition : [ 0.5, 0.5 ],
+  endPosition : [ -0.5, -0.5 ],
+  stopOffset : [ 0.0, 0.3, 0.6, 0.8, 1.0 ],
+  stopColor : [
     [ 129 / 255, 198 / 255, 193 / 255, 255 / 255 ],
     [ 196 / 255, 198 / 255,  71 / 255, 122 / 255 ],
     [ 214 / 255,  37 / 255, 139 / 255, 191 / 255 ],
@@ -169,8 +169,8 @@ Dali::Toolkit::Control control = Dali::Toolkit::Control::New();
 
 Dali::Property::Map map;
 map[ "rendererType" ] = "gradient";
-map[ "gradientCenter" ] = Vector2( 0.5f, 0.5f );
-map[ "gradientRadius" ] = 1.414f;
+map[ "center" ] = Vector2( 0.5f, 0.5f );
+map[ "radius" ] = 1.414f;
 
 Dali::Property::Array stopOffsets;
 stopOffsets.PushBack( 0.0f );
@@ -178,7 +178,7 @@ stopOffsets.PushBack( 0.3f );
 stopOffsets.PushBack( 0.6f );
 stopOffsets.PushBack( 0.8f );
 stopOffsets.PushBack( 1.f );
-map[ "gradientStopOffset" ] = stopOffsets;
+map[ "stopOffset" ] = stopOffsets;
 
 Dali::Property::Array stopColors;
 stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 255.f )/255.f );
@@ -186,7 +186,7 @@ stopColors.PushBack( Vector4( 196.f, 198.f, 71.f, 122.f )/255.f );
 stopColors.PushBack( Vector4( 214.f, 37.f, 139.f, 191.f )/255.f );
 stopColors.PushBack( Vector4( 129.f, 198.f, 193.f, 150.f )/255.f );
 stopColors.PushBack( Color::YELLOW );
-map[ "gradientStopColor" ] = stopColors;
+map[ "stopColor" ] = stopColors;
 
 control.SetProperty( Dali::Toolkit::Control::Property::BACKGROUND, map );
 ~~~
@@ -198,10 +198,10 @@ var control = new dali.Control( "Control" );
 control.background =
 {
   rendererType : "gradient",
-  gradientCenter : [ 0.5, 0.5 ],
-  gradientRadius : 1.414,
-  gradientStopOffset : [ 0.0, 0.3, 0.6, 0.8, 1.0 ],
-  gradientStopColor : [
+  center : [ 0.5, 0.5 ],
+  radius : 1.414,
+  stopOffset : [ 0.0, 0.3, 0.6, 0.8, 1.0 ],
+  stopColor : [
     [ 129 / 255, 198 / 255, 193 / 255, 255 / 255 ],
     [ 196 / 255, 198 / 255,  71 / 255, 122 / 255 ],
     [ 214 / 255,  37 / 255, 139 / 255, 191 / 255 ],
index 02da954..9cc1a48 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    The OpenGLES Canvas Core Library Toolkit
-Version:    1.1.28
+Version:    1.1.29
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-2-Clause and MIT