[dali_2.1.26] Merge branch 'devel/master' 80/276180/1
authorAdam Bialogonski <adam.b@samsung.com>
Fri, 10 Jun 2022 08:54:30 +0000 (09:54 +0100)
committerAdam Bialogonski <adam.b@samsung.com>
Fri, 10 Jun 2022 08:54:30 +0000 (09:54 +0100)
Change-Id: I86a2bc67311c0e58d52cf0913c04de56f66d0c9d

63 files changed:
automated-tests/src/dali-toolkit-internal/dali-toolkit-test-utils/toolkit-text-utils.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-CharacterSpacing.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Ellipsis.cpp
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Layout.cpp [changed mode: 0755->0644]
automated-tests/src/dali-toolkit-internal/utc-Dali-Text-Shaping.cpp
automated-tests/src/dali-toolkit/utc-Dali-Transition.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
build/tizen/dali-scene-loader/CMakeLists.txt
dali-scene-loader/public-api/dli-loader.cpp
dali-toolkit/devel-api/styling/style-manager-devel.cpp
dali-toolkit/devel-api/styling/style-manager-devel.h
dali-toolkit/devel-api/text/text-utils-devel.cpp
dali-toolkit/internal/controls/text-controls/text-label-impl.cpp
dali-toolkit/internal/focus-manager/keyboard-focus-manager-impl.cpp
dali-toolkit/internal/graphics/shaders/animated-gradient-visual-shader.vert
dali-toolkit/internal/graphics/shaders/arc-visual-shader.vert
dali-toolkit/internal/graphics/shaders/border-visual-shader.vert
dali-toolkit/internal/graphics/shaders/color-visual-shader.frag
dali-toolkit/internal/graphics/shaders/color-visual-shader.vert
dali-toolkit/internal/graphics/shaders/gradient-visual-shader.frag
dali-toolkit/internal/graphics/shaders/gradient-visual-shader.vert
dali-toolkit/internal/graphics/shaders/image-visual-shader.frag
dali-toolkit/internal/graphics/shaders/image-visual-shader.vert
dali-toolkit/internal/graphics/shaders/mesh-visual-normal-map-shader.vert
dali-toolkit/internal/graphics/shaders/mesh-visual-shader.vert
dali-toolkit/internal/graphics/shaders/mesh-visual-simple-shader.vert
dali-toolkit/internal/graphics/shaders/npatch-visual-3x3-shader.vert
dali-toolkit/internal/graphics/shaders/npatch-visual-shader.vert
dali-toolkit/internal/graphics/shaders/primitive-visual-shader.vert
dali-toolkit/internal/graphics/shaders/text-scroller-shader.vert
dali-toolkit/internal/graphics/shaders/text-visual-shader.vert
dali-toolkit/internal/graphics/shaders/wireframe-visual-shader.vert
dali-toolkit/internal/styling/style-manager-impl.cpp
dali-toolkit/internal/styling/style-manager-impl.h
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/layouts/layout-engine.h
dali-toolkit/internal/text/markup-processor.cpp
dali-toolkit/internal/text/multi-language-support-impl.cpp
dali-toolkit/internal/text/rendering/atlas/text-atlas-renderer.cpp
dali-toolkit/internal/text/rendering/text-typesetter.cpp
dali-toolkit/internal/text/rendering/view-model.cpp
dali-toolkit/internal/text/text-controller-impl.h
dali-toolkit/internal/text/text-controller-relayouter.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/internal/text/text-controller.h
dali-toolkit/internal/text/text-view.cpp
dali-toolkit/internal/visuals/animated-image/animated-image-visual.cpp
dali-toolkit/internal/visuals/animated-image/rolling-animated-image-cache.cpp
dali-toolkit/internal/visuals/animated-image/rolling-image-cache.cpp
dali-toolkit/internal/visuals/animated-vector-image/animated-vector-image-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.cpp
dali-toolkit/internal/visuals/color/color-visual.h
dali-toolkit/internal/visuals/gradient/gradient-visual.cpp
dali-toolkit/internal/visuals/image-visual-shader-factory.cpp
dali-toolkit/internal/visuals/image/image-visual.cpp
dali-toolkit/internal/visuals/svg/svg-visual.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.cpp
dali-toolkit/internal/visuals/visual-base-data-impl.h
dali-toolkit/internal/visuals/visual-base-impl.cpp
dali-toolkit/internal/visuals/visual-base-impl.h
dali-toolkit/internal/visuals/visual-factory-impl.cpp
dali-toolkit/public-api/dali-toolkit-version.cpp
packaging/dali-toolkit.spec

index e8bbb21..5b8469d 100644 (file)
@@ -351,11 +351,13 @@ void CreateTextModel(const std::string&                text,
   layoutParameters.startLineIndex         = 0u;
   layoutParameters.estimatedNumberOfLines = logicalModel->mParagraphInfo.Count();
 
-  bool isAutoScroll = false;
+  bool isAutoScroll                   = false;
+  bool isAutoScrollMaxTextureExceeded = false;
   layoutEngine.LayoutText(layoutParameters,
                           layoutSize,
                           false,
                           isAutoScroll,
+                          isAutoScrollMaxTextureExceeded,
                           ellipsisPosition);
 
   if(options.align)
index f636a19..5a15b09 100644 (file)
@@ -180,11 +180,13 @@ bool LayoutTextTest(const LayoutTextData& data)
 
   layoutSize = Vector2::ZERO;
 
-  bool       isAutoScroll = false;
-  const bool updated      = engine.LayoutText(layoutParameters,
+  bool       isAutoScroll                   = false;
+  bool       isAutoScrollMaxTextureExceeded = false;
+  const bool updated                        = engine.LayoutText(layoutParameters,
                                          layoutSize,
                                          data.ellipsis,
                                          isAutoScroll,
+                                         isAutoScrollMaxTextureExceeded,
                                          DevelText::EllipsisPosition::END);
 
   // 4) Compare the results.
index bab8800..75d8bb4 100755 (executable)
@@ -74,7 +74,7 @@ namespace
     ControllerPtr controller = Controller::New();
 
     // Tests the rendering controller has been created.
-    TypesetterPtr typesetter = Typesetter::New( controller->GetTextModel() );
+    TypesetterPtr typesetter = Typesetter::New(controller->GetTextModel());
     DALI_TEST_CHECK(typesetter);
 
     // Tests the view model has been created.
@@ -91,7 +91,7 @@ namespace
     controller->SetLineWrapMode( (Text::LineWrap::Mode)(data.lineWrapMode) );
     controller->SetEllipsisPosition( data.ellipsisPosition );
 
-    controller->SetText( data.text );
+    controller->SetText(data.text);
     controller->Relayout( data.size );
 
     // Elide the glyphs.
@@ -532,780 +532,736 @@ int UtcDaliTextLabelElideTextLocation(void)
   Size  textSize36( 120.0f, 30.0f );
   float positions36[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
 
+  Size  textSize37(145.0f, 30.0f);
+  float positions37[] = {131.0f, 126.0f, 121.0f, 116.0f, 108.0f, 103.0f, 93.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f};
+
+  Size  textSize38(145.0f, 30.0f);
+  float positions38[] = {51.0f, 66.0f, 71.0f, 79.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 27.0f, 23.0f, 14.0f, 10.0f, 0.0f};
+
   struct ElideData data[] =
-  {
     {
-      "void text",
-      "",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize00,
-      0u,
-      0u,
-      nullptr
-    },
+      {"void text",
+       "",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize00,
+       0u,
+       0u,
+       nullptr},
+
+      {"void text",
+       "",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize00,
+       0u,
+       0u,
+       nullptr},
+
+      {"void text",
+       "",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize00,
+       0u,
+       0u,
+       nullptr},
+
+      //END LTR cases
+      {
+        "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
+        "A0123456789 B0123456789 C0123456789 D0123456789 ",
+        false,
+        DevelText::LineWrap::WORD,
+        DevelText::EllipsisPosition::END,
+        false,
+        textSize01,
+        1u,
+        10u,
+        positions01},
+
+      {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
+       "A0123456789 B0123456789 C0123456789 D0123456789 ",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize02,
+       2u,
+       22u,
+       positions02},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize03,
+       3u,
+       29u,
+       positions03},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::CHARACTER,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize04,
+       3u,
+       40u,
+       positions04},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::HYPHENATION,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize05,
+       3u,
+       32u,
+       positions05},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::MIXED,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize06,
+       3u,
+       28u,
+       positions06},
+
+      //START LTR cases
+      {
+        "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
+        "A0123456789 B0123456789 C0123456789 D0123456789 ",
+        false,
+        DevelText::LineWrap::WORD,
+        DevelText::EllipsisPosition::START,
+        false,
+        textSize07,
+        1u,
+        11u,
+        positions07,
+
+      },
+
+      {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
+       "A0123456789 B0123456789 C0123456789 D0123456789 ",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize08,
+       2u,
+       23u,
+       positions08},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize09,
+       3u,
+       33u,
+       positions09},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::CHARACTER,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize10,
+       3u,
+       37u,
+       positions10},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::HYPHENATION,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize11,
+       3u,
+       25u,
+       positions11},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::MIXED,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize12,
+       3u,
+       25u,
+       positions12},
+
+      //END RTL cases
+      {
+        "EllipsisPosition: TextLabel: SingleLine RTL END",
+        "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+        false,
+        DevelText::LineWrap::WORD,
+        DevelText::EllipsisPosition::END,
+        false,
+        textSize13,
+        1u,
+        14u,
+        positions13},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize14,
+       3u,
+       42u,
+       positions14},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::CHARACTER,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize15,
+       3u,
+       44u,
+       positions15},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::HYPHENATION,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize16,
+       3u,
+       39u,
+       positions16},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::MIXED,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize17,
+       3u,
+       39u,
+       positions17},
+
+      //START RTL cases
+      {
+        "EllipsisPosition: TextLabel: SingleLine RTL START",
+        "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+        false,
+        DevelText::LineWrap::WORD,
+        DevelText::EllipsisPosition::START,
+        false,
+        textSize18,
+        1u,
+        13u,
+        positions18},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize19,
+       3u,
+       33u,
+       positions19},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::CHARACTER,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize20,
+       3u,
+       30u,
+       positions20},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::HYPHENATION,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize21,
+       3u,
+       33u,
+       positions21},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::MIXED,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize22,
+       3u,
+       33u,
+       positions22},
+
+      //MIDDLE LTR cases
+      {
+        "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
+        "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
+        false,
+        DevelText::LineWrap::WORD,
+        DevelText::EllipsisPosition::MIDDLE,
+        false,
+        textSize23,
+        1u,
+        10u,
+        positions23},
+
+      {"EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
+       "A0123456789 B0123456789 C0123456789 D0123456789 ",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize24,
+       2u,
+       22u,
+       positions24},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize25,
+       3u,
+       24u,
+       positions25},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
+       true,
+       DevelText::LineWrap::CHARACTER,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize26,
+       3u,
+       36u,
+       positions26},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
+       true,
+       DevelText::LineWrap::HYPHENATION,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize27,
+       3u,
+       27u,
+       positions27},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
+       true,
+       DevelText::LineWrap::MIXED,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize28,
+       3u,
+       24u,
+       positions28},
+
+      //MIDDLE RTL cases
+      {
+        "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
+        "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+        false,
+        DevelText::LineWrap::WORD,
+        DevelText::EllipsisPosition::MIDDLE,
+        false,
+        textSize29,
+        1u,
+        13u,
+        positions29},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize30,
+       3u,
+       31u,
+       positions30},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::CHARACTER,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize31,
+       3u,
+       29u,
+       positions31},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::HYPHENATION,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize32,
+       3u,
+       31u,
+       positions32},
+
+      {"EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       true,
+       DevelText::LineWrap::MIXED,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize33,
+       3u,
+       31u,
+       positions33},
+
+      {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize34,
+       1u,
+       13u,
+       positions34},
+
+      {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize35,
+       1u,
+       11u,
+       positions35},
+
+      {"EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       true,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize36,
+       1u,
+       12u,
+       positions36},
+
+      {"EllipsisPosition: TextLabel: Mixed Directions Languages END",
+       "سیٹنگیں Projector Ø³ÛŒÙ¹Ù†Ú¯ÛŒÚº",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize37,
+       1u,
+       16u,
+       positions37},
+
+      {"EllipsisPosition: TextLabel: Mixed Directions Languages START",
+       "سیٹنگیں Projector Ø³ÛŒÙ¹Ù†Ú¯ÛŒÚº",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize38,
+       1u,
+       17u,
+       positions38},
+
+    };
+  const unsigned int numberOfTests = 41u;
 
+  for( unsigned int index = 0u; index < numberOfTests; ++index )
+  {
+    ToolkitTestApplication application;
+    if( !ElideTestViewModel( data[index] ) )
     {
-      "void text",
-      "",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize00,
-      0u,
-      0u,
-      nullptr
-    },
+      tet_result(TET_FAIL);
+    }
+  }
 
-    {
-      "void text",
-      "",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize00,
-      0u,
-      0u,
-      nullptr
-    },
+  tet_result(TET_PASS);
+  END_TEST;
+}
 
-   //END LTR cases
-    {
-      "EllipsisPosition: TextLabel: Basic case SingleLine LTR END",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize01,
-      1u,
-      10u,
-      positions01
-    },
 
-    {
-      "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR END",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize02,
-      2u,
-      22u,
-      positions02
-    },
+int UtcDaliTextFieldlElideTextLocation(void)
+{
+  tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR END",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize03,
-      3u,
-      29u,
-      positions03
-    },
+  Size textSize00( 100.f, 100.f );
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR END",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::CHARACTER,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize04,
-      3u,
-      40u,
-      positions04
-    },
+  Size  textSize01( 120.0f, 50.0f );
+  float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR END",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::HYPHENATION,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize05,
-      3u,
-      32u,
-      positions05
-    },
+  Size  textSize02( 120.0f, 50.0f );
+  float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR END",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::MIXED,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize06,
-      3u,
-      28u,
-      positions06
-    },
+  Size  textSize03( 120.0f, 50.0f );
+  float positions03[] = { 117.0f, 111.0f, 97.0f, 88.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 31.0f, 22.0f, 7.0f };
 
-   //START LTR cases
-    {
-      "EllipsisPosition: TextLabel: Basic case SingleLine LTR START",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize07,
-      1u,
-      11u,
-      positions07
-    },
+  Size  textSize04( 120.0f, 50.0f );
+  float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR START",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize08,
-      2u,
-      23u,
-      positions08
-    },
+  Size  textSize05( 120.0f, 50.0f );
+  float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR START",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize09,
-      3u,
-      33u,
-      positions09
-    },
+  Size  textSize06( 120.0f, 50.0f );
+  float positions06[] = { 90.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 29.0f, 26.0f, 15.0f, 7.0f, 0.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR START",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::CHARACTER,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize10,
-      3u,
-      37u,
-      positions10
-    },
+  Size  textSize07( 120.0f, 50.0f );
+  float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR START",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::HYPHENATION,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize11,
-      3u,
-      25u,
-      positions11
-    },
+  Size  textSize08( 120.0f, 50.0f );
+  float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR START",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::MIXED,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize12,
-      3u,
-      25u,
-      positions12
-    },
+  Size  textSize09( 120.0f, 50.0f );
+  float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f };
 
-  //END RTL cases
-    {
-      "EllipsisPosition: TextLabel: SingleLine RTL END",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize13,
-      1u,
-      14u,
-      positions13
-    },
+  Size  textSize10( 120.0f, 50.0f );
+  float positions10[] = { 121.0f, 116.0f, 111.0f, 106.0f, 101.0f, 96.0f, 92.0f, 87.0f, 83.0f, 77.0f, 63.0f, 55.0f, 46.0f, 40.0f, 30.0f, 16.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL END",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize14,
-      3u,
-      42u,
-      positions14
-    },
+  Size  textSize11( 120.0f, 50.0f );
+  float positions11[] = { 93.0f, 77.0f, 74.0f, 63.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 24.0f, 19.0f, 14.0f, 9.0f, 5.0f };
 
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL END",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::CHARACTER,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize15,
-      3u,
-      44u,
-      positions15
-    },
+  Size  textSize12( 120.0f, 50.0f );
+  float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f };
 
