Merge branch 'devel/master' into tizen accepted/tizen/unified/20220726.132118 accepted/tizen/unified/20220728.044817 submit/tizen/20220725.092221 submit/tizen/20220727.051150
authorHosang Kim <hosang12.kim@samsung.com>
Mon, 25 Jul 2022 05:58:50 +0000 (14:58 +0900)
committerHosang Kim <hosang12.kim@samsung.com>
Mon, 25 Jul 2022 05:58:50 +0000 (14:58 +0900)
examples/animated-vector-images/animated-vector-images-example.cpp
examples/perf-view-creation/perf-view-creation-example.cpp
packaging/com.samsung.dali-demo.spec
resources/images/done.json [new file with mode: 0644]

index d138483..9612c47 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.
@@ -22,6 +22,7 @@
 #include <dali-toolkit/devel-api/visuals/animated-vector-image-visual-signals-devel.h>
 #include <dali-toolkit/devel-api/visuals/image-visual-properties-devel.h>
 #include <dali/dali.h>
+#include <dali/devel-api/adaptor-framework/vector-animation-renderer.h>
 #include <string>
 #include "shared/view.h"
 
@@ -35,8 +36,8 @@ const char* TOOLBAR_IMAGE(DEMO_IMAGE_DIR "top-bar.png");
 const char* APPLICATION_TITLE("Animated Vector Images");
 
 const char* IMAGE_PATH[] = {
+  DEMO_IMAGE_DIR "done.json",
   DEMO_IMAGE_DIR "insta_camera.json",
-  DEMO_IMAGE_DIR "you're_in!.json",
   DEMO_IMAGE_DIR "jolly_walker.json"};
 
 const unsigned int NUMBER_OF_IMAGES = 3;
@@ -140,10 +141,80 @@ public:
       mTable.AddChild(mImageViews[x], TableView::CellPosition(CellPlacement::IMAGE, x));
     }
 
+    DevelAnimatedVectorImageVisual::DynamicPropertyInfo info;
+    info.id       = 1;
+    info.keyPath  = "Shape Layer 1.Ellipse 1.Fill 1";
+    info.property = static_cast<int>(VectorAnimationRenderer::VectorProperty::FILL_COLOR);
+    info.callback = MakeCallback(this, &AnimatedVectorImageViewController::FillColorCallback);
+
+    DevelControl::DoActionExtension(mImageViews[0], ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::SET_DYNAMIC_PROPERTY, Any(info));
+
+    info.id       = 2;
+    info.keyPath  = "**";
+    info.property = static_cast<int>(VectorAnimationRenderer::VectorProperty::STROKE_COLOR);
+    info.callback = MakeCallback(this, &AnimatedVectorImageViewController::StrokeColorCallback);
+
+    DevelControl::DoActionExtension(mImageViews[0], ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::SET_DYNAMIC_PROPERTY, Any(info));
+
+    info.id       = 3;
+    info.keyPath  = "**";
+    info.property = static_cast<int>(VectorAnimationRenderer::VectorProperty::STROKE_WIDTH);
+    info.callback = MakeCallback(this, &AnimatedVectorImageViewController::StrokeWidthCallback);
+
+    DevelControl::DoActionExtension(mImageViews[0], ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::SET_DYNAMIC_PROPERTY, Any(info));
+
+    info.id       = 4;
+    info.keyPath  = "Shape Layer 2.Shape 1";
+    info.property = static_cast<int>(VectorAnimationRenderer::VectorProperty::TRANSFORM_ROTATION);
+    info.callback = MakeCallback(this, &AnimatedVectorImageViewController::TransformRotationCallback);
+
+    DevelControl::DoActionExtension(mImageViews[0], ImageView::Property::IMAGE, DevelAnimatedVectorImageVisual::Action::SET_DYNAMIC_PROPERTY, Any(info));
+
     application.GetWindow().KeyEventSignal().Connect(this, &AnimatedVectorImageViewController::OnKeyEvent);
   }
 
 private:
+  Property::Value FillColorCallback(int32_t id, VectorAnimationRenderer::VectorProperty property, uint32_t frameNumber)
+  {
+    if(frameNumber < 60)
+    {
+      return Vector3(0, 0, 1);
+    }
+    else
+    {
+      return Vector3(1, 0, 0);
+    }
+  }
+
+  Property::Value StrokeColorCallback(int32_t id, VectorAnimationRenderer::VectorProperty property, uint32_t frameNumber)
+  {
+    if(frameNumber < 60)
+    {
+      return Vector3(1, 0, 1);
+    }
+    else
+    {
+      return Vector3(1, 1, 0);
+    }
+  }
+
+  Property::Value StrokeWidthCallback(int32_t id, VectorAnimationRenderer::VectorProperty property, uint32_t frameNumber)
+  {
+    if(frameNumber < 60)
+    {
+      return 2.0f;
+    }
+    else
+    {
+      return 5.0f;
+    }
+  }
+
+  Property::Value TransformRotationCallback(int32_t id, VectorAnimationRenderer::VectorProperty property, uint32_t frameNumber)
+  {
+    return frameNumber * 20.0f;
+  }
+
   bool OnPlayButtonClicked(Button button)
   {
     unsigned int controlIndex = GetControlIndex(button);
index 4cb9fa6..2ef0074 100644 (file)
@@ -34,10 +34,6 @@ using namespace Dali;
 using namespace Dali::Toolkit;
 using namespace std;
 
-// TODO : borderline, blur type need to solve partial update issue.
-// Until that issue exist, just block it.
-#define ALLOW_BORDER_AND_BLUR 0
-
 namespace
 {
 enum class ControlTestType
@@ -47,12 +43,10 @@ enum class ControlTestType
   IMAGE,                ///< Test with simple image
   TEXT,                 ///< Test with simple text label
   ROUNDED_COLOR,        ///< Test with rounded color
-#if ALLOW_BORDER_AND_BLUR
   BORDER_COLOR,         ///< Test with borderline color
   ROUNDED_BORDER_COLOR, ///< Test with rounded borderline color
   BLUR_COLOR,           ///< Test with blur color
-  ROUNDED_BLUR_COLOR,   ///< Test with blur color
-#endif
+  ROUNDED_BLUR_COLOR,   ///< Test with rounded blur color
   TYPE_MAX,
   // clang-format on
 };
@@ -66,12 +60,10 @@ const char* TestTypeString(ControlTestType type)
     case ControlTestType::IMAGE:               return "IMAGE";
     case ControlTestType::TEXT:                return "TEXT";
     case ControlTestType::ROUNDED_COLOR:       return "ROUNDED COLOR";
-#if ALLOW_BORDER_AND_BLUR
     case ControlTestType::BORDER_COLOR:        return "BORDER COLOR";
     case ControlTestType::ROUNDED_BORDER_COLOR:return "ROUNDED BORDER COLOR";
     case ControlTestType::BLUR_COLOR:          return "BLUR COLOR";
     case ControlTestType::ROUNDED_BLUR_COLOR:  return "ROUNDED BLUR COLOR";
-#endif
     default:                                   return "UNKNOWN";
   }
   // clang-format on