+  Size  textSize13(145.0f, 30.0f);
+  float positions13[] = {131.0f, 126.0f, 121.0f, 117.0f, 108.0f, 104.0f, 94.0f, 88.0f, 20.0f, 29.0f, 34.0f, 42.0f, 48.0f, 57.0f, 67.0f};
+
+  Size  textSize14(145.0f, 30.0f);
+  float positions14[] = {51.0f, 66.0f, 71.0f, 80.0f, 85.0f, 94.0f, 103.0f, 109.0f, 119.0f, 51.0f, 37.0f, 32.0f, 28.0f, 23.0f, 14.0f, 10.0f, 0.0f};
+
+  struct ElideData data[] =
     {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL END",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::HYPHENATION,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize16,
-      3u,
-      39u,
-      positions16
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL END",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::MIXED,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize17,
-      3u,
-      39u,
-      positions17
-    },
-
-   //START RTL cases
-    {
-      "EllipsisPosition: TextLabel: SingleLine RTL START",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize18,
-      1u,
-      13u,
-      positions18
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL START",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize19,
-      3u,
-      33u,
-      positions19
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL START",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::CHARACTER,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize20,
-      3u,
-      30u,
-      positions20
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL START",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::HYPHENATION,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize21,
-      3u,
-      33u,
-      positions21
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL START",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::MIXED,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize22,
-      3u,
-      33u,
-      positions22
-    },
-
-  //MIDDLE LTR cases
-    {
-      "EllipsisPosition: TextLabel: Basic case SingleLine LTR MIDDLE",
-      "ABCDEFGHIJKLMNPQRSTUVWXYZ abcdefghijklmnpqrstuvwxyz",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize23,
-      1u,
-      10u,
-      positions23
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Basic case Mulitlines LineWrap-WORD LTR MIDDLE",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize24,
-      2u,
-      22u,
-      positions24
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD LTR MIDDLE",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize25,
-      3u,
-      24u,
-      positions25
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER LTR MIDDLE",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
-      true,
-      DevelText::LineWrap::CHARACTER,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize26,
-      3u,
-      36u,
-      positions26
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHAN LTR MIDDLE",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
-      true,
-      DevelText::LineWrap::HYPHENATION,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize27,
-      3u,
-      27u,
-      positions27
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED LTR MIDDLE",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
-      true,
-      DevelText::LineWrap::MIXED,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize28,
-      3u,
-      24u,
-      positions28
-    },
-
-//MIDDLE RTL cases
-    {
-      "EllipsisPosition: TextLabel: SingleLine RTL MIDDLE",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize29,
-      1u,
-      13u,
-      positions29
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-WORD RTL MIDDLE",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize30,
-      3u,
-      31u,
-      positions30
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-CHARACTER RTL MIDDLE",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::CHARACTER,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize31,
-      3u,
-      29u,
-      positions31
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-HYPHENATION RTL MIDDLE",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::HYPHENATION,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize32,
-      3u,
-      31u,
-      positions32
-    },
-
-    {
-      "EllipsisPosition: TextLabel: Mulitlines LineWrap-MIXED RTL MIDDLE",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      true,
-      DevelText::LineWrap::MIXED,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize33,
-      3u,
-      31u,
-      positions33
-    },
-
-    {
-      "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR END",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize34,
-      1u,
-      13u,
-      positions34
-    },
-
-    {
-      "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR START",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize35,
-      1u,
-      11u,
-      positions35
-    },
-
-    {
-      "EllipsisPosition: TextLabel: One-Line for Mulitlines LineWrap-WORD LTR MIDDLE",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      true,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize36,
-      1u,
-      12u,
-      positions36
-    },
-
-  };
-  const unsigned int numberOfTests = 39u;
-
-  for( unsigned int index = 0u; index < numberOfTests; ++index )
-  {
-    ToolkitTestApplication application;
-    if( !ElideTestViewModel( data[index] ) )
-    {
-      tet_result(TET_FAIL);
-    }
-  }
-
-  tet_result(TET_PASS);
-  END_TEST;
-}
-
-
-int UtcDaliTextFieldlElideTextLocation(void)
-{
-  tet_infoline(" UtcDaliTextFieldlElideTextLocation ");
-
-  Size textSize00( 100.f, 100.f );
-
-  Size  textSize01( 120.0f, 50.0f );
-  float positions01[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 50.0f, 60.0f, 70.0f, 80.0f, 91.0f };
-
-  Size  textSize02( 120.0f, 50.0f );
-  float positions02[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f, 59.0f, 65.0f, 73.0f, 84.0f, 93.0f };
-
-  Size  textSize03( 120.0f, 50.0f );
-  float positions03[] = { 117.0f, 111.0f, 97.0f, 88.0f, 80.0f, 74.0f, 64.0f, 59.0f, 54.0f, 45.0f, 37.0f, 31.0f, 22.0f, 7.0f };
-
-  Size  textSize04( 120.0f, 50.0f );
-  float positions04[] = { 5.0f, 21.0f, 31.0f, 41.0f, 50.0f, 61.0f, 71.0f, 80.0f, 90.0f, 100.0f, 109.0f };
-
-  Size  textSize05( 120.0f, 50.0f );
-  float positions05[] = { 8.0f, 24.0f, 35.0f, 44.0f, 49.0f, 63.0f, 74.0f, 77.0f, 85.0f, 96.0f, 110.0f };
-
-  Size  textSize06( 120.0f, 50.0f );
-  float positions06[] = { 90.0f, 79.0f, 70.0f, 68.0f, 62.0f, 56.0f, 51.0f, 42.0f, 29.0f, 26.0f, 15.0f, 7.0f, 0.0f };
-
-  Size  textSize07( 120.0f, 50.0f );
-  float positions07[] = { 0.0f, 11.0f, 21.0f, 31.0f, 41.0f, 53.0f };
-
-  Size  textSize08( 120.0f, 50.0f );
-  float positions08[] = { 0.0f, 10.0f, 21.0f, 25.0f, 28.0f, 38.0f, 44.0f, 55.0f };
-
-  Size  textSize09( 120.0f, 50.0f );
-  float positions09[] = { 116.0f, 109.0f, 96.0f, 87.0f, 79.0f, 73.0f, 63.0f };
-
-  Size  textSize10( 120.0f, 50.0f );
-  float positions10[] = { 121.0f, 116.0f, 111.0f, 106.0f, 101.0f, 96.0f, 92.0f, 87.0f, 83.0f, 77.0f, 63.0f, 55.0f, 46.0f, 40.0f, 30.0f, 16.0f };
-
-  Size  textSize11( 120.0f, 50.0f );
-  float positions11[] = { 93.0f, 77.0f, 74.0f, 63.0f, 56.0f, 49.0f, 44.0f, 39.0f, 34.0f, 29.0f, 24.0f, 19.0f, 14.0f, 9.0f, 5.0f };
-
-  Size  textSize12( 120.0f, 50.0f );
-  float positions12[] = { 117.0f, 112.0f, 107.0f, 102.0f, 97.0f, 92.0f, 87.0f, 82.0f, 79.0f, 72.0f };
-
-  struct ElideData data[] =
-  {
-    {
-      "void text",
-      "",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize00,
-      0u,
-      0u,
-      nullptr
-    },
-
-    {
-      "void text",
-      "",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize00,
-      0u,
-      0u,
-      nullptr
-    },
-
-    {
-      "void text",
-      "",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize00,
-      0u,
-      0u,
-      nullptr
-    },
-
-    {
-      "EllipsisPosition: TextField: Basic case SingleLine LTR END",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize01,
-      1u,
-      10u,
-      positions01
-    },
-
-    {
-      "EllipsisPosition: TextField: SingleLine LTR END",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize02,
-      1u,
-      13u,
-      positions02
-    },
-
-    {
-      "EllipsisPosition: TextField: SingleLine RTL END",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize03,
-      1u,
-      14u,
-      positions03
-    },
-
-    {
-      "EllipsisPosition: TextField: Basic case SingleLine LTR START",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize04,
-      1u,
-      11u,
-      positions04
-    },
-
-    {
-      "EllipsisPosition: TextField: SingleLine LTR START",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Welcome" ,
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize05,
-      1u,
-      11u,
-      positions05
-    },
-
-    {
-      "EllipsisPosition: TextField: SingleLine RTL START",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize06,
-      1u,
-      13u,
-      positions06
-    },
-
-    {
-      "EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
-      "A0123456789 B0123456789 C0123456789 D0123456789 ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize07,
-      1u,
-      11u,
-      positions07
-    },
-
-    {
-      "EllipsisPosition: TextField: SingleLine LTR MIDDLE",
-      "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye" ,
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize08,
-      1u,
-      13u,
-      positions08
-    },
-
-    {
-      "EllipsisPosition: TextField: SingleLine RTL MIDDLE",
-      "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize09,
-      1u,
-      13u,
-      positions09
-    },
-
-    {
-      "EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
-      "        Ø§Ù„سلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة         ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::END,
-      false,
-      textSize10,
-      1u,
-      16u,
-      positions10
-    },
-
-    {
-      "EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
-      "        Ø§Ù„سلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة         ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::START,
-      false,
-      textSize11,
-      1u,
-      15u,
-      positions11
-    },
-
-    {
-      "EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
-      "        Ø§Ù„سلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة         ",
-      false,
-      DevelText::LineWrap::WORD,
-      DevelText::EllipsisPosition::MIDDLE,
-      false,
-      textSize12,
-      1u,
-      20u,
-      positions12
-    },
-
-  };
-
-  const unsigned int numberOfTests = 15u;
+      {"void text",
+       "",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize00,
+       0u,
+       0u,
+       nullptr},
+
+      {"void text",
+       "",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize00,
+       0u,
+       0u,
+       nullptr},
+
+      {"void text",
+       "",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize00,
+       0u,
+       0u,
+       nullptr},
+
+      {"EllipsisPosition: TextField: Basic case SingleLine LTR END",
+       "A0123456789 B0123456789 C0123456789 D0123456789 ",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize01,
+       1u,
+       10u,
+       positions01},
+
+      {"EllipsisPosition: TextField: SingleLine LTR END",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize02,
+       1u,
+       13u,
+       positions02},
+
+      {"EllipsisPosition: TextField: SingleLine RTL END",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize03,
+       1u,
+       14u,
+       positions03},
+
+      {"EllipsisPosition: TextField: Basic case SingleLine LTR START",
+       "A0123456789 B0123456789 C0123456789 D0123456789 ",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize04,
+       1u,
+       11u,
+       positions04},
+
+      {"EllipsisPosition: TextField: SingleLine LTR START",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Welcome",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize05,
+       1u,
+       11u,
+       positions05},
+
+      {"EllipsisPosition: TextField: SingleLine RTL START",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize06,
+       1u,
+       13u,
+       positions06},
+
+      {"EllipsisPosition: TextField: Basic case SingleLine LTR MIDDLE",
+       "A0123456789 B0123456789 C0123456789 D0123456789 ",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize07,
+       1u,
+       11u,
+       positions07},
+
+      {"EllipsisPosition: TextField: SingleLine LTR MIDDLE",
+       "Hello Hi Experimen Welcome Hello Hi Experimen Goodbye",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize08,
+       1u,
+       13u,
+       positions08},
+
+      {"EllipsisPosition: TextField: SingleLine RTL MIDDLE",
+       "السلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize09,
+       1u,
+       13u,
+       positions09},
+
+      {"EllipsisPosition: TextField: Head and Tail whitespaces RTL END",
+       "        Ø§Ù„سلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة         ",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize10,
+       1u,
+       16u,
+       positions10},
+
+      {"EllipsisPosition: TextField: Head and Tail whitespaces RTL START",
+       "        Ø§Ù„سلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة         ",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize11,
+       1u,
+       15u,
+       positions11},
+
+      {"EllipsisPosition: TextField: Head and Tail whitespaces RTL MIDDLE",
+       "        Ø§Ù„سلام Ø¹Ù„يكم Ù…رحبا Ø§Ù‡Ù„ا Ù‡Ø°Ø§ Ø§Ø®ØªØ¨Ø§Ø± Ø´ÙƒØ±Ø§ Ù„لمساعدة         ",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::MIDDLE,
+       false,
+       textSize12,
+       1u,
+       20u,
+       positions12},
+
+      {"EllipsisPosition: TextField: Mixed Directions Languages END",
+       "سیٹنگیں Projector Ø³ÛŒÙ¹Ù†Ú¯ÛŒÚº",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::END,
+       false,
+       textSize13,
+       1u,
+       16,
+       positions13},
+
+      {"EllipsisPosition: TextField: Mixed Directions Languages START",
+       "سیٹنگیں Projector Ø³ÛŒÙ¹Ù†Ú¯ÛŒÚº",
+       false,
+       DevelText::LineWrap::WORD,
+       DevelText::EllipsisPosition::START,
+       false,
+       textSize14,
+       1u,
+       17,
+       positions14},
+
+    };
+
+  const unsigned int numberOfTests = 17u;
 
   for( unsigned int index = 0u; index < numberOfTests; ++index )
   {
old mode 100755 (executable)
new mode 100644 (file)
index 9b71156..6ec3bfe
@@ -180,11 +180,13 @@ bool LayoutTextTest(const LayoutTextData& data)
 
   layoutSize = Vector2::ZERO;
 
-  bool       isAutoScroll = false;
-  const bool updated      = engine.LayoutText(layoutParameters,
+  bool       isAutoScroll                   = false;
+  bool       isAutoScrollMaxTextureExceeded = false;
+  const bool updated                        = engine.LayoutText(layoutParameters,
                                          layoutSize,
                                          data.ellipsis,
                                          isAutoScroll,
+                                         isAutoScrollMaxTextureExceeded,
                                          data.ellipsisPosition);
 
   // 4) Compare the results.
index 80624a8..301f191 100755 (executable)
@@ -87,7 +87,7 @@ bool IsEqualGlyph(const GlyphInfoData& glyphData, const GlyphInfo& glyph)
   {
     return false;
   }
-  if(fabsf(glyphData.advance - floor(glyph.advance)) > Math::MACHINE_EPSILON_1000)
+  if(glyphData.advance >= 0.0f && fabsf(glyphData.advance - floor(glyph.advance)) > Math::MACHINE_EPSILON_1000)
   {
     return false;
   }
@@ -961,9 +961,10 @@ int UtcDaliTextShapeEmojiSequences(void)
   bool sizeDefined   = false;
 
   // variation selector 16 (Emoji)
+  // Note : Non-scalable font's advance value is undefined. See https://github.com/harfbuzz/harfbuzz/discussions/3023. 2022-06-03 updated.
   struct GlyphInfoData glyphsVS16[] =
     {
-      {2u, 74u, 0.f, 0.f, 0.f, 0.f, 39.0f, 0.f, false, false},
+      {2u, 74u, 0.f, 0.f, 0.f, 0.f, -1.0f /* Special value that we don't check it */, 0.f, false, false},
     };
   CharacterIndex characterIndicesVS16[]   = {0u, 1u};
   Length         charactersPerGlyphVS16[] = {2u};
index 332e771..784af73 100644 (file)
@@ -24,6 +24,7 @@
 #include <dali-toolkit/public-api/transition/transition-set.h>
 #include <dali-toolkit/public-api/transition/transition.h>
 #include <dali/devel-api/actors/actor-devel.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h> // for Renderer Property Index.
 #include <stdlib.h>
 #include <iostream>
 
@@ -287,18 +288,14 @@ int UtcDaliTransitionBetweenControlPair(void)
 
   DALI_TEST_NOT_EQUALS(destinationPosition, control2.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
   DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
-  Dali::Renderer  renderer = control2.GetRendererAt(0);
-  Property::Index index    = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
-  cornerRadius             = renderer.GetCurrentProperty<Vector4>(index);
+  Dali::Renderer renderer = control2.GetRendererAt(0);
+  cornerRadius            = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
   DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
-  borderlineWidth = renderer.GetCurrentProperty<float>(index);
+  borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
   DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
-  borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+  borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
   DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
-  index            = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
-  borderlineOffset = renderer.GetCurrentProperty<float>(index);
+  borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
   DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
 
   application.SendNotification();
@@ -318,17 +315,13 @@ int UtcDaliTransitionBetweenControlPair(void)
   DALI_TEST_EQUALS(destinationOpacity, control2.GetCurrentProperty<float>(Actor::Property::OPACITY), TEST_LOCATION);
   DALI_TEST_EQUALS(1, control2.GetRendererCount(), TEST_LOCATION);
   renderer     = control2.GetRendererAt(0);
-  index        = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
-  cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+  cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
   DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
-  borderlineWidth = renderer.GetCurrentProperty<float>(index);
+  borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
   DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
-  borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+  borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
   DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
-  index            = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
-  borderlineOffset = renderer.GetCurrentProperty<float>(index);
+  borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
   DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   END_TEST;
@@ -431,21 +424,17 @@ int UtcDaliTransitionBetweenControlPair2(void)
   DALI_TEST_NOT_EQUALS(destinationPosition, control1.GetCurrentProperty<Vector3>(Actor::Property::POSITION), 0.00001f, TEST_LOCATION);
   DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
 
-  Dali::Renderer  renderer = control1.GetRendererAt(0);
-  Property::Index index    = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
-  cornerRadius             = renderer.GetCurrentProperty<Vector4>(index);
+  Dali::Renderer renderer = control1.GetRendererAt(0);
+  cornerRadius            = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
   DALI_TEST_NOT_EQUALS(destinationRadiusV4, cornerRadius, 0.00001f, TEST_LOCATION);
 
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
-  borderlineWidth = renderer.GetCurrentProperty<float>(index);
+  borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
   DALI_TEST_NOT_EQUALS(destinationBorderlineWidth, borderlineWidth, 0.00001f, TEST_LOCATION);
 
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
-  borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+  borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
   DALI_TEST_NOT_EQUALS(destinationBorderlineColor, borderlineColor, 0.00001f, TEST_LOCATION);
 
-  index            = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
-  borderlineOffset = renderer.GetCurrentProperty<float>(index);
+  borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
   DALI_TEST_NOT_EQUALS(destinationBorderlineOffset, borderlineOffset, 0.00001f, TEST_LOCATION);
 
   application.SendNotification();
@@ -465,20 +454,16 @@ int UtcDaliTransitionBetweenControlPair2(void)
 
   DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
   renderer     = control1.GetRendererAt(0);
-  index        = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
-  cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+  cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
   DALI_TEST_EQUALS(destinationRadiusV4, cornerRadius, TEST_LOCATION);
 
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
-  borderlineWidth = renderer.GetCurrentProperty<float>(index);
+  borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
   DALI_TEST_EQUALS(destinationBorderlineWidth, borderlineWidth, TEST_LOCATION);
 
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
-  borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+  borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
   DALI_TEST_EQUALS(destinationBorderlineColor, borderlineColor, TEST_LOCATION);
 
-  index            = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
-  borderlineOffset = renderer.GetCurrentProperty<float>(index);
+  borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
   DALI_TEST_EQUALS(destinationBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   // every actor properties of control1 are returned to the source properties.
@@ -494,20 +479,16 @@ int UtcDaliTransitionBetweenControlPair2(void)
   // after next update, renderer properties are returned to the source properties.
   DALI_TEST_EQUALS(1, control1.GetRendererCount(), TEST_LOCATION);
   renderer     = control1.GetRendererAt(0);
-  index        = renderer.GetPropertyIndex(DevelVisual::Property::CORNER_RADIUS);
-  cornerRadius = renderer.GetCurrentProperty<Vector4>(index);
+  cornerRadius = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
   DALI_TEST_EQUALS(sourceRadiusV4, cornerRadius, TEST_LOCATION);
 
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_WIDTH);
-  borderlineWidth = renderer.GetCurrentProperty<float>(index);
+  borderlineWidth = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
   DALI_TEST_EQUALS(sourceBorderlineWidth, borderlineWidth, TEST_LOCATION);
 
-  index           = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_COLOR);
-  borderlineColor = renderer.GetCurrentProperty<Vector4>(index);
+  borderlineColor = renderer.GetCurrentProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
   DALI_TEST_EQUALS(sourceBorderlineColor, borderlineColor, TEST_LOCATION);
 
-  index            = renderer.GetPropertyIndex(DevelVisual::Property::BORDERLINE_OFFSET);
-  borderlineOffset = renderer.GetCurrentProperty<float>(index);
+  borderlineOffset = renderer.GetCurrentProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
   DALI_TEST_EQUALS(sourceBorderlineOffset, borderlineOffset, TEST_LOCATION);
 
   END_TEST;
index 175e834..7c13fc1 100644 (file)
@@ -141,6 +141,38 @@ bool DaliTestCheckMaps(const Property::Map& fontStyleMapGet, const Property::Map
   return true;
 }
 
+void TestShaderCodeContainSubstrings(Control control, std::vector<std::pair<std::string, bool>> substringCheckList, const char* location)
+{
+  Renderer        renderer = control.GetRendererAt(0);
+  Shader          shader   = renderer.GetShader();
+  Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
+  Property::Map*  map      = value.GetMap();
+  DALI_TEST_CHECK(map);
+
+  Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
+  DALI_TEST_CHECK(fragment);
+  std::string fragmentShader;
+  DALI_TEST_CHECK(fragment->Get(fragmentShader));
+  for(const auto& checkPair : substringCheckList)
+  {
+    const auto& keyword = checkPair.first;
+    const auto& expect  = checkPair.second;
+    tet_printf("check [%s] %s exist in fragment shader\n", keyword.c_str(), expect ? "is" : "is not");
+    DALI_TEST_EQUALS((fragmentShader.find(keyword.c_str()) != std::string::npos), expect, location);
+  }
+
+  Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
+  std::string      vertexShader;
+  DALI_TEST_CHECK(vertex->Get(vertexShader));
+  for(const auto& checkPair : substringCheckList)
+  {
+    const auto& keyword = checkPair.first;
+    const auto& expect  = checkPair.second;
+    tet_printf("check [%s] %s exist in vertex shader\n", keyword.c_str(), expect ? "is" : "is not");
+    DALI_TEST_EQUALS((vertexShader.find(keyword.c_str()) != std::string::npos), expect, location);
+  }
+}
+
 } //namespace
 
 void dali_visual_startup(void)
@@ -906,7 +938,7 @@ int UtcDaliVisualGetPropertyMap6(void)
 
   value = resultMap.Find(ImageVisual::Property::BORDER, Property::RECTANGLE);
   DALI_TEST_CHECK(value);
-  DALI_TEST_CHECK(value->Get<Rect<int> >() == border);
+  DALI_TEST_CHECK(value->Get<Rect<int>>() == border);
 
   value = resultMap.Find(DevelImageVisual::Property::AUXILIARY_IMAGE, Property::STRING);
   DALI_TEST_CHECK(value);
@@ -947,7 +979,7 @@ int UtcDaliVisualGetPropertyMap6(void)
 
   value = resultMap.Find(ImageVisual::Property::BORDER, Property::RECTANGLE);
   DALI_TEST_CHECK(value);
-  DALI_TEST_CHECK(value->Get<Rect<int> >() == border);
+  DALI_TEST_CHECK(value->Get<Rect<int>>() == border);
 
   END_TEST;
 }
@@ -5671,27 +5703,14 @@ int UtcDaliVisualUpdatePropertyChangeShader01(void)
   application.SendNotification();
   application.Render();
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", false},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", false},
+    },
+    TEST_LOCATION);
+
   callStack.Reset();
   callStack.Enable(true);
 
@@ -5716,27 +5735,13 @@ int UtcDaliVisualUpdatePropertyChangeShader01(void)
   DALI_TEST_CHECK(cornerRadiusPolicyValue);
   DALI_TEST_EQUALS(cornerRadiusPolicyValue->Get<int>(), static_cast<int>(Toolkit::Visual::Transform::Policy::RELATIVE), TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", false},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true},
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
@@ -5786,29 +5791,13 @@ int UtcDaliVisualUpdatePropertyChangeShader01(void)
   DALI_TEST_CHECK(borderlineOffsetValue);
   DALI_TEST_EQUALS(borderlineOffsetValue->Get<float>(), targetBorderlineOffset, TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
-    // Note : mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
-    // Note : mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", true},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true}, // Note : mAlwaysUsingCornerRadius is true.
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
@@ -5854,29 +5843,13 @@ int UtcDaliVisualUpdatePropertyChangeShader01(void)
   DALI_TEST_CHECK(borderlineOffsetValue);
   DALI_TEST_EQUALS(borderlineOffsetValue->Get<float>(), 0.0f, TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    // Note : mAlwaysUsingBorderline and mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    // Note : mAlwaysUsingBorderline and mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", true},     // Note : mAlwaysUsingBorderline is true.
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true}, // Note : mAlwaysUsingCornerRadius is true.
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
@@ -5919,27 +5892,13 @@ int UtcDaliVisualUpdatePropertyChangeShader02(void)
   application.SendNotification();
   application.Render();
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", false},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", false},
+    },
+    TEST_LOCATION);
 
   Vector4 targetCornerRadius = Vector4(0.0f, 0.0f, 0.0f, 0.0f);
 
@@ -5960,29 +5919,13 @@ int UtcDaliVisualUpdatePropertyChangeShader02(void)
   DALI_TEST_CHECK(cornerRadiusValue);
   DALI_TEST_EQUALS(cornerRadiusValue->Get<Vector4>(), targetCornerRadius, TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    // Note : corner radius is zero. so we don't change shader!
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    // Note : corner radius is zero. so we don't change shader!
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", false},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", false}, // Note : corner radius is zero. so we don't change shader!
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
@@ -6023,29 +5966,13 @@ int UtcDaliVisualUpdatePropertyChangeShader02(void)
   DALI_TEST_CHECK(borderlineOffsetValue);
   DALI_TEST_EQUALS(borderlineOffsetValue->Get<float>(), targetBorderlineOffset, TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    // Note : borderline width is zero. so we don't change shader!
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    // Note : borderline width is zero. so we don't change shader!
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", false}, // Note : borderline width is zero. so we don't change shader!
+      {"#define IS_REQUIRED_ROUNDED_CORNER", false},
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
@@ -6086,29 +6013,14 @@ int UtcDaliVisualUpdatePropertyChangeShader03(void)
   application.SendNotification();
   application.Render();
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BLUR 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BLUR 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") == std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BLUR", false},
+      {"#define IS_REQUIRED_BORDERLINE", false},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", false},
+    },
+    TEST_LOCATION);
 
   float   targetBlurRadius   = 15.0f;
   Vector4 targetCornerRadius = Vector4(1.0f, 0.1f, 1.1f, 0.0f);
@@ -6136,31 +6048,14 @@ int UtcDaliVisualUpdatePropertyChangeShader03(void)
   DALI_TEST_CHECK(cornerRadiusValue);
   DALI_TEST_EQUALS(cornerRadiusValue->Get<Vector4>(), targetCornerRadius, TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BLUR 1") != std::string::npos);
-    // Note : We ignore borderline when blur radius occured
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BLUR 1") != std::string::npos);
-    // Note : We ignore borderline when blur radius occured
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BLUR", true},
+      {"#define IS_REQUIRED_BORDERLINE", false}, // Note : We ignore borderline when blur radius occured
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true},
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
@@ -6193,33 +6088,14 @@ int UtcDaliVisualUpdatePropertyChangeShader03(void)
   DALI_TEST_CHECK(cornerRadiusValue);
   DALI_TEST_EQUALS(cornerRadiusValue->Get<Vector4>(), Vector4::ZERO, TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    // Note : mAlwaysUsingBlurRadius and mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BLUR 1") != std::string::npos);
-    // Note : We ignore borderline when blur radius occured
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    // Note : mAlwaysUsingBlurRadius and mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BLUR 1") != std::string::npos);
-    // Note : We ignore borderline when blur radius occured
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BLUR", true},           // Note : mAlwaysUsingBlurRadius is true.
+      {"#define IS_REQUIRED_BORDERLINE", false},    // Note : We ignore borderline when blur radius occured
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true}, // Note : mAlwaysUsingCornerRadius is true.
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
@@ -6264,27 +6140,14 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void)
   application.SendNotification();
   application.Render();
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", false},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true},
+    },
+    TEST_LOCATION);
+
   callStack.Reset();
   callStack.Enable(true);
 
@@ -6298,29 +6161,14 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void)
   application.Render();
   application.Render(1001u); // End of animation
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    // Note : mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") == std::string::npos);
-    // Note : mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", false},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true}, // Note : mAlwaysUsingCornerRadius is true.
+    },
+    TEST_LOCATION);
+
   callStack.Enable(false);
   // Shader not changed
   DALI_TEST_CHECK(!callStack.FindMethod("CreateShader"));
@@ -6350,29 +6198,13 @@ int UtcDaliVisualUpdatePropertyChangeShader04(void)
   DALI_TEST_CHECK(borderlineWidthValue);
   DALI_TEST_EQUALS(borderlineWidthValue->Get<float>(), targetBorderlineWidth, TEST_LOCATION);
 
-  // Get shader
-  {
-    Renderer        renderer = dummyControl.GetRendererAt(0);
-    Shader          shader   = renderer.GetShader();
-    Property::Value value    = shader.GetProperty(Shader::Property::PROGRAM);
-    Property::Map*  map      = value.GetMap();
-    DALI_TEST_CHECK(map);
-
-    Property::Value* fragment = map->Find("fragment"); // fragment key name from shader-impl.cpp
-    DALI_TEST_CHECK(fragment);
-    std::string fragmentShader;
-    DALI_TEST_CHECK(fragment->Get(fragmentShader));
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
-    // Note : mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(fragmentShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-
-    Property::Value* vertex = map->Find("vertex"); // vertex key name from shader-impl.cpp
-    std::string      vertexShader;
-    DALI_TEST_CHECK(vertex->Get(vertexShader));
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_BORDERLINE 1") != std::string::npos);
-    // Note : mAlwaysUsingCornerRadius is true.
-    DALI_TEST_CHECK(vertexShader.find("#define IS_REQUIRED_ROUNDED_CORNER 1") != std::string::npos);
-  }
+  TestShaderCodeContainSubstrings(
+    dummyControl,
+    {
+      {"#define IS_REQUIRED_BORDERLINE", true},
+      {"#define IS_REQUIRED_ROUNDED_CORNER", true}, // Note : mAlwaysUsingCornerRadius is true.
+    },
+    TEST_LOCATION);
 
   // Send shader compile signal
   application.SendNotification();
index 8891e9d..f900b5a 100644 (file)
@@ -64,7 +64,7 @@ if (ENABLE_PKG_CONFIGURE)
 
        set(PREFIX ${prefix})
        set(EXEC_PREFIX ${CMAKE_INSTALL_PREFIX})
-       set(DEV_INCLUDE_PATH ${repo_root_dir})
+       set(DEV_INCLUDE_PATH ${INCLUDE_DIR})
 
        set(core_pkg_cfg_file dali2-scene-loader.pc)
        configure_file(${CMAKE_CURRENT_LIST_DIR}/${core_pkg_cfg_file}.in ${core_pkg_cfg_file} @ONLY)