@@ -94,7 +86,7 @@ constexpr uint32_t DURATION_OF_ANIMATION(DURATION_PER_COLUMNS*(COLUMNS_COUNT * 4
 // We should render same type of views in some timing.
 static_assert(COLUMNS_COUNT * 2 <= TOTAL_COLUMNS_COUNT);
 
-constexpr float VIEW_MARGIN_RATE = 0.1f;
+constexpr float VIEW_MARGIN_RATE = 0.2f;
 
 // copy from dali-adaptor time-service.cpp
 void GetNanoseconds(uint64_t& timeInNanoseconds)
@@ -141,7 +133,6 @@ Control CreateRoundedColor()
   return bgView;
 }
 
-#if ALLOW_BORDER_AND_BLUR
 Control CreateBorderColor(const float& requiredBorderlineWidth)
 {
   Control bgView = Control::New(Control::ControlBehaviour::DISABLE_STYLE_CHANGE_SIGNALS);
@@ -203,7 +194,6 @@ Control CreateRoundedBlurColor(const float& requiredBlurRadius)
 
   return bgView;
 }
-#endif
 
 /**
  * @brief Statistic container that we can get average / sum / min/ max.
@@ -379,7 +369,6 @@ public:
           bgView = CreateRoundedColor();
           break;
         }
-#if ALLOW_BORDER_AND_BLUR
         case ControlTestType::BORDER_COLOR:
         {
           bgView = CreateBorderColor(std::min(mSize.x, mSize.y) * VIEW_MARGIN_RATE);
@@ -400,7 +389,6 @@ public:
           bgView = CreateRoundedBlurColor(std::min(mSize.x, mSize.y) * VIEW_MARGIN_RATE * 0.5f);
           break;
         }
-#endif
       }
 
       bgView[Actor::Property::PARENT_ORIGIN] = ParentOrigin::TOP_LEFT;
index d4f10f2..db41816 100755 (executable)
@@ -2,7 +2,7 @@
 
 Name:       com.samsung.dali-demo
 Summary:    The OpenGLES Canvas Core Demo
-Version:    2.1.31
+Version:    2.1.32
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0
diff --git a/resources/images/done.json b/resources/images/done.json
new file mode 100644 (file)
index 0000000..a4b1196
--- /dev/null
@@ -0,0 +1 @@
+{"v":"4.11.1","fr":29.9700012207031,"ip":0,"op":76.0000030955435,"w":70,"h":70,"nm":"Comp 1","ddd":0,"assets":[],"layers":[{"ddd":0,"ind":1,"ty":4,"nm":"Shape Layer 2","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[35,35,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":33,"s":[0,0,100],"e":[120,120,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":46,"s":[120,120,100],"e":[100,100,100]},{"t":52.0000021180034}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[0,0],[0,0],[0,0]],"o":[[0,0],[0,0],[0,0]],"v":[[-7,1.438],[-2.656,5.781],[7.422,-4.297]],"c":false},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[1,1,1,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":3,"ix":5},"lc":2,"lj":2,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Shape 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false},{"ty":"tm","s":{"a":0,"k":0,"ix":1},"e":{"a":1,"k":[{"i":{"x":[0.667],"y":[1]},"o":{"x":[0.333],"y":[0]},"n":["0p667_1_0p333_0"],"t":33,"s":[0],"e":[100]},{"t":52.0000021180034}],"ix":2},"o":{"a":0,"k":0,"ix":3},"m":1,"ix":2,"nm":"Trim Paths 1","mn":"ADBE Vector Filter - Trim","hd":false}],"ip":0,"op":450.000018328876,"st":0,"bm":0},{"ddd":0,"ind":2,"ty":4,"nm":"Shape Layer 1","sr":1,"ks":{"o":{"a":0,"k":100,"ix":11},"r":{"a":0,"k":0,"ix":10},"p":{"a":0,"k":[35,35,0],"ix":2},"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":1,"k":[{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":18,"s":[0,0,100],"e":[120,120,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":33,"s":[120,120,100],"e":[80,80,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":41,"s":[80,80,100],"e":[110,110,100]},{"i":{"x":[0.667,0.667,0.667],"y":[1,1,1]},"o":{"x":[0.333,0.333,0.333],"y":[0,0,0]},"n":["0p667_1_0p333_0","0p667_1_0p333_0","0p667_1_0p333_0"],"t":49,"s":[110,110,100],"e":[100,100,100]},{"t":52.0000021180034}],"ix":6}},"ao":0,"shapes":[{"ty":"gr","it":[{"ind":0,"ty":"sh","ix":1,"ks":{"a":0,"k":{"i":[[13.015,0],[0,-13.015],[-13.015,0],[0,13.015]],"o":[[-13.015,0],[0,13.015],[13.015,0],[0,-13.015]],"v":[[0,-23.566],[-23.566,0],[0,23.566],[23.566,0]],"c":true},"ix":2},"nm":"Path 1","mn":"ADBE Vector Shape - Group","hd":false},{"ty":"st","c":{"a":0,"k":[0.898039215686,0.898039215686,0.898039215686,1],"ix":3},"o":{"a":0,"k":100,"ix":4},"w":{"a":0,"k":0,"ix":5},"lc":1,"lj":1,"ml":4,"nm":"Stroke 1","mn":"ADBE Vector Graphic - Stroke","hd":false},{"ty":"fl","c":{"a":0,"k":[0,0.760784313725,0.2,1],"ix":4},"o":{"a":0,"k":100,"ix":5},"r":1,"nm":"Fill 1","mn":"ADBE Vector Graphic - Fill","hd":false},{"ty":"tr","p":{"a":0,"k":[0,0],"ix":2},"a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[105.535,105.535],"ix":3},"r":{"a":0,"k":0,"ix":6},"o":{"a":0,"k":100,"ix":7},"sk":{"a":0,"k":0,"ix":4},"sa":{"a":0,"k":0,"ix":5},"nm":"Transform"}],"nm":"Ellipse 1","np":3,"cix":2,"ix":1,"mn":"ADBE Vector Group","hd":false}],"ip":0,"op":450.000018328876,"st":0,"bm":0}]}
\ No newline at end of file