index 3031c5e..2c8bd97 100644 (file)
@@ -1263,9 +1263,10 @@ void DliLoader::Impl::ParseNodesInternal(const TreeNode* const nodes, Index inde
       auto& extras = nodeDef.mExtras;
       extras.reserve(eExtras->Size());
 
-      NodeDefinition::Extra e;
       for(auto i0 = eExtras->CBegin(), i1 = eExtras->CEnd(); i0 != i1; ++i0)
       {
+        NodeDefinition::Extra e;
+
         auto eExtra = *i0;
         e.mKey      = eExtra.first;
         if(e.mKey.empty())
index cc96d45..d7778d8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -25,7 +25,7 @@ namespace Toolkit
 {
 namespace DevelStyleManager
 {
-const Property::Map GetConfigurations(StyleManager styleManager)
+const Property::Map& GetConfigurations(StyleManager styleManager)
 {
   return GetImpl(styleManager).GetConfigurations();
 }
index f1e05d7..23c7999 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_STYLE_MANAGER_DEVEL_H
 
 /*
- * Copyright (c) 2020 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -46,7 +46,7 @@ using BrokenImageChangedSignalType = Signal<void(StyleManager)>;
  * @param[in] styleManager The instance of StyleManager
  * @return A property map to the currently defined configurations
 **/
-DALI_TOOLKIT_API const Property::Map GetConfigurations(StyleManager styleManager);
+DALI_TOOLKIT_API const Property::Map& GetConfigurations(StyleManager styleManager);
 
 /**
    * @brief Sets an image to be used when a visual has failed to correctly render
index c9ab7b5..d1d6900 100644 (file)
@@ -1065,11 +1065,14 @@ Size LayoutText(const RendererParameters& textParameters, TextAbstraction::TextR
 
   // Update the visual model.
   Size newLayoutSize;
-  bool isAutoScrollEnabled = false;
+  bool isAutoScrollEnabled            = false;
+  bool isAutoScrollMaxTextureExceeded = false;
+
   layoutEngine.LayoutText(layoutParameters,
                           newLayoutSize,
                           textParameters.ellipsisEnabled,
                           isAutoScrollEnabled,
+                          isAutoScrollMaxTextureExceeded,
                           ellipsisPosition);
 
   return newLayoutSize;
index 76d0ee2..97ccc81 100644 (file)
@@ -1125,6 +1125,7 @@ void TextLabel::SetUpAutoScrolling()
     if(textNaturalSize.width > maxTextureSize)
     {
       mController->SetTextElideEnabled(true);
+      mController->SetAutoScrollMaxTextureExceeded(true);
     }
     GetHeightForWidth(maxTextureSize);
     wrapGap = std::max(maxTextureSize - textNaturalSize.width, 0.0f);
@@ -1152,6 +1153,7 @@ void TextLabel::SetUpAutoScrolling()
   Renderer renderer = static_cast<Internal::Visual::Base&>(GetImplementation(mVisual)).GetRenderer();
   mTextScroller->SetParameters(Self(), renderer, textureSet, controlSize, verifiedSize, wrapGap, direction, mController->GetHorizontalAlignment(), mController->GetVerticalAlignment());
   mController->SetTextElideEnabled(actualellipsis);
+  mController->SetAutoScrollMaxTextureExceeded(false);
 }
 
 void TextLabel::ScrollingFinished()
index 4383c1a..20186ef 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -183,8 +183,10 @@ void KeyboardFocusManager::GetConfigurationFromStyleManger()
   Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
   if(styleManager)
   {
-    Property::Map config   = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
-    mAlwaysShowIndicator   = config["alwaysShowFocus"].Get<bool>() ? ALWAYS_SHOW : NONE;
+    const Property::Map& config               = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
+    const auto           alwaysShowFocusValue = config.Find("alwaysShowFocus", Property::Type::BOOLEAN);
+
+    mAlwaysShowIndicator   = (alwaysShowFocusValue && alwaysShowFocusValue->Get<bool>()) ? ALWAYS_SHOW : NONE;
     mIsFocusIndicatorShown = (mAlwaysShowIndicator == ALWAYS_SHOW) ? SHOW : HIDE;
     mClearFocusOnTouch     = (mIsFocusIndicatorShown == SHOW) ? false : true;
   }
@@ -520,16 +522,16 @@ bool KeyboardFocusManager::MoveFocus(Toolkit::Control::KeyboardFocus::Direction
         nextFocusableActor                  = mPreFocusChangeSignal.Emit(currentFocusActor, Actor(), direction);
         mIsWaitingKeyboardFocusChangeCommit = false;
       }
-      else if (mEnableDefaultAlgorithm)
+      else if(mEnableDefaultAlgorithm)
       {
         Actor rootActor = mFocusFinderRootActor.GetHandle();
         if(!rootActor)
         {
-          if (currentFocusActor)
+          if(currentFocusActor)
           {
             // Find the window of the focused actor.
             Integration::SceneHolder window = Integration::SceneHolder::Get(currentFocusActor);
-            if (window)
+            if(window)
             {
               rootActor = window.GetRootLayer();
             }
@@ -799,7 +801,7 @@ Actor KeyboardFocusManager::GetFocusIndicatorActor()
 
 void KeyboardFocusManager::OnKeyEvent(const KeyEvent& event)
 {
-  const std::string& keyName = event.GetKeyName();
+  const std::string& keyName    = event.GetKeyName();
   const std::string& deviceName = event.GetDeviceName();
 
   if(mIsFocusIndicatorShown == UNKNOWN)
@@ -1045,8 +1047,8 @@ void KeyboardFocusManager::OnWheelEvent(const WheelEvent& event)
 
 bool KeyboardFocusManager::OnCustomWheelEvent(const WheelEvent& event)
 {
-  bool consumed = false;
-  Actor actor = GetCurrentFocusActor();
+  bool  consumed = false;
+  Actor actor    = GetCurrentFocusActor();
   if(actor)
   {
     // Notify the actor about the wheel event
index e5cbaa7..5faf423 100644 (file)
@@ -36,9 +36,9 @@ uniform mediump vec2 anchorPoint;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix( uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy );
-  return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw );
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy );
+  return vec4( (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 );
 }
 
 void main()
index e063d81..4f6dab5 100644 (file)
@@ -13,10 +13,10 @@ uniform mediump vec2 anchorPoint;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw );
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
   vPosition = aPosition* visualSize;
-  return vec4( vPosition + anchorPoint*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
+  return vec4( vPosition + anchorPoint*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 );
 }
 
 void main()
index 6dc0721..6bf08fa 100644 (file)
@@ -14,9 +14,9 @@ uniform mediump vec2 anchorPoint;
 
 vec2 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
-  return (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy;
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw );
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
+  return (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy;
 }
 
 void main()
index 33202a2..db23361 100644 (file)
@@ -1,36 +1,26 @@
-#ifndef IS_REQUIRED_ROUNDED_CORNER
-#define IS_REQUIRED_ROUNDED_CORNER 0
-#endif
-#ifndef IS_REQUIRED_BORDERLINE
-#define IS_REQUIRED_BORDERLINE 0
-#endif
-#ifndef IS_REQUIRED_BLUR
-#define IS_REQUIRED_BLUR 0
-#endif
-
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE || IS_REQUIRED_BLUR
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE) || defined(IS_REQUIRED_BLUR)
 INPUT mediump vec2 vPosition;
 INPUT mediump vec2 vRectSize;
 INPUT mediump vec2 vOptRectSize;
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 INPUT mediump vec4 vCornerRadius;
 #endif
 #endif
 
 uniform lowp vec4 uColor;
 uniform lowp vec3 mixColor;
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_BORDERLINE)
 uniform mediump float borderlineWidth;
 uniform mediump float borderlineOffset;
 uniform lowp vec4 borderlineColor;
 uniform lowp vec4 uActorColor;
 #endif
-#if IS_REQUIRED_BLUR
+#ifdef IS_REQUIRED_BLUR
 uniform mediump float blurRadius;
 #endif
 
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE || IS_REQUIRED_BLUR
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE) || defined(IS_REQUIRED_BLUR)
 // Global values both rounded corner and borderline use
 
 // radius of rounded corner on this quadrant
@@ -54,7 +44,7 @@ mediump float gMinInlinePotential = 0.0;
 
 void calculateCornerRadius()
 {
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
   gRadius =
   mix(
     mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
@@ -68,7 +58,7 @@ void calculatePosition()
 {
   gFragmentPosition = abs(vPosition) - vRectSize;
   gCenterPosition = -gRadius;
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_BORDERLINE)
   gCenterPosition += borderlineWidth * (clamp(borderlineOffset, -1.0, 1.0) + 1.0) * 0.5;
 #endif
   gDiff = gFragmentPosition - gCenterPosition;
@@ -86,7 +76,7 @@ void setupMinMaxPotential()
   gMaxOutlinePotential = gRadius + gPotentialRange;
   gMinOutlinePotential = gRadius - gPotentialRange;
 
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_BORDERLINE)
   gMaxInlinePotential = gMaxOutlinePotential - borderlineWidth;
   gMinInlinePotential = gMinOutlinePotential - borderlineWidth;
 #else
@@ -109,7 +99,7 @@ void PreprocessPotential()
 }
 #endif
 
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_BORDERLINE)
 lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
 {
   mediump float potential = gPotential;
@@ -173,7 +163,7 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
 }
 #endif
 
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_ROUNDED_CORNER
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_ROUNDED_CORNER)
 mediump float calculateCornerOpacity()
 {
   mediump float potential = gPotential;
@@ -195,7 +185,7 @@ mediump float calculateCornerOpacity()
 }
 #endif
 
-#if IS_REQUIRED_BLUR
+#ifdef IS_REQUIRED_BLUR
 mediump float calculateBlurOpacity()
 {
 // Don't use borderline!
@@ -203,7 +193,7 @@ mediump float calculateBlurOpacity()
   mediump float cy = gRadius + blurRadius;
   mediump float cr = gRadius + blurRadius;
 
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
   // This routine make perfect circle. If corner radius is not exist, we don't consider prefect circle.
   cy = min(cy, min(vRectSize.x, vRectSize.y) - gRadius);
 #endif
@@ -240,7 +230,7 @@ mediump float calculateBlurOpacity()
     // highest point of that circle is (x, x + r) and potential is x + r
 
     // solve (v.x - x)^2 + (v.y - x)^2 = (cr / cy * x)^2
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
     // Note : lowspec HW cannot calculate here. need to reduce numeric error
     highp float A = (cr * cr - 2.0 * cy * cy);
     highp float B = cy * (v.x + v.y);
@@ -268,7 +258,7 @@ void main()
 {
   lowp vec4 targetColor = vec4(mixColor, 1.0) * uColor;
 
-#if IS_REQUIRED_BLUR || IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_BLUR) || defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   // skip most potential calculate for performance
   if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
@@ -279,20 +269,20 @@ void main()
     PreprocessPotential();
 #endif
 
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_BORDERLINE)
     targetColor = convertBorderlineColor(targetColor);
 #endif
     OUT_COLOR = targetColor;
 
-#if IS_REQUIRED_BLUR
+#ifdef IS_REQUIRED_BLUR
     mediump float opacity = calculateBlurOpacity();
     OUT_COLOR.a *= opacity;
-#elif IS_REQUIRED_ROUNDED_CORNER
+#elif defined(IS_REQUIRED_ROUNDED_CORNER)
     mediump float opacity = calculateCornerOpacity();
     OUT_COLOR.a *= opacity;
 #endif
 
-#if IS_REQUIRED_BLUR || IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_BLUR) || defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   }
 #endif
 }
index 2798185..f1688da 100644 (file)
@@ -1,19 +1,9 @@
-#ifndef IS_REQUIRED_ROUNDED_CORNER
-#define IS_REQUIRED_ROUNDED_CORNER 0
-#endif
-#ifndef IS_REQUIRED_BORDERLINE
-#define IS_REQUIRED_BORDERLINE 0
-#endif
-#ifndef IS_REQUIRED_BLUR
-#define IS_REQUIRED_BLUR 0
-#endif
-
 INPUT mediump vec2 aPosition;
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE || IS_REQUIRED_BLUR
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE) || defined(IS_REQUIRED_BLUR)
 OUTPUT mediump vec2 vPosition;
 OUTPUT mediump vec2 vRectSize;
 OUTPUT mediump vec2 vOptRectSize;
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 OUTPUT mediump vec4 vCornerRadius;
 #endif
 #endif
@@ -27,14 +17,14 @@ uniform highp vec2 size;
 uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_BORDERLINE)
 uniform mediump float borderlineWidth;
 uniform mediump float borderlineOffset;
 #endif
-#if IS_REQUIRED_BLUR
+#ifdef IS_REQUIRED_BLUR
 uniform mediump float blurRadius;
 #endif
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 #endif
@@ -42,16 +32,16 @@ uniform mediump vec2 extraSize;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + extraSize;
-  vec2 visualOffset = mix(offset, offset/uSize.xy, offsetSizeMode.xy);
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize;
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE || IS_REQUIRED_BLUR
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE) || defined(IS_REQUIRED_BLUR)
   vRectSize = visualSize * 0.5;
   vOptRectSize = vRectSize;
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER
-#if !IS_REQUIRED_BLUR && IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_ROUNDED_CORNER
+#if !defined(IS_REQUIRED_BLUR) && defined(IS_REQUIRED_BORDERLINE)
   mediump float minSize = min(visualSize.x, visualSize.y) + (1.0 + clamp(borderlineOffset, -1.0, 1.0)) * borderlineWidth;
 #else
   mediump float minSize = min(visualSize.x, visualSize.y);
@@ -63,18 +53,18 @@ vec4 ComputeVertexPosition()
   vOptRectSize -= 0.2929 * maxRadius + 1.0;
 #endif
 
-#if IS_REQUIRED_BLUR
+#ifdef IS_REQUIRED_BLUR
   vPosition = aPosition * (visualSize + 2.0 * blurRadius);
   vOptRectSize -= blurRadius + 1.0;
-#elif IS_REQUIRED_BORDERLINE
+#elif defined(IS_REQUIRED_BORDERLINE)
   vPosition = aPosition * (visualSize + (1.0 + clamp(borderlineOffset, -1.0, 1.0))* borderlineWidth);
   vOptRectSize -= (1.0 - clamp(borderlineOffset, -1.0, 1.0)) * 0.5 * borderlineWidth + 1.0;
-#elif IS_REQUIRED_ROUNDED_CORNER
+#elif defined(IS_REQUIRED_ROUNDED_CORNER)
   vPosition = aPosition * visualSize;
 #else
   mediump vec2 vPosition = aPosition * visualSize;
 #endif
-  return vec4(vPosition + anchorPoint * visualSize + (visualOffset + origin) * uSize.xy, 0.0, 1.0);
+  return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0);
 }
 
 void main()
index a30bf5e..febc776 100644 (file)
@@ -1,19 +1,9 @@
-#ifndef IS_REQUIRED_ROUNDED_CORNER
-#define IS_REQUIRED_ROUNDED_CORNER 0
-#endif
-#ifndef IS_REQUIRED_BORDERLINE
-#define IS_REQUIRED_BORDERLINE 0
-#endif
-#ifndef RADIAL
-#define RADIAL 0
-#endif
-
 INPUT mediump vec2 vTexCoord;
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
 INPUT mediump vec2 vPosition;
 INPUT mediump vec2 vRectSize;
 INPUT mediump vec2 vOptRectSize;
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 INPUT mediump vec4 vCornerRadius;
 #endif
 #endif
@@ -21,14 +11,14 @@ INPUT mediump vec4 vCornerRadius;
 uniform sampler2D sTexture; // sampler1D?
 uniform lowp vec4 uColor;
 uniform lowp vec3 mixColor;
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
 uniform mediump float borderlineWidth;
 uniform mediump float borderlineOffset;
 uniform lowp vec4 borderlineColor;
 uniform lowp vec4 uActorColor;
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
 // Global values both rounded corner and borderline use
 
 // radius of rounded corner on this quadrant
@@ -52,7 +42,7 @@ mediump float gMinInlinePotential = 0.0;
 
 void calculateCornerRadius()
 {
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
   gRadius =
   mix(
     mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
@@ -66,7 +56,7 @@ void calculatePosition()
 {
   gFragmentPosition = abs(vPosition) - vRectSize;
   gCenterPosition = -gRadius;
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
   gCenterPosition += borderlineWidth * (clamp(borderlineOffset, -1.0, 1.0) + 1.0) * 0.5;
 #endif
   gDiff = gFragmentPosition - gCenterPosition;
@@ -84,7 +74,7 @@ void setupMinMaxPotential()
   gMaxOutlinePotential = gRadius + gPotentialRange;
   gMinOutlinePotential = gRadius - gPotentialRange;
 
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
   gMaxInlinePotential = gMaxOutlinePotential - borderlineWidth;
   gMinInlinePotential = gMinOutlinePotential - borderlineWidth;
 #else
@@ -108,7 +98,7 @@ void PreprocessPotential()
 #endif
 
 
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
 lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
 {
   mediump float potential = gPotential;
@@ -172,7 +162,7 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
 }
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 mediump float calculateCornerOpacity()
 {
   mediump float potential = gPotential;
@@ -196,13 +186,13 @@ mediump float calculateCornerOpacity()
 
 void main()
 {
-#if RADIAL
+#ifdef RADIAL
   lowp vec4 textureColor = TEXTURE(sTexture, vec2(length(vTexCoord), 0.5)) * vec4(mixColor, 1.0) * uColor;
 #else
   lowp vec4 textureColor = TEXTURE(sTexture, vec2(vTexCoord.y, 0.5)) * vec4(mixColor, 1.0) * uColor;
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   // skip most potential calculate for performance
   if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
@@ -213,17 +203,17 @@ void main()
     PreprocessPotential();
 #endif
 
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
     textureColor = convertBorderlineColor(textureColor);
 #endif
     OUT_COLOR = textureColor;
 
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
     mediump float opacity = calculateCornerOpacity();
     OUT_COLOR *= opacity;
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   }
 #endif
 }
index edaf643..68179ab 100644 (file)
@@ -1,20 +1,10 @@
-#ifndef IS_REQUIRED_ROUNDED_CORNER
-#define IS_REQUIRED_ROUNDED_CORNER 0
-#endif
-#ifndef IS_REQUIRED_BORDERLINE
-#define IS_REQUIRED_BORDERLINE 0
-#endif
-#ifndef USER_SPACE
-#define USER_SPACE 0
-#endif
-
 INPUT mediump vec2 aPosition;
 OUTPUT mediump vec2 vTexCoord;
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
 OUTPUT mediump vec2 vPosition;
 OUTPUT mediump vec2 vRectSize;
 OUTPUT mediump vec2 vOptRectSize;
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 OUTPUT mediump vec4 vCornerRadius;
 #endif
 #endif
@@ -29,27 +19,27 @@ uniform highp vec2 size;
 uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
 uniform mediump float borderlineWidth;
 uniform mediump float borderlineOffset;
 #endif
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 #endif
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw );
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   vRectSize = visualSize * 0.5;
   vOptRectSize = vRectSize;
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_BORDERLINE
   mediump float minSize = min(visualSize.x, visualSize.y) + (1.0 + clamp(borderlineOffset, -1.0, 1.0)) * borderlineWidth;
 #else
   mediump float minSize = min(visualSize.x, visualSize.y);
@@ -62,23 +52,23 @@ vec4 ComputeVertexPosition()
 #endif
 
   mediump vec4 vertexPosition = vec4(aPosition, 0.0, 1.0);
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
   vPosition = aPosition * (visualSize + (1.0 + clamp(borderlineOffset, -1.0, 1.0)) * borderlineWidth);
   vertexPosition.xy *= (1.0 + (1.0 + clamp(borderlineOffset, -1.0, 1.0)) * borderlineWidth / visualSize);
   vOptRectSize -= (1.0 - clamp(borderlineOffset, -1.0, 1.0)) * 0.5 * borderlineWidth + 1.0;
-#elif IS_REQUIRED_ROUNDED_CORNER
+#elif defined(IS_REQUIRED_ROUNDED_CORNER)
   vPosition = aPosition * visualSize;
 #else
   mediump vec2 vPosition = aPosition * visualSize;
 #endif
 
-#if USER_SPACE
+#ifdef USER_SPACE
   vertexPosition.xyz *= uSize;
 #endif
 
   vTexCoord = (uAlignmentMatrix*vertexPosition.xyw).xy;
 
-  return vec4(vPosition + anchorPoint * visualSize + (visualOffset + origin) * uSize.xy, 0.0, 1.0);
+  return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0);
 }
 
 void main()
index c2324e7..3694280 100644 (file)
@@ -1,39 +1,23 @@
-#ifndef IS_REQUIRED_ROUNDED_CORNER
-#define IS_REQUIRED_ROUNDED_CORNER 0
-#endif
-#ifndef IS_REQUIRED_BORDERLINE
-#define IS_REQUIRED_BORDERLINE 0
-#endif
-#ifndef IS_REQUIRED_ALPHA_MASKING
-#define IS_REQUIRED_ALPHA_MASKING 0
-#endif
-#ifndef ATLAS_DEFAULT_WARP
-#define ATLAS_DEFAULT_WARP 0
-#endif
-#ifndef ATLAS_CUSTOM_WARP
-#define ATLAS_CUSTOM_WARP 0
-#endif
-
 INPUT mediump vec2 vTexCoord;
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
 INPUT mediump vec2 vPosition;
 INPUT mediump vec2 vRectSize;
 INPUT mediump vec2 vOptRectSize;
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 INPUT mediump vec4 vCornerRadius;
 #endif
 #endif
 
 uniform sampler2D sTexture;
 
-#if IS_REQUIRED_ALPHA_MASKING
+#ifdef IS_REQUIRED_ALPHA_MASKING
 uniform sampler2D sMaskTexture;
 INPUT mediump vec2 vMaskTexCoord;
 #endif
 
-#if ATLAS_DEFAULT_WARP
+#ifdef ATLAS_DEFAULT_WARP
 uniform mediump vec4 uAtlasRect;
-#elif ATLAS_CUSTOM_WARP
+#elif defined(ATLAS_CUSTOM_WARP)
 // WrapMode -- 0: CLAMP; 1: REPEAT; 2: REFLECT;
 uniform lowp vec2 wrapMode;
 #endif
@@ -41,14 +25,14 @@ uniform lowp vec2 wrapMode;
 uniform lowp vec4 uColor;
 uniform lowp vec3 mixColor;
 uniform lowp float preMultipliedAlpha;
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
 uniform mediump float borderlineWidth;
 uniform mediump float borderlineOffset;
 uniform lowp vec4 borderlineColor;
 uniform lowp vec4 uActorColor;
 #endif
 
-#if ATLAS_CUSTOM_WARP
+#ifdef ATLAS_CUSTOM_WARP
 mediump float wrapCoordinate( mediump vec2 range, mediump float coordinate, lowp float wrap )
 {
   mediump float coord;
@@ -60,7 +44,7 @@ mediump float wrapCoordinate( mediump vec2 range, mediump float coordinate, lowp
 }
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
 // Global values both rounded corner and borderline use
 
 // radius of rounded corner on this quadrant
@@ -84,7 +68,7 @@ mediump float gMinInlinePotential = 0.0;
 
 void calculateCornerRadius()
 {
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
   gRadius =
   mix(
     mix(vCornerRadius.x, vCornerRadius.y, sign(vPosition.x) * 0.5 + 0.5),
@@ -98,7 +82,7 @@ void calculatePosition()
 {
   gFragmentPosition = abs(vPosition) - vRectSize;
   gCenterPosition = -gRadius;
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
   gCenterPosition += borderlineWidth * (clamp(borderlineOffset, -1.0, 1.0) + 1.0) * 0.5;
 #endif
   gDiff = gFragmentPosition - gCenterPosition;
@@ -116,7 +100,7 @@ void setupMinMaxPotential()
   gMaxOutlinePotential = gRadius + gPotentialRange;
   gMinOutlinePotential = gRadius - gPotentialRange;
 
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
   gMaxInlinePotential = gMaxOutlinePotential - borderlineWidth;
   gMinInlinePotential = gMinOutlinePotential - borderlineWidth;
 #else
@@ -139,7 +123,7 @@ void PreprocessPotential()
 }
 #endif
 
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
 lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
 {
   mediump float potential = gPotential;
@@ -202,7 +186,7 @@ lowp vec4 convertBorderlineColor(lowp vec4 textureColor)
 }
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 mediump float calculateCornerOpacity()
 {
   mediump float potential = gPotential;
@@ -226,9 +210,9 @@ mediump float calculateCornerOpacity()
 
 void main()
 {
-#if ATLAS_DEFAULT_WARP
+#ifdef ATLAS_DEFAULT_WARP
   mediump vec2 texCoord = clamp( mix( uAtlasRect.xy, uAtlasRect.zw, vTexCoord ), uAtlasRect.xy, uAtlasRect.zw );
-#elif ATLAS_CUSTOM_WARP
+#elif defined(ATLAS_CUSTOM_WARP)
   mediump vec2 texCoord = vec2( wrapCoordinate( uAtlasRect.xz, vTexCoord.x, wrapMode.x ),
                                 wrapCoordinate( uAtlasRect.yw, vTexCoord.y, wrapMode.y ) );
 #else
@@ -237,13 +221,13 @@ void main()
 
   lowp vec4 textureColor = TEXTURE( sTexture, texCoord ) * vec4( mixColor, 1.0 ) * uColor;
 
-#if IS_REQUIRED_ALPHA_MASKING
+#ifdef IS_REQUIRED_ALPHA_MASKING
   mediump float maskAlpha = TEXTURE(sMaskTexture, vMaskTexCoord).a;
   textureColor.a *= maskAlpha;
   textureColor.rgb *= mix(1.0, maskAlpha, preMultipliedAlpha);
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   // skip most potential calculate for performance
   if(abs(vPosition.x) < vOptRectSize.x && abs(vPosition.y) < vOptRectSize.y)
   {
@@ -254,18 +238,18 @@ void main()
     PreprocessPotential();
 #endif
 
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
     textureColor = convertBorderlineColor(textureColor);
 #endif
     OUT_COLOR = textureColor;
 
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
     mediump float opacity = calculateCornerOpacity();
     OUT_COLOR.a *= opacity;
     OUT_COLOR.rgb *= mix(1.0, opacity, preMultipliedAlpha);
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   }
 #endif
 }
index d563c78..7443aa1 100644 (file)
@@ -1,20 +1,10 @@
-#ifndef IS_REQUIRED_ROUNDED_CORNER
-#define IS_REQUIRED_ROUNDED_CORNER 0
-#endif
-#ifndef IS_REQUIRED_BORDERLINE
-#define IS_REQUIRED_BORDERLINE 0
-#endif
-#ifndef IS_REQUIRED_ALPHA_MASKING
-#define IS_REQUIRED_ALPHA_MASKING 0
-#endif
-
 INPUT mediump vec2 aPosition;
 OUTPUT mediump vec2 vTexCoord;
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
 OUTPUT mediump vec2 vPosition;
 OUTPUT mediump vec2 vRectSize;
 OUTPUT mediump vec2 vOptRectSize;
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 OUTPUT mediump vec4 vCornerRadius;
 #endif
 #endif
@@ -29,15 +19,15 @@ uniform highp vec2 size;
 uniform mediump vec4 offsetSizeMode;
 uniform mediump vec2 origin;
 uniform mediump vec2 anchorPoint;
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
 uniform mediump float borderlineWidth;
 uniform mediump float borderlineOffset;
 #endif
-#if IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_ROUNDED_CORNER
 uniform mediump vec4 cornerRadius;
 uniform mediump float cornerRadiusPolicy;
 #endif
-#if IS_REQUIRED_ALPHA_MASKING
+#ifdef IS_REQUIRED_ALPHA_MASKING
 OUTPUT  mediump vec2  vMaskTexCoord;
 uniform lowp    float cropToMask;
 uniform mediump vec2  maskTextureRatio;
@@ -46,16 +36,16 @@ uniform mediump vec2 extraSize;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy * size, size, offsetSizeMode.zw) + extraSize;
-  vec2 visualOffset = mix(offset, offset/uSize.xy, offsetSizeMode.xy);
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw) + extraSize;
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
 
-#if IS_REQUIRED_ROUNDED_CORNER || IS_REQUIRED_BORDERLINE
+#if defined(IS_REQUIRED_ROUNDED_CORNER) || defined(IS_REQUIRED_BORDERLINE)
   vRectSize = visualSize * 0.5;
   vOptRectSize = vRectSize;
 #endif
 
-#if IS_REQUIRED_ROUNDED_CORNER
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_ROUNDED_CORNER
+#ifdef IS_REQUIRED_BORDERLINE
   mediump float minSize = min(visualSize.x, visualSize.y) + (1.0 + clamp(borderlineOffset, -1.0, 1.0)) * borderlineWidth;
 #else
   mediump float minSize = min(visualSize.x, visualSize.y);
@@ -67,17 +57,17 @@ vec4 ComputeVertexPosition()
   vOptRectSize -= 0.2929 * maxRadius + 1.0;
 #endif
 
-#if IS_REQUIRED_BORDERLINE
+#ifdef IS_REQUIRED_BORDERLINE
   vPosition = aPosition * (visualSize + (1.0 + clamp(borderlineOffset, -1.0, 1.0)) * borderlineWidth);
   vOptRectSize -= (1.0 - clamp(borderlineOffset, -1.0, 1.0)) * 0.5 * borderlineWidth + 1.0;
-#elif IS_REQUIRED_ROUNDED_CORNER
+#elif defined(IS_REQUIRED_ROUNDED_CORNER)
   vPosition = aPosition * visualSize;
 #else
   mediump vec2 vPosition = aPosition * visualSize;
 #endif
 
   vec4 finalPixelArea = pixelArea;
-#if IS_REQUIRED_ALPHA_MASKING
+#ifdef IS_REQUIRED_ALPHA_MASKING
   finalPixelArea = mix(pixelArea,
                        vec4(
                             vec2(0.5) + (pixelArea.xy - vec2(0.5)) * maskTextureRatio,
@@ -88,7 +78,7 @@ vec4 ComputeVertexPosition()
 #endif
   vTexCoord = finalPixelArea.xy + finalPixelArea.zw * (vPosition.xy / max(vec2(1.0), visualSize) + vec2(0.5));
 
-  return vec4(vPosition + anchorPoint * visualSize + (visualOffset + origin) * uSize.xy, 0.0, 1.0);
+  return vec4(vPosition + anchorPoint * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0);
 }
 
 void main()
index c25a1bb..bc9ac8a 100644 (file)
@@ -24,12 +24,12 @@ uniform mediump vec2 anchorPoint;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw );
   float scaleFactor = min( visualSize.x, visualSize.y );
   vec3 originFlipY =vec3(origin.x, -origin.y, 0.0);
   vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
-  vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
-  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );
+  vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0 - offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
+  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 );
 }
 
 void main()
index 05b90ce..858c92d 100644 (file)
@@ -26,8 +26,8 @@ vec4 ComputeVertexPosition()
   float scaleFactor = min( visualSize.x, visualSize.y );
   vec3 originFlipY =vec3(origin.x, -origin.y, 0.0);
   vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
-  vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
-  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );
+  vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
+  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 );
 }
 
 void main()
index 2a4b704..0541a16 100644 (file)
@@ -23,8 +23,8 @@ vec4 ComputeVertexPosition()
   float scaleFactor = min( visualSize.x, visualSize.y );
   vec3 originFlipY =vec3(origin.x, -origin.y, 0.0);
   vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
-  vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
-  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );
+  vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
+  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 );
 }
 
 void main()
index c7b8a9f..4625b3c 100644 (file)
@@ -16,8 +16,8 @@ uniform mediump vec2 extraSize;
 
 void main()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + extraSize;
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize;
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
 
   mediump vec2 size = visualSize.xy;
 
@@ -31,7 +31,7 @@ void main()
   mediump vec4 gridPosition = vec4( fixedFactor * fixedScaleDownRate + ( size - fixedTotal * fixedScaleDownRate ) * stretch, 0.0, 1.0 );
   mediump vec4 vertexPosition = gridPosition;
   vertexPosition.xy -= size * vec2( 0.5, 0.5 );
-  vertexPosition.xy += anchorPoint*size + (visualOffset + origin)*uSize.xy;
+  vertexPosition.xy += anchorPoint*size + visualOffset + origin * uSize.xy;
 
   vertexPosition = uMvpMatrix * vertexPosition;
 
index 4cd84bc..01f6138 100644 (file)
@@ -22,8 +22,8 @@ void main()
   mediump vec2 fixedTotal = vec2( uNinePatchFactorsX[ FACTOR_SIZE_X - 1 ].x, uNinePatchFactorsY[ FACTOR_SIZE_Y - 1 ].x );
   mediump vec2 stretchTotal = vec2( uNinePatchFactorsX[ FACTOR_SIZE_X - 1 ].y, uNinePatchFactorsY[ FACTOR_SIZE_Y - 1 ].y );
 
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw ) + extraSize;
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw ) + extraSize;
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
 
   // Scale down if fixedTotal is bigger than visualSize
   mediump float fixedScaleDownRate = min(1.0, min(visualSize.x / fixedTotal.x, visualSize.y / fixedTotal.y));
@@ -31,7 +31,7 @@ void main()
   mediump vec4 gridPosition = vec4( fixedFactor * fixedScaleDownRate + ( visualSize.xy - fixedTotal * fixedScaleDownRate ) * stretch / stretchTotal, 0.0, 1.0 );
   mediump vec4 vertexPosition = gridPosition;
   vertexPosition.xy -= visualSize.xy * vec2( 0.5, 0.5 );
-  vertexPosition.xy += anchorPoint*visualSize + (visualOffset + origin)*uSize.xy;
+  vertexPosition.xy += anchorPoint*visualSize + visualOffset + origin * uSize.xy;
   vertexPosition = uMvpMatrix * vertexPosition;
 
   vTexCoord = ( fixedFactor + stretch ) / ( fixedTotal + stretchTotal );
index 6a1b758..1200294 100644 (file)
@@ -27,9 +27,9 @@ vec4 ComputeVertexPosition()
   float scaleFactor = min( visualSize.x / uObjectDimensions.x, visualSize.y / uObjectDimensions.y );
   vec3 originFlipY =vec3(origin.x, -origin.y, 0.0);
   vec3 anchorPointFlipY = vec3( anchorPoint.x, -anchorPoint.y, 0.0);
-  vec3 offset = vec3( ( offset / uSize.xy ) * offsetSizeMode.xy + offset * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
+  vec3 visualOffset = vec3( offset * offsetSizeMode.xy + offset * uSize.xy * (1.0-offsetSizeMode.xy), 0.0) * vec3(1.0,-1.0,1.0);
 
-  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + (offset + originFlipY)*uSize, 1.0 );
+  return vec4( (aPosition + anchorPointFlipY)*scaleFactor + visualOffset + originFlipY * uSize, 1.0 );
 }
 
 void main()
index 6c2cd05..c152b5e 100644 (file)
@@ -1,9 +1,9 @@
 attribute mediump vec2 aPosition;
 varying highp vec2 vTexCoord;
 uniform highp vec3 uSize;
-uniform mediump float uDelta;
+uniform highp float uDelta;
 uniform mediump vec2 uTextureSize;
-uniform mediump float uGap;
+uniform highp float uGap;
 uniform mediump float uHorizontalAlign;
 uniform mediump float uVerticalAlign;
 
@@ -18,13 +18,13 @@ uniform mediump vec2 anchorPoint;
 
 void main()
 {
-  mediump vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy );
-  mediump vec2 visualSize = mix( uSize.xy * size, size, offsetSizeMode.zw );
+  highp vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw);
+  highp vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
 
-  vTexCoord.x = ( uDelta + uHorizontalAlign * ( uTextureSize.x - visualSize.x - uGap ) + floor( aPosition.x * visualSize.x ) + 0.5 - uGap * 0.5 ) / uTextureSize.x + 0.5;
-  vTexCoord.y = ( uVerticalAlign * ( uTextureSize.y - visualSize.y ) + floor( aPosition.y * visualSize.y ) + 0.5 ) / ( uTextureSize.y ) + 0.5;
+  vTexCoord.x = ( uDelta + uHorizontalAlign * ( uTextureSize.x - visualSize.x - uGap ) + aPosition.x * visualSize.x - uGap * 0.5 ) / uTextureSize.x + 0.5;
+  vTexCoord.y = ( uVerticalAlign * ( uTextureSize.y - visualSize.y ) + aPosition.y * visualSize.y ) / ( uTextureSize.y ) + 0.5;
 
-  mediump vec4 vertexPosition = vec4( floor( ( aPosition + anchorPoint ) * visualSize + ( visualOffset + origin ) * uSize.xy ), 0.0, 1.0 );
+  highp vec4 vertexPosition = vec4( ( aPosition + anchorPoint ) * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 );
 
   gl_Position = uMvpMatrix * vertexPosition;
 }
\ No newline at end of file
index 893d075..4cc1212 100644 (file)
@@ -14,9 +14,9 @@ uniform mediump vec2 anchorPoint;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
-  return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw );
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
+  return vec4( (aPosition + anchorPoint) * visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 );
 }
 
 void main()
index 5e0bfb0..9a9975c 100644 (file)
@@ -11,9 +11,9 @@ uniform mediump vec2 anchorPoint;
 
 vec4 ComputeVertexPosition()
 {
-  vec2 visualSize = mix(uSize.xy*size, size, offsetSizeMode.zw );
-  vec2 visualOffset = mix( offset, offset/uSize.xy, offsetSizeMode.xy);
-  return vec4( (aPosition + anchorPoint)*visualSize + (visualOffset + origin)*uSize.xy, 0.0, 1.0 );
+  vec2 visualSize = mix(size * uSize.xy, size, offsetSizeMode.zw );
+  vec2 visualOffset = mix(offset * uSize.xy, offset, offsetSizeMode.xy);
+  return vec4( (aPosition + anchorPoint)*visualSize + visualOffset + origin * uSize.xy, 0.0, 1.0 );
 }
 
 void main()
index 959724b..e6ad82f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -285,44 +285,40 @@ void StyleManager::SetTheme(const std::string& themeFile)
   }
 }
 
-const Property::Map StyleManager::GetConfigurations()
+const Property::Map& StyleManager::GetConfigurations()
 {
   DALI_LOG_STREAM(gLogFilter, Debug::Concise, "GetConfigurations()\n On entry, mThemeBuilder: " << (bool(mThemeBuilder) ? "Created" : "Empty") << "  mThemeFile: " << mThemeFile);
 
-  Property::Map result;
-  if(mThemeBuilder)
-  {
-    result = mThemeBuilder.GetConfigurations();
-  }
-  else
+  if(!mThemeBuilder)
   {
     DALI_LOG_STREAM(gLogFilter, Debug::Concise, "GetConfigurations()  Loading default theme");
 
-    bool themeLoaded = false;
-
     mThemeBuilder = CreateBuilder(mThemeBuilderConstants);
 
     // Load default theme because this is first try to load stylesheet.
-    themeLoaded = LoadJSON(mThemeBuilder, mDefaultThemeFilePath);
-    mThemeFile  = mDefaultThemeFilePath;
-
-    if(themeLoaded)
-    {
-      result = mThemeBuilder.GetConfigurations();
-    }
+#if defined(DEBUG_ENABLED)
+    bool themeLoaded = LoadJSON(mThemeBuilder, mDefaultThemeFilePath);
     DALI_LOG_STREAM(gLogFilter, Debug::Concise, "  themeLoaded" << (themeLoaded ? "success" : "failure"));
+#else
+    LoadJSON(mThemeBuilder, mDefaultThemeFilePath);
+#endif
+
+    mThemeFile = mDefaultThemeFilePath;
   }
 
+#if defined(DEBUG_ENABLED)
+  Property::Map result = mThemeBuilder.GetConfigurations();
   DALI_LOG_STREAM(gLogFilter, Debug::Concise, "GetConfigurations()\n On exit, result Count: " << (result.Count() != 0));
   DALI_LOG_STREAM(gLogFilter, Debug::Verbose, "          result: " << result);
+#endif
 
-  return result;
+  return mThemeBuilder.GetConfigurations();
 }
 
 void StyleManager::SetBrokenImageUrl(DevelStyleManager::BrokenImageType brokenImageType, const std::string& brokenImageUrl)
 {
-  int brokenType = static_cast<int>(brokenImageType);
-  mBrokenImageUrls[brokenType] = brokenImageUrl;
+  int brokenType                     = static_cast<int>(brokenImageType);
+  mBrokenImageUrls[brokenType]       = brokenImageUrl;
   Toolkit::StyleManager styleManager = StyleManager::Get();
   mBrokenImageChangedSignal.Emit(styleManager);
 }
index 56e61f0..3aacf79 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_TOOLKIT_INTERNAL_STYLE_MANAGER_H
 
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -28,9 +28,9 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/builder/builder.h>
+#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
 #include <dali-toolkit/internal/builder/style.h>
 #include <dali-toolkit/public-api/styling/style-manager.h>
-#include <dali-toolkit/devel-api/styling/style-manager-devel.h>
 
 namespace Dali
 {
@@ -93,7 +93,7 @@ public: // Public API
   /**
    * @copydoc Toolkit::StyleManager::GetConfigurations
    */
-  const Property::Map GetConfigurations();
+  const Property::Map& GetConfigurations();
 
   /**
    * @copydoc Toolkit::DevelStyleManager::SetBrokenImageUrl
@@ -255,7 +255,7 @@ private:
 
   Toolkit::Internal::FeedbackStyle* mFeedbackStyle; ///< Feedback style
 
-  std::vector<std::string> mBrokenImageUrls;    ///< Broken Image Urls received from user
+  std::vector<std::string> mBrokenImageUrls; ///< Broken Image Urls received from user
 
   // Signals
   Toolkit::StyleManager::StyleChangedSignalType            mControlStyleChangeSignal; ///< Emitted when the style( theme/font ) changes for the controls to style themselves
index 41e41a9..39af47c 100644 (file)
@@ -1260,16 +1260,22 @@ struct Engine::Impl
                     Length&                           numberOfLines,
                     float                             penY,
                     bool&                             isAutoScrollEnabled,
+                    bool                              isAutoScrollMaxTextureExceeded,
                     DevelText::EllipsisPosition::Type ellipsisPosition,
                     bool                              enforceEllipsisInSingleLine)
   {
-    const bool ellipsis    = enforceEllipsisInSingleLine || (isAutoScrollEnabled ? (penY - layout.descender > layoutParameters.boundingBox.height) : ((penY - layout.descender > layoutParameters.boundingBox.height) || ((mLayout == SINGLE_LINE_BOX) && (layout.length > layoutParameters.boundingBox.width))));
+    const bool ellipsis    = enforceEllipsisInSingleLine || (isAutoScrollEnabled ? isAutoScrollMaxTextureExceeded : ((penY - layout.descender > layoutParameters.boundingBox.height) || ((mLayout == SINGLE_LINE_BOX) && (layout.length > layoutParameters.boundingBox.width))));
     const bool isMultiline = !enforceEllipsisInSingleLine && (mLayout == MULTI_LINE_BOX);
     if(ellipsis && (ellipsisPosition == DevelText::EllipsisPosition::END || !isMultiline))
     {
-      isAutoScrollEnabled = false;
-      // Do not layout more lines if ellipsis is enabled.
+      if(penY - layout.descender > layoutParameters.boundingBox.height)
+      {
+        // Even if auto scroll is enabled and text is bigger than max texture size,
+        // if the the height is small, auto scroll should not work.
+        isAutoScrollEnabled = false;
+      }
 
+      // Do not layout more lines if ellipsis is enabled.
       // The last line needs to be completely filled with characters.
       // Part of a word may be used.
 
@@ -1601,6 +1607,7 @@ struct Engine::Impl
                   Size&                             layoutSize,
                   bool                              elideTextEnabled,
                   bool&                             isAutoScrollEnabled,
+                  bool                              isAutoScrollMaxTextureExceeded,
                   DevelText::EllipsisPosition::Type ellipsisPosition)
   {
     DALI_LOG_INFO(gLogFilter, Debug::Verbose, "-->LayoutText\n");
@@ -1801,7 +1808,7 @@ struct Engine::Impl
       CharacterIndex lastCharacterInParagraph = currentParagraphRun.characterRun.characterIndex + currentParagraphRun.characterRun.numberOfCharacters - 1;
 
       //check if this is the last line in paragraph, if false we should use the default relative line size (the one set using the property)
-      if(lastCharacterInParagraph >= layout.characterIndex && lastCharacterInParagraph < layout.characterIndex+layout.numberOfCharacters)
+      if(lastCharacterInParagraph >= layout.characterIndex && lastCharacterInParagraph < layout.characterIndex + layout.numberOfCharacters)
       {
         layout.relativeLineSize = mRelativeLineSize;
       }
@@ -1840,6 +1847,7 @@ struct Engine::Impl
                                 numberOfLines,
                                 penY,
                                 isAutoScrollEnabled,
+                                isAutoScrollMaxTextureExceeded,
                                 ellipsisPosition,
                                 false);
       }
@@ -1858,6 +1866,7 @@ struct Engine::Impl
                                   numberOfLines,
                                   penY,
                                   isAutoScrollEnabled,
+                                  isAutoScrollMaxTextureExceeded,
                                   ellipsisPosition,
                                   true);
         }
@@ -2252,12 +2261,14 @@ bool Engine::LayoutText(Parameters&                       layoutParameters,
                         Size&                             layoutSize,
                         bool                              elideTextEnabled,
                         bool&                             isAutoScrollEnabled,
+                        bool                              isAutoScrollMaxTextureExceeded,
                         DevelText::EllipsisPosition::Type ellipsisPosition)
 {
   return mImpl->LayoutText(layoutParameters,
                            layoutSize,
                            elideTextEnabled,
                            isAutoScrollEnabled,
+                           isAutoScrollMaxTextureExceeded,
                            ellipsisPosition);
 }
 
index 6b78e87..9fa22c6 100644 (file)
@@ -107,6 +107,7 @@ public:
    * @param[out] layoutSize The size of the text after it has been laid-out.
    * @param[in] elideTextEnabled Whether the text elide is enabled.
    * @param[in,out] isAutoScrollEnabled If the isAutoScrollEnabled is true and the height of the text exceeds the boundaries of the control the text is elided and the isAutoScrollEnabled is set to false to disable the autoscroll
+   * @param[in] isAutoScrollMaxTextureExceeded If isAutoScrollMaxTextureExceeded is true, enable ellipsis during auro scroll.
    * @param[in] ellipsisPosition The location of the text ellipsis
    *
    * @return \e true if the text has been re-laid-out. \e false means the given width is too small to layout even a single character.
@@ -115,6 +116,7 @@ public:
                   Size&                             layoutSize,
                   bool                              elideTextEnabled,
                   bool&                             isAutoScrollEnabled,
+                  bool                              isAutoScrollMaxTextureExceeded,
                   DevelText::EllipsisPosition::Type ellipsisPosition);
 
   /**
index 60eb03b..1047411 100644 (file)
@@ -941,7 +941,7 @@ void ResizeModelVectors(MarkupProcessData& markupProcessData,
   markupProcessData.characterSpacingCharacterRuns.Resize(characterSpacingCharacterRunIndex);
 
 #ifdef DEBUG_ENABLED
-  for(unsigned int i = 0; i < colorRunIndex; ++i)
+  for(uint32_t i = 0; gLogFilter->IsEnabledFor(Debug::Verbose) && i < colorRunIndex; ++i)
   {
     ColorRun& run = markupProcessData.colorRuns[i];
     DALI_LOG_INFO(gLogFilter, Debug::Verbose, "run[%d] index: %d, length: %d, color %f,%f,%f,%f\n", i, run.characterRun.characterIndex, run.characterRun.numberOfCharacters, run.color.r, run.color.g, run.color.b, run.color.a);
index dbd110b..52f2b18 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -500,6 +500,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
                               scriptRunEndIt);
 
 #ifdef DEBUG_ENABLED
+    if(gLogFilter->IsEnabledFor(Debug::Verbose))
     {
       Dali::TextAbstraction::FontDescription description;
       fontClient.GetDescription(fontId, description);
@@ -716,6 +717,7 @@ void MultilanguageSupport::ValidateFonts(const Vector<Character>&
     }
 
 #ifdef DEBUG_ENABLED
+    if(gLogFilter->IsEnabledFor(Debug::Verbose))
     {
       Dali::TextAbstraction::FontDescription description;
       fontClient.GetDescription(fontId, description);
index e30564e..847954f 100644 (file)
@@ -221,7 +221,7 @@ struct AtlasRenderer::Impl
                                 glyphBufferData.width,
                                 glyphBufferData.height,
                                 glyphBufferData.format,
-                                PixelData::DELETE_ARRAY);
+                                PixelData::FREE);
 
         if(bitmap)
         {
@@ -782,7 +782,7 @@ struct AtlasRenderer::Impl
 
     DALI_LOG_INFO(gLogFilter, Debug::Verbose, "%s\n", metrics.mVerboseGlyphCounts.c_str());
 
-    for(uint32_t i = 0; i < metrics.mAtlasMetrics.mAtlasCount; ++i)
+    for(uint32_t i = 0; gLogFilter->IsEnabledFor(Debug::Verbose) && i < metrics.mAtlasMetrics.mAtlasCount; ++i)
     {
       DALI_LOG_INFO(gLogFilter, Debug::Verbose, "   Atlas [%i] %sPixels: %s Size: %ix%i, BlockSize: %ix%i, BlocksUsed: %i/%i\n", i + 1, i > 8 ? "" : " ", metrics.mAtlasMetrics.mAtlasMetrics[i].mPixelFormat == Pixel::L8 ? "L8  " : "BGRA", metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockWidth, metrics.mAtlasMetrics.mAtlasMetrics[i].mSize.mBlockHeight, metrics.mAtlasMetrics.mAtlasMetrics[i].mBlocksUsed, metrics.mAtlasMetrics.mAtlasMetrics[i].mTotalBlocks);
     }
index b1502a9..da397ac 100644 (file)
@@ -96,9 +96,9 @@ void TypesetGlyph(GlyphData&           data,
   const int32_t xOffset = data.horizontalOffset + position->x;
 
   // Whether the given glyph is a color one.
-  const bool     isColorGlyph   = data.glyphBitmap.isColorEmoji || data.glyphBitmap.isColorBitmap;
-  const uint32_t glyphPixelSize = Pixel::GetBytesPerPixel(data.glyphBitmap.format);
-  const uint32_t alphaIndex     = glyphPixelSize - 1u;
+  const bool     isColorGlyph    = data.glyphBitmap.isColorEmoji || data.glyphBitmap.isColorBitmap;
+  const uint32_t glyphPixelSize  = Pixel::GetBytesPerPixel(data.glyphBitmap.format);
+  const uint32_t glyphAlphaIndex = glyphPixelSize - 1u;
 
   // Determinate iterator range.
   const int32_t lineIndexRangeMin = std::max(0, -yOffset);
@@ -114,9 +114,9 @@ void TypesetGlyph(GlyphData&           data,
 
   if(Pixel::RGBA8888 == pixelFormat)
   {
-    const bool swapChannelsBR = Pixel::BGRA8888 == data.glyphBitmap.format;
-
     uint32_t* bitmapBuffer = reinterpret_cast<uint32_t*>(data.bitmapBuffer.GetBuffer());
+    // Skip basic line.
+    bitmapBuffer += (lineIndexRangeMin + yOffset) * static_cast<int32_t>(data.width);
 
     // Fast-cut if style is MASK or OUTLINE. Outline not shown for color glyph.
     // Just overwrite transparent color and return.
@@ -124,17 +124,17 @@ void TypesetGlyph(GlyphData&           data,
     {
       for(int32_t lineIndex = lineIndexRangeMin; lineIndex < lineIndexRangeMax; ++lineIndex)
       {
-        const int32_t yOffsetIndex   = yOffset + lineIndex;
-        const int32_t verticalOffset = yOffsetIndex * data.width;
-
         // We can use memset here.
-        memset(bitmapBuffer + verticalOffset + xOffset + indexRangeMin, 0, (indexRangeMax - indexRangeMin) * sizeof(uint32_t));
+        memset(bitmapBuffer + xOffset + indexRangeMin, 0, (indexRangeMax - indexRangeMin) * sizeof(uint32_t));
+        bitmapBuffer += data.width;
       }
       return;
     }
 
+    const bool swapChannelsBR = Pixel::BGRA8888 == data.glyphBitmap.format;
+
     // Pointer to the color glyph if there is one.
-    const uint32_t* const colorGlyphBuffer = isColorGlyph ? reinterpret_cast<uint32_t*>(data.glyphBitmap.buffer) : NULL;
+    const uint8_t* glyphBuffer = data.glyphBitmap.buffer;
 
     // Precalculate input color's packed result.
     uint32_t packedInputColor       = 0u;
@@ -145,21 +145,20 @@ void TypesetGlyph(GlyphData&           data,
     *(packedInputColorBuffer + 1u) = static_cast<uint8_t>(color->g * 255);
     *(packedInputColorBuffer)      = static_cast<uint8_t>(color->r * 255);
 
+    // Skip basic line of glyph.
+    glyphBuffer += (lineIndexRangeMin) * static_cast<int32_t>(data.glyphBitmap.width) * glyphPixelSize;
+
     // Traverse the pixels of the glyph line per line.
-    for(int32_t lineIndex = lineIndexRangeMin; lineIndex < lineIndexRangeMax; ++lineIndex)
+    if(isColorGlyph)
     {
-      const int32_t yOffsetIndex = yOffset + lineIndex;
-
-      const int32_t verticalOffset    = yOffsetIndex * data.width;
-      const int32_t glyphBufferOffset = lineIndex * static_cast<int32_t>(data.glyphBitmap.width);
-      for(int32_t index = indexRangeMin; index < indexRangeMax; ++index)
+      for(int32_t lineIndex = lineIndexRangeMin; lineIndex < lineIndexRangeMax; ++lineIndex)
       {
-        const int32_t xOffsetIndex = xOffset + index;
-
-        if(isColorGlyph)
+        for(int32_t index = indexRangeMin; index < indexRangeMax; ++index)
         {
+          const int32_t xOffsetIndex = xOffset + index;
+
           // Retrieves the color from the color glyph.
-          uint32_t packedColorGlyph       = *(colorGlyphBuffer + glyphBufferOffset + index);
+          uint32_t packedColorGlyph       = *(reinterpret_cast<const uint32_t*>(glyphBuffer + (index << 2)));
           uint8_t* packedColorGlyphBuffer = reinterpret_cast<uint8_t*>(&packedColorGlyph);
 
           // Update the alpha channel.
@@ -193,23 +192,28 @@ void TypesetGlyph(GlyphData&           data,
           }
 
           // Set the color into the final pixel buffer.
-          *(bitmapBuffer + verticalOffset + xOffsetIndex) = packedColorGlyph;
+          *(bitmapBuffer + xOffsetIndex) = packedColorGlyph;
         }
-        else
+        bitmapBuffer += data.width;
+        glyphBuffer += data.glyphBitmap.width * glyphPixelSize;
+      }
+    }
+    else
+    {
+      for(int32_t lineIndex = lineIndexRangeMin; lineIndex < lineIndexRangeMax; ++lineIndex)
+      {
+        for(int32_t index = indexRangeMin; index < indexRangeMax; ++index)
         {
-          // Pack the given color into a 32bit buffer. The alpha channel will be updated later for each pixel.
-          // The format is RGBA8888.
-          uint32_t packedColor       = 0u;
-          uint8_t* packedColorBuffer = reinterpret_cast<uint8_t*>(&packedColor);
-
           // Update the alpha channel.
-          const uint8_t alpha = *(data.glyphBitmap.buffer + glyphPixelSize * (glyphBufferOffset + index) + alphaIndex);
+          const uint8_t alpha = *(glyphBuffer + index * glyphPixelSize + glyphAlphaIndex);
 
           // Copy non-transparent pixels only
           if(alpha > 0u)
           {
+            const int32_t xOffsetIndex = xOffset + index;
+
             // Check alpha of overlapped pixels
-            uint32_t& currentColor             = *(bitmapBuffer + verticalOffset + xOffsetIndex);
+            uint32_t& currentColor             = *(bitmapBuffer + xOffsetIndex);
             uint8_t*  packedCurrentColorBuffer = reinterpret_cast<uint8_t*>(&currentColor);
 
             // For any pixel overlapped with the pixel in previous glyphs, make sure we don't
@@ -225,6 +229,11 @@ void TypesetGlyph(GlyphData&           data,
             }
             else
             {
+              // Pack the given color into a 32bit buffer. The alpha channel will be updated later for each pixel.
+              // The format is RGBA8888.
+              uint32_t packedColor       = 0u;
+              uint8_t* packedColorBuffer = reinterpret_cast<uint8_t*>(&packedColor);
+
               // Color is pre-muliplied with its alpha.
               *(packedColorBuffer + 3u) = MultiplyAndNormalizeColor(*(packedInputColorBuffer + 3u), currentAlpha);
               *(packedColorBuffer + 2u) = MultiplyAndNormalizeColor(*(packedInputColorBuffer + 2u), currentAlpha);
@@ -236,35 +245,38 @@ void TypesetGlyph(GlyphData&           data,
             }
           }
         }
+        bitmapBuffer += data.width;
+        glyphBuffer += data.glyphBitmap.width * glyphPixelSize;
       }
     }
   }
-  else
+  else // Pixel::L8
   {
     // Below codes required only if not color glyph.
     if(!isColorGlyph)
     {
-      uint8_t* bitmapBuffer = reinterpret_cast<uint8_t*>(data.bitmapBuffer.GetBuffer());
+      uint8_t*       bitmapBuffer = data.bitmapBuffer.GetBuffer();
+      const uint8_t* glyphBuffer  = data.glyphBitmap.buffer;
+
+      // Skip basic line.
+      bitmapBuffer += (lineIndexRangeMin + yOffset) * static_cast<int32_t>(data.width);
+      glyphBuffer += (lineIndexRangeMin) * static_cast<int32_t>(data.glyphBitmap.width) * glyphPixelSize;
 
       // Traverse the pixels of the glyph line per line.
       for(int32_t lineIndex = lineIndexRangeMin; lineIndex < lineIndexRangeMax; ++lineIndex)
       {
-        const int32_t yOffsetIndex = yOffset + lineIndex;
-
-        const int32_t verticalOffset    = yOffsetIndex * data.width;
-        const int32_t glyphBufferOffset = lineIndex * static_cast<int32_t>(data.glyphBitmap.width);
         for(int32_t index = indexRangeMin; index < indexRangeMax; ++index)
         {
           const int32_t xOffsetIndex = xOffset + index;
 
           // Update the alpha channel.
-          const uint8_t alpha = *(data.glyphBitmap.buffer + glyphPixelSize * (glyphBufferOffset + index) + alphaIndex);
+          const uint8_t alpha = *(glyphBuffer + index * glyphPixelSize + glyphAlphaIndex);
 
           // Copy non-transparent pixels only
           if(alpha > 0u)
           {
             // Check alpha of overlapped pixels
-            uint8_t& currentAlpha = *(bitmapBuffer + verticalOffset + xOffsetIndex);
+            uint8_t& currentAlpha = *(bitmapBuffer + xOffsetIndex);
 
             // For any pixel overlapped with the pixel in previous glyphs, make sure we don't
             // overwrite a previous bigger alpha with a smaller alpha (in order to avoid
@@ -273,6 +285,9 @@ void TypesetGlyph(GlyphData&           data,
             currentAlpha = std::max(currentAlpha, alpha);
           }
         }
+
+        bitmapBuffer += data.width;
+        glyphBuffer += data.glyphBitmap.width * glyphPixelSize;
       }
     }
   }
@@ -1292,8 +1307,8 @@ Devel::PixelBuffer Typesetter::CreateImageBuffer(const uint32_t& bufferWidth, co
           glyphData.verticalOffset += glyphData.glyphBitmap.outlineOffsetY;
         }
 
-        // delete the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer
-        delete[] glyphData.glyphBitmap.buffer;
+        // free the glyphBitmap.buffer as it is now copied into glyphData.bitmapBuffer
+        free(glyphData.glyphBitmap.buffer);
         glyphData.glyphBitmap.buffer = NULL;
       }
 
index f02bb95..9cfba93 100644 (file)
@@ -524,7 +524,71 @@ void ViewModel::ElideGlyphs()
                 // Change the 'x' and 'y' position of the ellipsis glyph.
                 if(position.x > firstPenX)
                 {
-                  position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+                  if(isTailMode)
+                  {
+                    // To handle case of the mixed languages (LTR then RTL) with
+                    // EllipsisPosition::END and the LayoutDirection::RIGHT_TO_LEFT
+                    float nextXPositions = ellipsisLine->width;
+                    if(indexOfEllipsis + 1u < numberOfGlyphs)
+                    {
+                      Vector2& positionOfNextGlyph = *(elidedPositionsBuffer + indexOfEllipsis + 1u);
+                      nextXPositions               = positionOfNextGlyph.x;
+                    }
+
+                    if(position.x > nextXPositions) // RTL language
+                    {
+                      if((indexOfEllipsis > 0u) && ((position.x - nextXPositions) > removedGlypsWidth))
+                      {
+                        // To handle mixed directions
+                        // Re-calculates the first penX which will be used if rtl text is elided.
+                        firstPenX = position.x - glyphToRemove.xBearing;
+                        if(firstPenX < -ellipsisGlyph.xBearing)
+                        {
+                          // Avoids to exceed the bounding box when rtl text is elided.
+                          firstPenX = -ellipsisGlyph.xBearing;
+                        }
+                        //Reset the width of removed glyphs
+                        removedGlypsWidth = std::min(calculatedAdvance, (glyphToRemove.xBearing + glyphToRemove.width)) - ellipsisGlyph.xBearing;
+
+                        --indexOfEllipsis;
+                        continue;
+                      }
+                      else
+                      {
+                        // To handle the case of RTL language with EllipsisPosition::END
+                        position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+                      }
+                    }
+                  }
+                  else
+                  {
+                    // To handle the case of LTR language with EllipsisPosition::START
+                    position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+                  }
+                }
+                else
+                {
+                  if(!isTailMode)
+                  {
+                    // To handle case of the mixed languages (RTL then LTR) with
+                    // EllipsisPosition::START and the LayoutDirection::RIGHT_TO_LEFT
+                    float nextXPositions = ellipsisLine->width;
+                    if(indexOfEllipsis + 1u < numberOfGlyphs)
+                    {
+                      Vector2& positionOfNextGlyph = *(elidedPositionsBuffer + indexOfEllipsis + 1u);
+                      nextXPositions               = positionOfNextGlyph.x;
+                    }
+
+                    if(position.x < nextXPositions) // LTR language
+                    {
+                      position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+
+                      if((position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) > nextXPositions)
+                      {
+                        position.x -= (position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) - nextXPositions;
+                      }
+                    }
+                  }
                 }
 
                 position.x += ellipsisGlyph.xBearing;
index 5944039..7eaf5ee 100644 (file)
@@ -37,10 +37,10 @@ namespace Toolkit
 {
 namespace Text
 {
-const float DEFAULT_TEXTFIT_MIN     = 10.f;
-const float DEFAULT_TEXTFIT_MAX     = 100.f;
-const float DEFAULT_TEXTFIT_STEP    = 1.f;
-const float DEFAULT_FONT_SIZE_SCALE = 1.f;
+const float DEFAULT_TEXTFIT_MIN            = 10.f;
+const float DEFAULT_TEXTFIT_MAX            = 100.f;
+const float DEFAULT_TEXTFIT_STEP           = 1.f;
+const float DEFAULT_FONT_SIZE_SCALE        = 1.f;
 const float DEFAULT_DISABLED_COLOR_OPACITY = 0.3f;
 
 //Forward declarations
@@ -346,6 +346,7 @@ struct Controller::Impl
     mMarkupProcessorEnabled(false),
     mClipboardHideEnabled(true),
     mIsAutoScrollEnabled(false),
+    mIsAutoScrollMaxTextureExceeded(false),
     mUpdateTextDirection(true),
     mIsTextDirectionRTL(false),
     mUnderlineSetByString(false),
@@ -385,12 +386,11 @@ struct Controller::Impl
     Toolkit::StyleManager styleManager = Toolkit::StyleManager::Get();
     if(styleManager)
     {
-      bool          temp;
-      Property::Map config = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
-      if(config["clearFocusOnEscape"].Get(temp))
-      {
-        mShouldClearFocusOnEscape = temp;
-      }
+      const Property::Map& config                  = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
+      const auto           clearFocusOnEscapeValue = config.Find("clearFocusOnEscape", Property::Type::BOOLEAN);
+
+      // Default is true. If config don't have "clearFocusOnEscape" property, make it true.
+      mShouldClearFocusOnEscape = (!clearFocusOnEscapeValue || clearFocusOnEscapeValue->Get<bool>());
     }
   }
 
@@ -1001,12 +1001,13 @@ public:
   std::unique_ptr<InputFilter> mInputFilter;                ///< Avoid allocating this when the user does not specify input filter mode.
   Vector2                      mTextFitContentSize;         ///< Size of Text fit content
 
-  bool               mRecalculateNaturalSize : 1; ///< Whether the natural size needs to be recalculated.
-  bool               mMarkupProcessorEnabled : 1; ///< Whether the mark-up procesor is enabled.
-  bool               mClipboardHideEnabled : 1;   ///< Whether the ClipboardHide function work or not
-  bool               mIsAutoScrollEnabled : 1;    ///< Whether auto text scrolling is enabled.
-  bool               mUpdateTextDirection : 1;    ///< Whether the text direction needs to be updated.
-  CharacterDirection mIsTextDirectionRTL : 1;     ///< Whether the text direction is right to left or not
+  bool               mRecalculateNaturalSize : 1;         ///< Whether the natural size needs to be recalculated.
+  bool               mMarkupProcessorEnabled : 1;         ///< Whether the mark-up procesor is enabled.
+  bool               mClipboardHideEnabled : 1;           ///< Whether the ClipboardHide function work or not
+  bool               mIsAutoScrollEnabled : 1;            ///< Whether auto text scrolling is enabled.
+  bool               mIsAutoScrollMaxTextureExceeded : 1; ///< Whether auto text scrolling is exceed max texture size.
+  bool               mUpdateTextDirection : 1;            ///< Whether the text direction needs to be updated.
+  CharacterDirection mIsTextDirectionRTL : 1;             ///< Whether the text direction is right to left or not
 
   bool                  mUnderlineSetByString : 1;     ///< Set when underline is set by string (legacy) instead of map
   bool                  mShadowSetByString : 1;        ///< Set when shadow is set by string (legacy) instead of map
index 42199ad..b9b4f56 100644 (file)
@@ -67,7 +67,7 @@ Size Controller::Relayouter::CalculateLayoutSizeOnRequiredControllerSize(Control
                                                                         SHAPE_TEXT |
                                                                         GET_GLYPH_METRICS);
 
-  const OperationsMask sizeOperations     = static_cast<OperationsMask>(LAYOUT | ALIGN | REORDER);
+  const OperationsMask sizeOperations = static_cast<OperationsMask>(LAYOUT | ALIGN | REORDER);
 
   // Set the update info to relayout the whole text.
   TextUpdateInfo& textUpdateInfo = impl.mTextUpdateInfo;
@@ -93,6 +93,12 @@ Size Controller::Relayouter::CalculateLayoutSizeOnRequiredControllerSize(Control
   {
     impl.UpdateModel(onlyOnceOperations);
 
+    if(impl.mIsAutoScrollEnabled)
+    {
+      // Layout the text for the new width.
+      operationsPending = static_cast<OperationsMask>(operationsPending | requestedOperationsMask);
+    }
+
     DoRelayout(impl,
                requestedControllerSize,
                static_cast<OperationsMask>(onlyOnceOperations | requestedOperationsMask),
@@ -619,12 +625,15 @@ bool Controller::Relayouter::DoRelayout(Controller::Impl& impl, const Size& size
     }
 
     // Update the visual model.
-    bool isAutoScrollEnabled = impl.mIsAutoScrollEnabled;
+    bool isAutoScrollEnabled            = impl.mIsAutoScrollEnabled;
+    bool isAutoScrollMaxTextureExceeded = impl.mIsAutoScrollMaxTextureExceeded;
+
     Size newLayoutSize;
     viewUpdated               = impl.mLayoutEngine.LayoutText(layoutParameters,
                                                 newLayoutSize,
                                                 elideTextEnabled,
                                                 isAutoScrollEnabled,
+                                                isAutoScrollMaxTextureExceeded,
                                                 ellipsisPosition);
     impl.mIsAutoScrollEnabled = isAutoScrollEnabled;
 
@@ -798,13 +807,13 @@ void Controller::Relayouter::DoRelayoutHorizontalAlignment(Controller::Impl&
 
 void Controller::Relayouter::CalculateVerticalOffset(Controller::Impl& impl, const Size& controlSize)
 {
-  ModelPtr&         model                 = impl.mModel;
-  VisualModelPtr&   visualModel           = model->mVisualModel;
-  Size              layoutSize            = model->mVisualModel->GetLayoutSize();
-  Size              oldLayoutSize         = layoutSize;
-  float             offsetY               = 0.f;
-  bool              needRecalc            = false;
-  float             defaultFontLineHeight = impl.GetDefaultFontLineHeight();
+  ModelPtr&       model                 = impl.mModel;
+  VisualModelPtr& visualModel           = model->mVisualModel;
+  Size            layoutSize            = model->mVisualModel->GetLayoutSize();
+  Size            oldLayoutSize         = layoutSize;
+  float           offsetY               = 0.f;
+  bool            needRecalc            = false;
+  float           defaultFontLineHeight = impl.GetDefaultFontLineHeight();
 
   if(fabsf(layoutSize.height) < Math::MACHINE_EPSILON_1000)
   {
index bf92f6a..7cc8831 100644 (file)
@@ -172,6 +172,11 @@ void Controller::SetAutoScrollEnabled(bool enable)
   mImpl->SetAutoScrollEnabled(enable);
 }
 
+void Controller::SetAutoScrollMaxTextureExceeded(bool exceed)
+{
+  mImpl->mIsAutoScrollMaxTextureExceeded = exceed;
+}
+
 bool Controller::IsAutoScrollEnabled() const
 {
   DALI_LOG_INFO(gLogFilter, Debug::Verbose, "Controller::IsAutoScrollEnabled[%s]\n", mImpl->mIsAutoScrollEnabled ? "true" : "false");
index 3e987dd..0def96f 100644 (file)
@@ -257,6 +257,15 @@ public: // Configure the text controller.
   void SetAutoScrollEnabled(bool enable);
 
   /**
+   * @brief Whether the auto scrolling texture exceed max texture.
+   *
+   * By default is false.
+   *
+   * @param[in] exceed Whether the auto scrolling texture exceed max texture.
+   */
+  void SetAutoScrollMaxTextureExceeded(bool exceed);
+
+  /**
    * @brief Retrieves whether auto text scrolling is enabled.
    *
    * By default is disabled.
index 9c067de..0be5ac6 100644 (file)
@@ -376,10 +376,73 @@ Length View::GetGlyphs(GlyphInfo* glyphs,
                 glyphInfo = ellipsisGlyph;
 
                 // Change the 'x' and 'y' position of the ellipsis glyph.
-
                 if(position.x > firstPenX)
                 {
-                  position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+                  if(isTailMode)
+                  {
+                    // To handle case of the mixed languages (LTR then RTL) with
+                    // EllipsisPosition::END and the LayoutDirection::RIGHT_TO_LEFT
+                    float nextXPositions = ellipsisLine->width;
+                    if(indexOfEllipsis + 1u < numberOfGlyphs)
+                    {
+                      Vector2& positionOfNextGlyph = *(glyphPositions + indexOfEllipsis + 1u);
+                      nextXPositions               = positionOfNextGlyph.x;
+                    }
+
+                    if(position.x > nextXPositions) // RTL language
+                    {
+                      if((indexOfEllipsis > 0u) && ((position.x - nextXPositions) > removedGlypsWidth))
+                      {
+                        // To handle mixed directions
+                        // Re-calculates the first penX which will be used if rtl text is elided.
+                        firstPenX = position.x - glyphToRemove.xBearing;
+                        if(firstPenX < -ellipsisGlyph.xBearing)
+                        {
+                          // Avoids to exceed the bounding box when rtl text is elided.
+                          firstPenX = -ellipsisGlyph.xBearing;
+                        }
+                        //Reset the width of removed glyphs
+                        removedGlypsWidth = std::min(calculatedAdvance, (glyphToRemove.xBearing + glyphToRemove.width)) - ellipsisGlyph.xBearing;
+
+                        --indexOfEllipsis;
+                        continue;
+                      }
+                      else
+                      {
+                        // To handle the case of RTL language with EllipsisPosition::END
+                        position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+                      }
+                    }
+                  }
+                  else
+                  {
+                    // To handle the case of LTR language with EllipsisPosition::START
+                    position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+                  }
+                }
+                else
+                {
+                  if(!isTailMode)
+                  {
+                    // To handle case of the mixed languages (RTL then LTR) with
+                    // EllipsisPosition::START and the LayoutDirection::RIGHT_TO_LEFT
+                    float nextXPositions = ellipsisLine->width;
+                    if(indexOfEllipsis + 1u < numberOfGlyphs)
+                    {
+                      Vector2& positionOfNextGlyph = *(glyphPositions + indexOfEllipsis + 1u);
+                      nextXPositions               = positionOfNextGlyph.x;
+                    }
+
+                    if(position.x < nextXPositions) // LTR language
+                    {
+                      position.x = firstPenX + removedGlypsWidth - ellipsisGlyphWidth;
+
+                      if((position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) > nextXPositions)
+                      {
+                        position.x -= (position.x + ellipsisGlyphWidth + ellipsisGlyph.xBearing) - nextXPositions;
+                      }
+                    }
+                  }
                 }
 
                 position.x += ellipsisGlyph.xBearing;
index a334e2f..382d52b 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/adaptor-framework/image-loading.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
 #include <memory>
 
 // INTERNAL INCLUDES
@@ -46,7 +47,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(10); // ltr, wrap, pixel area, crop to mask, mask texture ratio + border/corner
+const int CUSTOM_PROPERTY_COUNT(5); // ltr, wrap, pixel area, crop to mask, mask texture ratio
 
 // stop behavior
 DALI_ENUM_TO_STRING_TABLE_BEGIN(STOP_BEHAVIOR)
@@ -177,7 +178,7 @@ void AnimatedImageVisual::CreateImageCache()
 
   if(mAnimatedImageLoading)
   {
-    mImageCache = new RollingAnimatedImageCache(textureManager, mAnimatedImageLoading, mMaskingData, *this, mCacheSize, mBatchSize, IsSynchronousLoadingRequired(),mFactoryCache.GetPreMultiplyOnLoad());
+    mImageCache = new RollingAnimatedImageCache(textureManager, mAnimatedImageLoading, mMaskingData, *this, mCacheSize, mBatchSize, IsSynchronousLoadingRequired(), mFactoryCache.GetPreMultiplyOnLoad());
   }
   else if(mImageUrls)
   {
@@ -730,7 +731,7 @@ void AnimatedImageVisual::OnInitialize()
 
   Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
 
-  mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+  mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
   mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
 
   // Register transform properties
@@ -979,8 +980,8 @@ void AnimatedImageVisual::CheckMaskTexture()
 {
   if(mMaskingData && !mMaskingData->mPreappliedMasking)
   {
-    bool maskLoadFailed = true;
-    TextureSet textures = mImpl->mRenderer.GetTextures();
+    bool       maskLoadFailed = true;
+    TextureSet textures       = mImpl->mRenderer.GetTextures();
     if(textures && textures.GetTextureCount() >= TEXTURE_COUNT_FOR_GPU_ALPHA_MASK)
     {
       maskLoadFailed = false;
index c430320..74ec088 100644 (file)
@@ -28,6 +28,7 @@ namespace
 Debug::Filter* gAnimImgLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ANIMATED_IMAGE");
 
 #define LOG_CACHE                                                                                                       \
+  if(gAnimImgLogFilter->IsEnabledFor(Debug::Concise))                                                                   \
   {                                                                                                                     \
     std::ostringstream oss;                                                                                             \
     oss << "Size:" << mQueue.Count() << " [ ";                                                                          \
@@ -194,7 +195,7 @@ TextureSet RollingAnimatedImageCache::RequestFrameLoading(uint32_t frameIndex, b
   mLoadState = TextureManager::LoadState::LOADING;
 
   auto preMultiplyOnLoading = mPreMultiplyOnLoad ? TextureManager::MultiplyOnLoad::MULTIPLY_ON_LOAD
-                                                  : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
+                                                 : TextureManager::MultiplyOnLoad::LOAD_WITHOUT_MULTIPLY;
 
   TextureManager::TextureId loadTextureId = TextureManager::INVALID_TEXTURE_ID;
   TextureSet                textureSet    = mTextureManager.LoadAnimatedImageTexture(mImageUrl,
index f78d74a..7a84f5b 100644 (file)
@@ -29,6 +29,7 @@ namespace
 Debug::Filter* gAnimImgLogFilter = Debug::Filter::New(Debug::NoLogging, false, "LOG_ANIMATED_IMAGE");
 
 #define LOG_CACHE                                                                                                                                                        \
+  if(gAnimImgLogFilter->IsEnabledFor(Debug::Concise))                                                                                                                    \
   {                                                                                                                                                                      \
     std::ostringstream oss;                                                                                                                                              \
     oss << "Size:" << mQueue.Count() << " [ ";                                                                                                                           \
index f4e3059..1017ae0 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/devel-api/common/stage.h>
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
@@ -44,7 +45,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(6); // 5 transform properties + pixel area,
+const int CUSTOM_PROPERTY_COUNT(1); // pixel area,
 
 const Dali::Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
 
@@ -299,7 +300,7 @@ void AnimatedVectorImageVisual::OnInitialize(void)
 
   Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
 
-  mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+  mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
   mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
 
   TextureSet textureSet = TextureSet::New();
index 8dfc168..09fd60e 100644 (file)
@@ -21,6 +21,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
 
 //INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/visuals/color-visual-properties-devel.h>
@@ -41,7 +42,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(6); // Blur Radius + border/corner
+const int CUSTOM_PROPERTY_COUNT(0);
 
 VisualFactoryCache::ShaderType SHADER_TYPE_TABLE[6] =
   {
@@ -73,7 +74,6 @@ ColorVisualPtr ColorVisual::New(VisualFactoryCache& factoryCache, const Property
 ColorVisual::ColorVisual(VisualFactoryCache& factoryCache)
 : Visual::Base(factoryCache, Visual::FittingMode::FILL, Toolkit::Visual::COLOR),
   mBlurRadius(0.0f),
-  mBlurRadiusIndex(Property::INVALID_INDEX),
   mAlwaysUsingBlurRadius(false)
 {
 }
@@ -117,25 +117,26 @@ void ColorVisual::DoSetProperties(const Property::Map& propertyMap)
       DALI_LOG_ERROR("ColorVisual:DoSetProperties:: BLUR_RADIUS property has incorrect type: %d\n", blurRadiusValue->GetType());
     }
 
-    if(mBlurRadiusIndex != Property::INVALID_INDEX)
-    {
-      mImpl->mRenderer.SetProperty(mBlurRadiusIndex, mBlurRadius);
-    }
-    else if(DALI_UNLIKELY(mImpl->mRenderer && (!EqualsZero(mBlurRadius) || mAlwaysUsingBlurRadius)))
+    if(DALI_UNLIKELY(mImpl->mRenderer))
     {
       // Unusual case. SetProperty called after OnInitialize().
       // Assume that DoAction call UPDATE_PROPERTY.
-      // We must regist properies into renderer, and update shader.
-
-      // BlurRadius added by this action. Regist property to renderer.
-      mBlurRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
-      mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+      DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBlurRadiusUniform();
+      mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BLUR_RADIUS, mBlurRadius);
 
-      // Change the shader must not be occured many times. we always have to use blur feature.
-      mAlwaysUsingBlurRadius = true;
-
-      // Change shader
-      UpdateShader();
+      // Check whether we must update shader.
+      if(!mAlwaysUsingBlurRadius && IsBlurRequired())
+      {
+        // Change the shader must not be occured many times. we always have to use blur feature.
+        mAlwaysUsingBlurRadius = true;
+
+        mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+        // Change shader
+        if(!mImpl->mCustomShader)
+        {
+          UpdateShader();
+        }
+      }
     }
   }
 }
@@ -159,10 +160,10 @@ void ColorVisual::DoCreatePropertyMap(Property::Map& map) const
   map.Insert(Toolkit::Visual::Property::TYPE, Toolkit::Visual::COLOR);
   map.Insert(Toolkit::ColorVisual::Property::MIX_COLOR, mImpl->mMixColor);
 
-  if(mImpl->mRenderer && mBlurRadiusIndex != Property::INVALID_INDEX)
+  if(mImpl->mRenderer)
   {
     // Update values from Renderer
-    float blurRadius = mImpl->mRenderer.GetProperty<float>(mBlurRadiusIndex);
+    float blurRadius = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BLUR_RADIUS);
     map.Insert(Toolkit::DevelColorVisual::Property::BLUR_RADIUS, blurRadius);
   }
   else
@@ -208,14 +209,15 @@ void ColorVisual::OnInitialize()
 
   Shader shader = GenerateShader();
 
-  mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+  mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
   mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
 
   mImpl->mRenderer.SetProperty(VisualRenderer::Property::VISUAL_MIX_COLOR, Vector3(mImpl->mMixColor));
 
-  if(!EqualsZero(mBlurRadius))
+  if(mAlwaysUsingBlurRadius || !EqualsZero(mBlurRadius))
   {
-    mBlurRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
+    DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBlurRadiusUniform();
+    mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BLUR_RADIUS, mBlurRadius);
     mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
   }
 
@@ -230,7 +232,7 @@ Shader ColorVisual::GenerateShader() const
 
   bool roundedCorner  = IsRoundedCornerRequired();
   bool borderline     = IsBorderlineRequired();
-  bool blur           = !EqualsZero(mBlurRadius) || mAlwaysUsingBlurRadius;
+  bool blur           = IsBlurRequired();
   int  shaderTypeFlag = ColorVisualRequireFlag::DEFAULT;
 
   if(roundedCorner)
@@ -256,18 +258,18 @@ Shader ColorVisual::GenerateShader() const
     std::string fragmentShaderPrefixList;
     if(roundedCorner)
     {
-      vertexShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER 1\n";
-      fragmentShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER 1\n";
+      vertexShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER\n";
+      fragmentShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER\n";
     }
     if(blur)
     {
-      vertexShaderPrefixList += "#define IS_REQUIRED_BLUR 1\n";
-      fragmentShaderPrefixList += "#define IS_REQUIRED_BLUR 1\n";
+      vertexShaderPrefixList += "#define IS_REQUIRED_BLUR\n";
+      fragmentShaderPrefixList += "#define IS_REQUIRED_BLUR\n";
     }
     if(borderline)
     {
-      vertexShaderPrefixList += "#define IS_REQUIRED_BORDERLINE 1\n";
-      fragmentShaderPrefixList += "#define IS_REQUIRED_BORDERLINE 1\n";
+      vertexShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
+      fragmentShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
     }
     shader = Shader::New(Dali::Shader::GetVertexShaderPrefix() + vertexShaderPrefixList + SHADER_COLOR_VISUAL_SHADER_VERT.data(),
                          Dali::Shader::GetFragmentShaderPrefix() + fragmentShaderPrefixList + SHADER_COLOR_VISUAL_SHADER_FRAG.data());
@@ -287,23 +289,39 @@ Dali::Property ColorVisual::OnGetPropertyObject(Dali::Property::Key key)
 
   if((key.type == Property::Key::INDEX && key.indexKey == DevelColorVisual::Property::BLUR_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == BLUR_RADIUS_NAME))
   {
-    mBlurRadiusIndex = mImpl->mRenderer.RegisterProperty(DevelColorVisual::Property::BLUR_RADIUS, BLUR_RADIUS_NAME, mBlurRadius);
+    const bool updateShader = !mImpl->mCustomShader && !IsBlurRequired();
 
     // Blur is animated now. we always have to use blur feature.
     mAlwaysUsingBlurRadius = true;
 
-    mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
-
-    // Change shader
-    UpdateShader();
+    if(updateShader)
+    {
+      // Update each values to renderer
+      DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBlurRadiusUniform();
+      mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BLUR_RADIUS, mBlurRadius);
 
-    return Dali::Property(mImpl->mRenderer, mBlurRadiusIndex);
+      // Change shader
+      UpdateShader();
+    }
+    mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+    return Dali::Property(mImpl->mRenderer, DecoratedVisualRenderer::Property::BLUR_RADIUS);
   }
 
   Handle handle;
   return Dali::Property(handle, Property::INVALID_INDEX);
 }
 
+bool ColorVisual::IsBlurRequired() const
+{
+  float blurRadius = mBlurRadius;
+  if(mImpl->mRenderer)
+  {
+    // Update values from Renderer
+    blurRadius = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BLUR_RADIUS);
+  }
+  return mAlwaysUsingBlurRadius || !EqualsZero(blurRadius);
+}
+
 } // namespace Internal
 
 } // namespace Toolkit
index bb8bc95..0a8a8b2 100644 (file)
@@ -123,6 +123,14 @@ protected:
    */
   Dali::Property OnGetPropertyObject(Dali::Property::Key key) override;
 
+protected:
+  /**
+   * @brief Query whether the visual requires to be blur.
+   *
+   * @return Returns true if the blur is required, false otherwise.
+   */
+  bool IsBlurRequired() const;
+
 private:
   // Undefined
   ColorVisual(const ColorVisual& colorRenderer);
@@ -131,9 +139,8 @@ private:
   ColorVisual& operator=(const ColorVisual& colorRenderer);
 
 private:
-  float           mBlurRadius;                ///< The blur radius
-  Property::Index mBlurRadiusIndex;           ///< The blur radius property index
-  bool            mAlwaysUsingBlurRadius : 1; ///< Whether we need the blur radius in shader always.
+  float mBlurRadius;                ///< The blur radius
+  bool  mAlwaysUsingBlurRadius : 1; ///< Whether we need the blur radius in shader always.
 };
 
 } // namespace Internal
index cef1ef4..ea84e5e 100644 (file)
@@ -25,6 +25,7 @@
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/object/property-array.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
 #include <typeinfo>
 
 // INTERNAL INCLUDES
@@ -46,7 +47,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(6); // alignment + corner/border
+const int CUSTOM_PROPERTY_COUNT(1); // alignment
 
 DALI_ENUM_TO_STRING_TABLE_BEGIN(UNITS)
   DALI_ENUM_TO_STRING_WITH_SCOPE(Toolkit::GradientVisual::Units, OBJECT_BOUNDING_BOX)
@@ -261,7 +262,7 @@ void GradientVisual::OnInitialize()
   sampler.SetWrapMode(wrap, wrap);
   textureSet.SetSampler(0u, sampler);
 
-  mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+  mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
   mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
   mImpl->mRenderer.SetTextures(textureSet);
 
@@ -391,21 +392,21 @@ Shader GradientVisual::GenerateShader() const
 
     if(roundedCorner)
     {
-      vertexShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER 1\n";
-      fragmentShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER 1\n";
+      vertexShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER\n";
+      fragmentShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER\n";
     }
     if(borderline)
     {
-      vertexShaderPrefixList += "#define IS_REQUIRED_BORDERLINE 1\n";
-      fragmentShaderPrefixList += "#define IS_REQUIRED_BORDERLINE 1\n";
+      vertexShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
+      fragmentShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
     }
     if(radialGradient)
     {
-      fragmentShaderPrefixList += "#define RADIAL 1\n";
+      fragmentShaderPrefixList += "#define RADIAL\n";
     }
     if(userspaceUnit)
     {
-      vertexShaderPrefixList += "#define USER_SPACE 1\n";
+      vertexShaderPrefixList += "#define USER_SPACE\n";
     }
 
     shader = Shader::New(Dali::Shader::GetVertexShaderPrefix() + vertexShaderPrefixList + SHADER_GRADIENT_VISUAL_SHADER_VERT.data(),
index 16ba9ca..ceb5848 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2022 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.
@@ -52,18 +52,17 @@ enum class ImageVisualRequireFlag : uint32_t
   ALPHA_MASKING  = 1 << 2,
 };
 
-static constexpr auto SHADER_TYPE_COUNT = 8u;
+static constexpr auto          SHADER_TYPE_COUNT = 8u;
 VisualFactoryCache::ShaderType SHADER_TYPE_TABLE[SHADER_TYPE_COUNT] =
-{
-  VisualFactoryCache::IMAGE_SHADER,
-  VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER,
-  VisualFactoryCache::IMAGE_SHADER_BORDERLINE,
-  VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE,
-  VisualFactoryCache::IMAGE_SHADER_MASKING,
-  VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_MASKING,
-  VisualFactoryCache::IMAGE_SHADER_BORDERLINE_MASKING,
-  VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING
-};
+  {
+    VisualFactoryCache::IMAGE_SHADER,
+    VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER,
+    VisualFactoryCache::IMAGE_SHADER_BORDERLINE,
+    VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE,
+    VisualFactoryCache::IMAGE_SHADER_MASKING,
+    VisualFactoryCache::IMAGE_SHADER_ROUNDED_CORNER_MASKING,
+    VisualFactoryCache::IMAGE_SHADER_BORDERLINE_MASKING,
+    VisualFactoryCache::IMAGE_SHADER_ROUNDED_BORDERLINE_MASKING};
 
 } // unnamed namespace
 
@@ -112,7 +111,7 @@ ImageVisualShaderFactory::~ImageVisualShaderFactory()
 
 Shader ImageVisualShaderFactory::GetShader(VisualFactoryCache& factoryCache, const ImageVisualShaderFeature::FeatureBuilder& featureBuilder)
 {
-  Shader shader;
+  Shader                         shader;
   VisualFactoryCache::ShaderType shaderType = VisualFactoryCache::IMAGE_SHADER;
 
   const auto& atlasing                = featureBuilder.mTextureAtlas;
@@ -121,8 +120,8 @@ Shader ImageVisualShaderFactory::GetShader(VisualFactoryCache& factoryCache, con
   const auto& borderline              = featureBuilder.mBorderline;
   const auto& alphaMaskingOnRendering = featureBuilder.mAlphaMaskingOnRendering;
   const auto& changeFragmentShader    = (featureBuilder.mTexture && DevelTexture::IsNative(featureBuilder.mTexture))
-                                          ? ImageVisualShaderFeature::ChangeFragmentShader::NEED_CHANGE
-                                          : ImageVisualShaderFeature::ChangeFragmentShader::DONT_CHANGE;
+                                       ? ImageVisualShaderFeature::ChangeFragmentShader::NEED_CHANGE
+                                       : ImageVisualShaderFeature::ChangeFragmentShader::DONT_CHANGE;
 
   if(atlasing == ImageVisualShaderFeature::TextureAtlas::ENABLED)
   {
@@ -169,33 +168,33 @@ Shader ImageVisualShaderFactory::GetShader(VisualFactoryCache& factoryCache, con
     {
       if(defaultTextureWrapping == ImageVisualShaderFeature::DefaultTextureWrapMode::APPLY)
       {
-        fragmentShaderPrefixList += "#define ATLAS_DEFAULT_WARP 1\n";
+        fragmentShaderPrefixList += "#define ATLAS_DEFAULT_WARP\n";
       }
       else
       {
-        fragmentShaderPrefixList += "#define ATLAS_CUSTOM_WARP 1\n";
+        fragmentShaderPrefixList += "#define ATLAS_CUSTOM_WARP\n";
       }
     }
     else
     {
       if(roundedCorner == ImageVisualShaderFeature::RoundedCorner::ENABLED)
       {
-        vertexShaderPrefixList   += "#define IS_REQUIRED_ROUNDED_CORNER 1\n";
-        fragmentShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER 1\n";
+        vertexShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER\n";
+        fragmentShaderPrefixList += "#define IS_REQUIRED_ROUNDED_CORNER\n";
       }
       if(borderline == ImageVisualShaderFeature::Borderline::ENABLED)
       {
-        vertexShaderPrefixList   += "#define IS_REQUIRED_BORDERLINE 1\n";
-        fragmentShaderPrefixList += "#define IS_REQUIRED_BORDERLINE 1\n";
+        vertexShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
+        fragmentShaderPrefixList += "#define IS_REQUIRED_BORDERLINE\n";
       }
       if(alphaMaskingOnRendering == ImageVisualShaderFeature::AlphaMaskingOnRendering::ENABLED)
       {
-        vertexShaderPrefixList   += "#define IS_REQUIRED_ALPHA_MASKING 1\n";
-        fragmentShaderPrefixList += "#define IS_REQUIRED_ALPHA_MASKING 1\n";
+        vertexShaderPrefixList += "#define IS_REQUIRED_ALPHA_MASKING\n";
+        fragmentShaderPrefixList += "#define IS_REQUIRED_ALPHA_MASKING\n";
       }
     }
 
-    std::string vertexShader   = std::string(Dali::Shader::GetVertexShaderPrefix()   + vertexShaderPrefixList   + SHADER_IMAGE_VISUAL_SHADER_VERT.data());
+    std::string vertexShader   = std::string(Dali::Shader::GetVertexShaderPrefix() + vertexShaderPrefixList + SHADER_IMAGE_VISUAL_SHADER_VERT.data());
     std::string fragmentShader = std::string(Dali::Shader::GetFragmentShaderPrefix() + fragmentShaderPrefixList + SHADER_IMAGE_VISUAL_SHADER_FRAG.data());
 
     if(changeFragmentShader == ImageVisualShaderFeature::ChangeFragmentShader::NEED_CHANGE)
index 44c9fac..ef71786 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/devel-api/scripting/scripting.h>
 #include <dali/integration-api/debug.h>
 #include <dali/public-api/actors/layer.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
 #include <cstring> // for strlen()
 
 // INTERNAL HEADERS
@@ -51,7 +52,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(12); // ltr, wrap, pixel area, atlas, pixalign, crop to mask, mask texture ratio + border/corner
+const int CUSTOM_PROPERTY_COUNT(7); // ltr, wrap, pixel area, atlas, pixalign, crop to mask, mask texture ratio
 
 // fitting modes
 DALI_ENUM_TO_STRING_TABLE_BEGIN(FITTING_MODE)
@@ -582,7 +583,7 @@ void ImageVisual::OnInitialize()
   Shader shader = GenerateShader();
 
   // Create the renderer
-  mImpl->mRenderer = VisualRenderer::New(geometry, shader);
+  mImpl->mRenderer = DecoratedVisualRenderer::New(geometry, shader);
   mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
 
   //Register transform properties
@@ -1057,7 +1058,7 @@ Shader ImageVisual::GenerateShader() const
 
   if(useStandardShader)
   {
-    bool   requiredAlphaMaskingOnRendering = (mMaskingData && !mMaskingData->mMaskImageLoadingFailed) ? !mMaskingData->mPreappliedMasking : false;
+    bool requiredAlphaMaskingOnRendering = (mMaskingData && !mMaskingData->mMaskImageLoadingFailed) ? !mMaskingData->mPreappliedMasking : false;
     // Create and cache the standard shader
     shader = mImageVisualShaderFactory.GetShader(
       mFactoryCache,
@@ -1133,8 +1134,8 @@ void ImageVisual::CheckMaskTexture()
 {
   if(mMaskingData && !mMaskingData->mPreappliedMasking)
   {
-    bool maskLoadFailed = true;
-    TextureSet textures = mImpl->mRenderer.GetTextures();
+    bool       maskLoadFailed = true;
+    TextureSet textures       = mImpl->mRenderer.GetTextures();
     if(textures && textures.GetTextureCount() >= TEXTURE_COUNT_FOR_GPU_ALPHA_MASK)
     {
       if(mMaskingData->mCropToMask)
index a92f7f8..9d0a2cc 100644 (file)
@@ -29,6 +29,7 @@
 // EXTERNAL INCLUDES
 #include <dali/devel-api/common/stage.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
 
 namespace Dali
 {
@@ -38,7 +39,7 @@ namespace Internal
 {
 namespace
 {
-const int CUSTOM_PROPERTY_COUNT(6); // atlas + corner/border
+const int CUSTOM_PROPERTY_COUNT(1); // atlas
 
 // property name
 const Dali::Vector4 FULL_TEXTURE_RECT(0.f, 0.f, 1.f, 1.f);
@@ -85,7 +86,7 @@ void SvgVisual::OnInitialize()
 {
   Shader   shader   = GenerateShader();
   Geometry geometry = mFactoryCache.GetGeometry(VisualFactoryCache::QUAD_GEOMETRY);
-  mImpl->mRenderer  = VisualRenderer::New(geometry, shader);
+  mImpl->mRenderer  = DecoratedVisualRenderer::New(geometry, shader);
   mImpl->mRenderer.ReserveCustomProperties(CUSTOM_PROPERTY_COUNT);
 
   Vector2 dpi     = Stage::GetCurrent().GetDpi();
index 2616b2a..49a14de 100644 (file)
@@ -126,10 +126,6 @@ Internal::Visual::Base::Impl::Impl(FittingMode fittingMode, Toolkit::Visual::Typ
   mCornerRadius(Vector4::ZERO),
   mCornerRadiusPolicy(1.0f),
   mDepthIndex(0.0f),
-  mBorderlineWidthIndex(Property::INVALID_INDEX),
-  mBorderlineColorIndex(Property::INVALID_INDEX),
-  mBorderlineOffsetIndex(Property::INVALID_INDEX),
-  mCornerRadiusIndex(Property::INVALID_INDEX),
   mFittingMode(fittingMode),
   mFlags(0),
   mResourceStatus(Toolkit::Visual::ResourceStatus::PREPARING),
index f462be2..568af24 100644 (file)
@@ -127,10 +127,6 @@ struct Base::Impl
   Vector4                         mCornerRadius;
   float                           mCornerRadiusPolicy;
   int                             mDepthIndex;
-  Property::Index                 mBorderlineWidthIndex;
-  Property::Index                 mBorderlineColorIndex;
-  Property::Index                 mBorderlineOffsetIndex;
-  Property::Index                 mCornerRadiusIndex;
   FittingMode                     mFittingMode; ///< How the contents should fit the view
   int                             mFlags;
   Toolkit::Visual::ResourceStatus mResourceStatus;
index 960a9fd..b50cc59 100644 (file)
@@ -23,6 +23,7 @@
 #include <dali/devel-api/rendering/renderer-devel.h>
 #include <dali/devel-api/scripting/enum-helper.h>
 #include <dali/integration-api/debug.h>
+#include <dali/public-api/rendering/decorated-visual-renderer.h>
 #include <dali/public-api/rendering/visual-renderer.h>
 
 //INTERNAL HEARDER
@@ -135,22 +136,16 @@ void Visual::Base::Initialize()
   if(mImpl->mRenderer)
   {
     RegisterMixColor();
+    RegisterDecoration();
 
-    if(IsRoundedCornerRequired())
-    {
-      mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
-      mImpl->mRenderer.RegisterUniqueProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
-
-      mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
-    }
     if(IsBorderlineRequired())
     {
-      mImpl->mBorderlineWidthIndex  = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
-      mImpl->mBorderlineColorIndex  = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
-      mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
-
       mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
     }
+    else if(IsRoundedCornerRequired())
+    {
+      mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+    }
   }
 }
 
@@ -300,29 +295,28 @@ void Visual::Base::SetProperties(const Property::Map& propertyMap)
           mImpl->mBorderlineWidth = width;
         }
 
-        if(mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
-        {
-          mImpl->mRenderer.SetProperty(mImpl->mBorderlineWidthIndex, mImpl->mBorderlineWidth);
-        }
-        else if(DALI_UNLIKELY(mImpl->mRenderer && IsBorderlineRequired()))
+        if(DALI_UNLIKELY(mImpl->mRenderer))
         {
           // Unusual case. SetProperty called after OnInitialize().
           // Assume that DoAction call UPDATE_PROPERTY.
-          // We must regist properies into renderer, and update shader.
+          DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBorderlineUniform();
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
 
-          // Borderline added by this action. Register property to renderer.
-          mImpl->mBorderlineWidthIndex  = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
-          mImpl->mBorderlineColorIndex  = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
-          mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
-
-          // Make Blend mode ON_WITHOUT_CULL for transparent mix color.
-          mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
+          // Check whether we must update shader.
+          if(!mImpl->mAlwaysUsingBorderline && IsBorderlineRequired())
+          {
+            // Make Blend mode ON_WITHOUT_CULL for transparent mix color.
+            mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
 
-          // Change the shader must not be occured many times. we always have to use borderline feature.
-          mImpl->mAlwaysUsingBorderline = true;
+            // Change the shader must not be occured many times. we always have to use borderline feature.
+            mImpl->mAlwaysUsingBorderline = true;
 
-          // Change shader
-          needUpdateShader = true;
+            // Change shader
+            if(!mImpl->mCustomShader)
+            {
+              needUpdateShader = true;
+            }
+          }
         }
         break;
       }
@@ -334,9 +328,11 @@ void Visual::Base::SetProperties(const Property::Map& propertyMap)
           mImpl->mBorderlineColor = color;
         }
 
-        if(mImpl->mBorderlineColorIndex != Property::INVALID_INDEX)
+        if(DALI_UNLIKELY(mImpl->mRenderer))
         {
-          mImpl->mRenderer.SetProperty(mImpl->mBorderlineColorIndex, mImpl->mBorderlineColor);
+          // Unusual case. SetProperty called after OnInitialize().
+          // Assume that DoAction call UPDATE_PROPERTY.
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->mBorderlineColor);
         }
         break;
       }
@@ -348,9 +344,11 @@ void Visual::Base::SetProperties(const Property::Map& propertyMap)
           mImpl->mBorderlineOffset = offset;
         }
 
-        if(mImpl->mBorderlineOffsetIndex != Property::INVALID_INDEX)
+        if(DALI_UNLIKELY(mImpl->mRenderer))
         {
-          mImpl->mRenderer.SetProperty(mImpl->mBorderlineOffsetIndex, mImpl->mBorderlineOffset);
+          // Unusual case. SetProperty called after OnInitialize().
+          // Assume that DoAction call UPDATE_PROPERTY.
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
         }
         break;
       }
@@ -378,32 +376,33 @@ void Visual::Base::SetProperties(const Property::Map& propertyMap)
           }
         }
 
-        if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
-        {
-          mImpl->mRenderer.SetProperty(mImpl->mCornerRadiusIndex, mImpl->mCornerRadius);
-        }
-        else if(DALI_UNLIKELY(mImpl->mRenderer && IsRoundedCornerRequired()))
+        if(DALI_UNLIKELY(mImpl->mRenderer))
         {
           // Unusual case. SetProperty called after OnInitialize().
           // Assume that DoAction call UPDATE_PROPERTY.
-          // We must regist properies into renderer, and update shader.
+          DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterCornerRadiusUniform();
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS, mImpl->mCornerRadius);
 
-          // CornerRadius added by this action. Regist property to renderer.
-          mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
-          mImpl->mRenderer.RegisterUniqueProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
+          // Check whether we must update shader.
+          if(!mImpl->mAlwaysUsingCornerRadius && IsRoundedCornerRequired())
+          {
+            // Change the shader must not be occured many times. we always have to use corner radius feature.
+            mImpl->mAlwaysUsingCornerRadius = true;
 
-          // Change the shader must not be occured many times. we always have to use corner radius feature.
-          mImpl->mAlwaysUsingCornerRadius = true;
+            if(!IsBorderlineRequired())
+            {
+              // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
+              mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+            }
 
-          if(!IsBorderlineRequired())
-          {
-            // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
-            mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+            // Change shader
+            if(!mImpl->mCustomShader)
+            {
+              needUpdateShader = true;
+            }
           }
-
-          // Change shader
-          needUpdateShader = true;
         }
+
         break;
       }
       case Toolkit::DevelVisual::Property::CORNER_RADIUS_POLICY:
@@ -417,14 +416,11 @@ void Visual::Base::SetProperties(const Property::Map& propertyMap)
             case Toolkit::Visual::Transform::Policy::ABSOLUTE:
             {
               mImpl->mCornerRadiusPolicy = policy;
-              if(DALI_UNLIKELY(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX))
+              if(DALI_UNLIKELY(mImpl->mRenderer))
               {
                 // Unusual case. SetProperty called after OnInitialize().
                 // Assume that DoAction call UPDATE_PROPERTY.
-                // We must update properies result into renderer
-                // Note : mImpl->mCornerRadiusIndex is not INVALID_INDEX.
-                // So CornerRadiusPolicy property is already registed.
-                mImpl->mRenderer.SetProperty(mImpl->mRenderer.GetPropertyIndex(CORNER_RADIUS_POLICY), mImpl->mCornerRadiusPolicy);
+                mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
               }
               break;
             }
@@ -572,21 +568,15 @@ void Visual::Base::CreatePropertyMap(Property::Map& map) const
     mImpl->mTransform.mOffset = mImpl->mRenderer.GetProperty<Vector2>(VisualRenderer::Property::TRANSFORM_OFFSET);
     mImpl->mTransform.mSize   = mImpl->mRenderer.GetProperty<Vector2>(VisualRenderer::Property::TRANSFORM_SIZE);
 
-    if(mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
-    {
-      mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
-    }
-    if(mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
+    if(IsTypeAvailableForCornerRadius(mImpl->mType))
     {
-      mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineWidthIndex);
+      mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(DecoratedVisualRenderer::Property::CORNER_RADIUS);
     }
-    if(mImpl->mBorderlineColorIndex != Property::INVALID_INDEX)
+    if(IsTypeAvailableForBorderline(mImpl->mType))
     {
-      mImpl->mBorderlineColor = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mBorderlineColorIndex);
-    }
-    if(mImpl->mBorderlineOffsetIndex != Property::INVALID_INDEX)
-    {
-      mImpl->mBorderlineOffset = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineOffsetIndex);
+      mImpl->mBorderlineWidth  = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
+      mImpl->mBorderlineColor  = mImpl->mRenderer.GetProperty<Vector4>(DecoratedVisualRenderer::Property::BORDERLINE_COLOR);
+      mImpl->mBorderlineOffset = mImpl->mRenderer.GetProperty<float>(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET);
     }
   }
 
@@ -675,12 +665,13 @@ bool Visual::Base::IsRoundedCornerRequired() const
   // If VisualType doesn't support rounded corner, always return false.
   if(IsTypeAvailableForCornerRadius(mImpl->mType))
   {
-    if(mImpl->mRenderer && mImpl->mCornerRadiusIndex != Property::INVALID_INDEX)
+    if(mImpl->mRenderer)
     {
       // Update values from Renderer
-      mImpl->mCornerRadius = mImpl->mRenderer.GetProperty<Vector4>(mImpl->mCornerRadiusIndex);
+      Property::Value value = mImpl->mRenderer.GetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS);
+      value.Get(mImpl->mCornerRadius);
     }
-    return !(mImpl->mCornerRadius == Vector4::ZERO) || mImpl->mAlwaysUsingCornerRadius;
+    return mImpl->mAlwaysUsingCornerRadius || !(mImpl->mCornerRadius == Vector4::ZERO);
   }
   return false;
 }
@@ -690,12 +681,13 @@ bool Visual::Base::IsBorderlineRequired() const
   // If VisualType doesn't support borderline, always return false.
   if(IsTypeAvailableForBorderline(mImpl->mType))
   {
-    if(mImpl->mRenderer && mImpl->mBorderlineWidthIndex != Property::INVALID_INDEX)
+    if(mImpl->mRenderer)
     {
       // Update values from Renderer
-      mImpl->mBorderlineWidth = mImpl->mRenderer.GetProperty<float>(mImpl->mBorderlineWidthIndex);
+      Property::Value value = mImpl->mRenderer.GetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH);
+      value.Get(mImpl->mBorderlineWidth);
     }
-    return !EqualsZero(mImpl->mBorderlineWidth) || mImpl->mAlwaysUsingBorderline;
+    return mImpl->mAlwaysUsingBorderline || !EqualsZero(mImpl->mBorderlineWidth);
   }
   return false;
 }
@@ -722,6 +714,32 @@ void Visual::Base::RegisterMixColor()
   }
 }
 
+void Visual::Base::RegisterDecoration()
+{
+  if(mImpl->mRenderer)
+  {
+    if(IsTypeAvailableForCornerRadius(mImpl->mType))
+    {
+      if(mImpl->mAlwaysUsingCornerRadius || !(mImpl->mCornerRadius == Vector4::ZERO))
+      {
+        DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterCornerRadiusUniform();
+        mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS, mImpl->mCornerRadius);
+        mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
+      }
+    }
+    if(IsTypeAvailableForBorderline(mImpl->mType))
+    {
+      if(mImpl->mAlwaysUsingBorderline || !EqualsZero(mImpl->mBorderlineWidth))
+      {
+        DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBorderlineUniform();
+        mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
+        mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->mBorderlineColor);
+        mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
+      }
+    }
+  }
+}
+
 void Visual::Base::SetMixColor(const Vector4& color)
 {
   mImpl->mMixColor = color;
@@ -920,6 +938,22 @@ Property::Index Visual::Base::GetPropertyIndex(Property::Key key)
     {
       return VisualRenderer::Property::VISUAL_PRE_MULTIPLIED_ALPHA;
     }
+    case Dali::Toolkit::DevelVisual::Property::CORNER_RADIUS:
+    {
+      return DecoratedVisualRenderer::Property::CORNER_RADIUS;
+    }
+    case Dali::Toolkit::DevelVisual::Property::BORDERLINE_WIDTH:
+    {
+      return DecoratedVisualRenderer::Property::BORDERLINE_WIDTH;
+    }
+    case Dali::Toolkit::DevelVisual::Property::BORDERLINE_COLOR:
+    {
+      return DecoratedVisualRenderer::Property::BORDERLINE_COLOR;
+    }
+    case Dali::Toolkit::DevelVisual::Property::BORDERLINE_OFFSET:
+    {
+      return DecoratedVisualRenderer::Property::BORDERLINE_OFFSET;
+    }
   }
 
   Property::Index index = mImpl->mRenderer.GetPropertyIndex(key);
@@ -996,6 +1030,7 @@ void Visual::Base::AnimateProperty(
   Internal::TransitionData::Animator& animator)
 {
 #if defined(DEBUG_ENABLED)
+  if(gVisualBaseLogFilter->IsEnabledFor(Debug::General))
   {
     std::ostringstream oss;
     oss << "Visual::Base::AnimateProperty(Visual:" << mImpl->mName << " Property:" << animator.propertyKey << " Target: " << animator.targetValue << std::endl;
@@ -1121,9 +1156,9 @@ Dali::Property Visual::Base::GetPropertyObject(Dali::Property::Key key)
     return Dali::Property(handle, Property::INVALID_INDEX);
   }
 
-  // Default animatable properties from VisualRenderer
   switch(GetIntKey(key))
   {
+    // Default animatable properties from VisualRenderer
     case Toolkit::Visual::Property::MIX_COLOR:
     {
       return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
@@ -1140,85 +1175,79 @@ Dali::Property Visual::Base::GetPropertyObject(Dali::Property::Key key)
     {
       return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::TRANSFORM_SIZE);
     }
-    default:
-    {
-      if(key.type == Property::Key::INDEX &&
-         ((mImpl->mType == Toolkit::Visual::COLOR && key.indexKey == ColorVisual::Property::MIX_COLOR) ||
-          (mImpl->mType == Toolkit::Visual::PRIMITIVE && key.indexKey == PrimitiveVisual::Property::MIX_COLOR)))
-      {
-        return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
-      }
-    }
-  }
 
-  // Other cases
-  Property::Index index = GetPropertyIndex(key);
-  if(index == Property::INVALID_INDEX)
-  {
-    if(IsTypeAvailableForBorderline(mImpl->mType) &&
-       ((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_WIDTH) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_WIDTH) ||
-        (key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_COLOR) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_COLOR) ||
-        (key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::BORDERLINE_OFFSET) || (key.type == Property::Key::STRING && key.stringKey == BORDERLINE_OFFSET)))
+    // Default animatable properties from DecoratedVisualRenderer
+    case Toolkit::DevelVisual::Property::CORNER_RADIUS:
     {
-      mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
-
-      // Register borderline properties
-      mImpl->mBorderlineWidthIndex  = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_WIDTH, BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
-      mImpl->mBorderlineColorIndex  = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_COLOR, BORDERLINE_COLOR, mImpl->mBorderlineColor);
-      mImpl->mBorderlineOffsetIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::BORDERLINE_OFFSET, BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
+      if(IsTypeAvailableForCornerRadius(mImpl->mType))
+      {
+        const bool updateShader = !mImpl->mCustomShader && !IsRoundedCornerRequired();
 
-      // Borderline is animated now. we always have to use borderline feature.
-      mImpl->mAlwaysUsingBorderline = true;
+        // CornerRadius is animated now. we always have to use corner radius feature.
+        mImpl->mAlwaysUsingCornerRadius = true;
 
-      index = mImpl->mRenderer.GetPropertyIndex(key);
+        if(updateShader)
+        {
+          // Update each values to renderer
+          DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterCornerRadiusUniform();
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS, mImpl->mCornerRadius);
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
 
-      // Change shader
-      UpdateShader();
+          // Change shader
+          UpdateShader();
+        }
+        if(!IsBorderlineRequired())
+        {
+          // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
+          mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
+        }
+        return Dali::Property(mImpl->mRenderer, DecoratedVisualRenderer::Property::CORNER_RADIUS);
+      }
+      break;
     }
-    else if(IsTypeAvailableForCornerRadius(mImpl->mType) && ((key.type == Property::Key::INDEX && key.indexKey == DevelVisual::Property::CORNER_RADIUS) || (key.type == Property::Key::STRING && key.stringKey == CORNER_RADIUS)))
+    case Toolkit::DevelVisual::Property::BORDERLINE_WIDTH:
+    case Toolkit::DevelVisual::Property::BORDERLINE_COLOR:
+    case Toolkit::DevelVisual::Property::BORDERLINE_OFFSET:
     {
-      // Register CORNER_RADIUS property
-      mImpl->mCornerRadiusIndex = mImpl->mRenderer.RegisterUniqueProperty(DevelVisual::Property::CORNER_RADIUS, CORNER_RADIUS, mImpl->mCornerRadius);
-      mImpl->mRenderer.RegisterUniqueProperty(CORNER_RADIUS_POLICY, mImpl->mCornerRadiusPolicy);
+      if(IsTypeAvailableForBorderline(mImpl->mType))
+      {
+        const bool updateShader = !mImpl->mCustomShader && !IsBorderlineRequired();
 
-      // CornerRadius is animated now. we always have to use corner radius feature.
-      mImpl->mAlwaysUsingCornerRadius = true;
+        // Borderline is animated now. we always have to use borderline feature.
+        mImpl->mAlwaysUsingBorderline = true;
 
-      if(!IsBorderlineRequired())
-      {
-        // If IsBorderlineRequired is true, BLEND_MODE is already BlendMode::ON_WITHOUT_CULL. So we don't overwrite it.
-        mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON);
-      }
+        if(updateShader)
+        {
+          // Update each values to renderer
+          DownCast<DecoratedVisualRenderer>(mImpl->mRenderer).RegisterBorderlineUniform();
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_WIDTH, mImpl->mBorderlineWidth);
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_COLOR, mImpl->mBorderlineColor);
+          mImpl->mRenderer.SetProperty(DecoratedVisualRenderer::Property::BORDERLINE_OFFSET, mImpl->mBorderlineOffset);
 
-      index = mImpl->mCornerRadiusIndex;
+          // Change shader
+          UpdateShader();
+        }
+        mImpl->mRenderer.SetProperty(Renderer::Property::BLEND_MODE, BlendMode::ON_WITHOUT_CULL);
 
-      // Change shader
-      UpdateShader();
-    }
-    else
-    {
-      // We can't find the property in the base class.
-      // Request to child class
-      return OnGetPropertyObject(key);
-    }
-  }
-  else
-  {
-    if(index == mImpl->mBorderlineWidthIndex ||
-       index == mImpl->mBorderlineColorIndex ||
-       index == mImpl->mBorderlineOffsetIndex)
-    {
-      // Borderline is animated now. we always have to use borderline feature.
-      mImpl->mAlwaysUsingBorderline = true;
+        return Dali::Property(mImpl->mRenderer, GetPropertyIndex(key));
+      }
+      break;
     }
-    if(index == mImpl->mCornerRadiusIndex)
+    // Special case for MIX_COLOR
+    default:
     {
-      // CornerRadius is animated now. we always have to use corner radius feature.
-      mImpl->mAlwaysUsingCornerRadius = true;
+      if(key.type == Property::Key::INDEX &&
+         ((mImpl->mType == Toolkit::Visual::COLOR && key.indexKey == ColorVisual::Property::MIX_COLOR) ||
+          (mImpl->mType == Toolkit::Visual::PRIMITIVE && key.indexKey == PrimitiveVisual::Property::MIX_COLOR)))
+      {
+        return Dali::Property(mImpl->mRenderer, VisualRenderer::Property::VISUAL_MIX_COLOR);
+      }
     }
   }
 
-  return Dali::Property(mImpl->mRenderer, index);
+  // We can't find the property in the base class.
+  // Request to child class
+  return OnGetPropertyObject(key);
 }
 
 } // namespace Internal
index 20b0bd9..bdcb193 100644 (file)
@@ -422,6 +422,11 @@ private:
   void RegisterMixColor();
 
   /**
+   * Register the uniform on the DecoratedVisualRenderer and store the property index if necessary.
+   */
+  void RegisterDecoration();
+
+  /**
    * Find the matching property on the renderer or shader. If it's a shader
    * property, register it on the renderer in order to animate it for this
    * visual independently.
index ce19a6b..a4b0a0a 100644 (file)
@@ -388,9 +388,13 @@ void VisualFactory::SetBrokenImageUrl(Toolkit::StyleManager& styleManager)
 
   if(styleManager)
   {
-    customBrokenImageUrlList = Toolkit::DevelStyleManager::GetBrokenImageUrlList(styleManager);
-    Property::Map config     = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
-    config["brokenImageUrl"].Get(brokenImageUrl);
+    customBrokenImageUrlList                 = Toolkit::DevelStyleManager::GetBrokenImageUrlList(styleManager);
+    const Property::Map& config              = Toolkit::DevelStyleManager::GetConfigurations(styleManager);
+    const auto           brokenImageUrlValue = config.Find("brokenImageUrl", Property::Type::STRING);
+    if(brokenImageUrlValue)
+    {
+      brokenImageUrlValue->Get(brokenImageUrl);
+    }
   }
 
   // Add default image
index 55c9919..d97fd48 100644 (file)
@@ -29,7 +29,7 @@ namespace Toolkit
 {
 const unsigned int TOOLKIT_MAJOR_VERSION = 2;
 const unsigned int TOOLKIT_MINOR_VERSION = 1;
-const unsigned int TOOLKIT_MICRO_VERSION = 25;
+const unsigned int TOOLKIT_MICRO_VERSION = 26;
 const char* const  TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index b644874..771452a 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali2-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    2.1.25
+Version:    2.1.26
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT