[dali_1.4.29] Merge branch 'devel/master' 75/210475/1
authorVictor Cebollada <v.cebollada@samsung.com>
Fri, 19 Jul 2019 08:52:43 +0000 (09:52 +0100)
committerVictor Cebollada <v.cebollada@samsung.com>
Fri, 19 Jul 2019 08:52:43 +0000 (09:52 +0100)
Change-Id: Iacbcf9be76b31faea7bcf71b893acd70e728edaa

78 files changed:
automated-tests/src/dali-toolkit-internal/CMakeLists.txt
automated-tests/src/dali-toolkit-styling/CMakeLists.txt
automated-tests/src/dali-toolkit-styling/utc-Dali-StyleManager.cpp
automated-tests/src/dali-toolkit-third-party/CMakeLists.txt
automated-tests/src/dali-toolkit-third-party/utc-Dali-Flexbox-Layout.cpp
automated-tests/src/dali-toolkit/CMakeLists.txt
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-application.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor-impl.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-adaptor.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-options.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp [new file with mode: 0644]
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.h
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.cpp
automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-window.h
automated-tests/src/dali-toolkit/utc-Dali-AsyncImageLoader.cpp
automated-tests/src/dali-toolkit/utc-Dali-Builder.cpp
automated-tests/src/dali-toolkit/utc-Dali-CheckBoxButton.cpp
automated-tests/src/dali-toolkit/utc-Dali-DragAndDropDetector.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageAtlas.cpp
automated-tests/src/dali-toolkit/utc-Dali-ImageView.cpp
automated-tests/src/dali-toolkit/utc-Dali-PageTurnView.cpp
automated-tests/src/dali-toolkit/utc-Dali-ScrollView.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextEditor.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextField.cpp
automated-tests/src/dali-toolkit/utc-Dali-TextLabel.cpp
automated-tests/src/dali-toolkit/utc-Dali-TransitionData.cpp
automated-tests/src/dali-toolkit/utc-Dali-Visual.cpp
dali-toolkit/devel-api/builder/builder.cpp
dali-toolkit/devel-api/builder/builder.h
dali-toolkit/devel-api/builder/tree-node.cpp
dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.cpp
dali-toolkit/devel-api/controls/page-turn-view/page-turn-landscape-view.h
dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.cpp
dali-toolkit/devel-api/controls/page-turn-view/page-turn-portrait-view.h
dali-toolkit/devel-api/controls/page-turn-view/page-turn-view.h
dali-toolkit/internal/builder/builder-filesystem.h
dali-toolkit/internal/builder/builder-impl.cpp
dali-toolkit/internal/builder/builder-impl.h
dali-toolkit/internal/builder/json-parser-state.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.cpp
dali-toolkit/internal/controls/bloom-view/bloom-view-impl.h
dali-toolkit/internal/controls/control/control-renderers.cpp [new file with mode: 0644]
dali-toolkit/internal/controls/control/control-renderers.h [new file with mode: 0644]
dali-toolkit/internal/controls/effects-view/effects-view-impl.cpp
dali-toolkit/internal/controls/effects-view/effects-view-impl.h
dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-landscape-view-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-portrait-view-impl.h
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.cpp
dali-toolkit/internal/controls/page-turn-view/page-turn-view-impl.h
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.cpp
dali-toolkit/internal/controls/scrollable/scroll-view/scroll-view-page-path-effect-impl.h
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.cpp
dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h
dali-toolkit/internal/controls/super-blur-view/super-blur-view-impl.cpp
dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.cpp
dali-toolkit/internal/file.list
dali-toolkit/internal/filters/blur-two-pass-filter.cpp
dali-toolkit/internal/filters/blur-two-pass-filter.h
dali-toolkit/internal/filters/emboss-filter.cpp
dali-toolkit/internal/filters/emboss-filter.h
dali-toolkit/internal/filters/image-filter.cpp
dali-toolkit/internal/filters/image-filter.h
dali-toolkit/internal/filters/spread-filter.cpp
dali-toolkit/internal/filters/spread-filter.h
dali-toolkit/internal/image-loader/atlas-packer.cpp
dali-toolkit/internal/text/layouts/layout-engine.cpp
dali-toolkit/internal/text/text-controller.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.cpp
dali-toolkit/public-api/controls/scrollable/scroll-view/scroll-view-page-path-effect.h
dali-toolkit/public-api/dali-toolkit-version.cpp
dali-toolkit/third-party/file.list
packaging/dali-toolkit.spec

index 1754324..4037aac 100755 (executable)
@@ -41,11 +41,13 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-options.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-lifecycle-controller.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp
index 68bbd23..1c62f77 100644 (file)
@@ -22,6 +22,7 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-feedback-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-options.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-lifecycle-controller.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-native-image-source.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp
@@ -29,6 +30,7 @@ LIST(APPEND TC_SOURCES
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-sound-player.cpp
+   ../dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-text-abstraction.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
    ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
@@ -55,11 +57,6 @@ LIST(APPEND TC_SOURCES
 PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
   dali-core
   dali-toolkit
-  dali-adaptor
-)
-
-PKG_CHECK_MODULES(DALI_ADAPTOR REQUIRED
-  dali-adaptor
 )
 
 ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
index 3103f35..94d625d 100755 (executable)
@@ -1,5 +1,5 @@
  /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -88,7 +88,7 @@ Integration::Bitmap* CreateBitmap( unsigned int imageWidth, unsigned int imageHe
   return bitmap;
 }
 
-Integration::ResourcePointer CustomizeNinePatch( TestApplication& application,
+Integration::ResourcePointer CustomizeNinePatch( ToolkitTestApplication& application,
                                                  unsigned int ninePatchImageWidth,
                                                  unsigned int ninePatchImageHeight)
 {
@@ -119,7 +119,7 @@ int UtcDaliStyleManagerConstructorP(void)
 
 int UtcDaliStyleManagerCopyConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   StyleManager styleManager = StyleManager::Get();
   StyleManager copyOfStyleManager( styleManager );
@@ -130,7 +130,7 @@ int UtcDaliStyleManagerCopyConstructorP(void)
 
 int UtcDaliStyleManagerAssignmentOperatorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   StyleManager styleManager = StyleManager::Get();
   StyleManager copyOfStyleManager = styleManager;
index 084c2d5..dfbe07f 100644 (file)
@@ -12,22 +12,7 @@ SET(TC_SOURCES
 
 # Append list of test harness files (Won't get parsed for test cases)
 LIST(APPEND TC_SOURCES
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-accessibility-adaptor.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-application.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-clipboard-event-notifier.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-environment-variable.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-context.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-orientation.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-style-monitor.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-singleton-service.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-timer.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/toolkit-tts-player.cpp
    ../dali-toolkit/dali-toolkit-test-utils/dali-test-suite-utils.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
-   ../dali-toolkit/dali-toolkit-test-utils/dummy-control.cpp
    ../dali-toolkit/dali-toolkit-test-utils/mesh-builder.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-actor-utils.cpp
    ../dali-toolkit/dali-toolkit-test-utils/test-animation-data.cpp
@@ -51,8 +36,8 @@ PKG_CHECK_MODULES(${CAPI_LIB} REQUIRED
 )
 
 # Locate GTest
-cmake_minimum_required(VERSION 2.6)
-find_package(GTest REQUIRED)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+FIND_PACKAGE(GTest REQUIRED)
 
 #ADD_COMPILE_OPTIONS( -O0 -ggdb --coverage -Wall -Werror )
 # ADD_COMPILE_OPTIONS( ${${CAPI_LIB}_CFLAGS_OTHER} )
index 465e7f3..0ae564f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -17,7 +17,7 @@
 
 #include <cstdlib>
 
-#include <dali-toolkit-test-suite-utils.h>
+#include <dali-test-suite-utils.h>
 // GTest fails to compile with "error: return-statement with a value, in function returning 'void'" error
 // if using dali assert function so define new assert with returning void.
 #define _ASSERT_H_
index 91613bc..21eb07c 100755 (executable)
@@ -81,19 +81,21 @@ LIST(APPEND TC_SOURCES
   dali-toolkit-test-utils/toolkit-event-thread-callback.cpp
   dali-toolkit-test-utils/toolkit-environment-variable.cpp
   dali-toolkit-test-utils/toolkit-input-method-context.cpp
+  dali-toolkit-test-utils/toolkit-input-method-options.cpp
   dali-toolkit-test-utils/toolkit-lifecycle-controller.cpp
   dali-toolkit-test-utils/toolkit-orientation.cpp
   dali-toolkit-test-utils/toolkit-physical-keyboard.cpp
   dali-toolkit-test-utils/toolkit-style-monitor.cpp
   dali-toolkit-test-utils/toolkit-singleton-service.cpp
+  dali-toolkit-test-utils/toolkit-test-application.cpp
   dali-toolkit-test-utils/toolkit-timer.cpp
+  dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp
   dali-toolkit-test-utils/toolkit-tts-player.cpp
   dali-toolkit-test-utils/toolkit-native-image-source.cpp
   dali-toolkit-test-utils/toolkit-vector-animation-renderer.cpp
   dali-toolkit-test-utils/toolkit-video-player.cpp
   dali-toolkit-test-utils/toolkit-web-engine.cpp
   dali-toolkit-test-utils/toolkit-window.cpp
-  dali-toolkit-test-utils/toolkit-trigger-event-factory.cpp
   dali-toolkit-test-utils/dali-test-suite-utils.cpp
   dali-toolkit-test-utils/dali-toolkit-test-suite-utils.cpp
   dali-toolkit-test-utils/dummy-control.cpp
index 0b98b27..6e41c42 100644 (file)
@@ -26,7 +26,8 @@ TestApplication::TestApplication( uint32_t surfaceWidth,
                                   uint32_t surfaceHeight,
                                   uint32_t  horizontalDpi,
                                   uint32_t  verticalDpi,
-                                  ResourcePolicy::DataRetention policy)
+                                  ResourcePolicy::DataRetention policy,
+                                  bool initialize )
 : mCore( NULL ),
   mSurfaceWidth( surfaceWidth ),
   mSurfaceHeight( surfaceHeight ),
@@ -35,11 +36,21 @@ TestApplication::TestApplication( uint32_t surfaceWidth,
   mLastVSyncTime(0u),
   mDataRetentionPolicy( policy )
 {
-  Initialize();
+  if( initialize )
+  {
+    Initialize();
+  }
 }
 
 void TestApplication::Initialize()
 {
+  CreateCore();
+  CreateScene();
+  InitializeCore();
+}
+
+void TestApplication::CreateCore()
+{
   // We always need the first update!
   mStatus.keepUpdating = Integration::KeepUpdating::STAGE_KEEP_RENDERING;
 
@@ -47,6 +58,7 @@ void TestApplication::Initialize()
                                         mPlatformAbstraction,
                                         mGlAbstraction,
                                         mGlSyncAbstraction,
+                                        mGlContextHelperAbstraction,
                                         mDataRetentionPolicy,
                                         Integration::RenderToFrameBuffer::FALSE,
                                         Integration::DepthBufferAvailable::TRUE,
@@ -61,15 +73,20 @@ void TestApplication::Initialize()
   Dali::Integration::Trace::InstallLogContextFunction( logContextFunction );
 
   Dali::Integration::Trace::LogContext( true, "Test" );
+}
 
+void TestApplication::CreateScene()
+{
   mRenderSurface = new TestRenderSurface( Dali::PositionSize( 0, 0, mSurfaceWidth, mSurfaceHeight ) );
   mScene = Dali::Integration::Scene::New( Vector2( static_cast<float>( mSurfaceWidth ), static_cast<float>( mSurfaceHeight ) ) );
   mScene.SetSurface( *mRenderSurface );
-
   mScene.SetDpi( Vector2( static_cast<float>( mDpi.x ), static_cast<float>( mDpi.y ) ) );
 
   mCore->SurfaceResized( mRenderSurface );
+}
 
+void TestApplication::InitializeCore()
+{
   mCore->SceneCreated();
   mCore->Initialize();
 }
@@ -140,6 +157,11 @@ TestGlSyncAbstraction& TestApplication::GetGlSyncAbstraction()
   return mGlSyncAbstraction;
 }
 
+TestGlContextHelperAbstraction& TestApplication::GetGlContextHelperAbstraction()
+{
+  return mGlContextHelperAbstraction;
+}
+
 void TestApplication::ProcessEvent(const Integration::Event& event)
 {
   mCore->QueueEvent(event);
index 99cb1ce..cc694df 100644 (file)
@@ -22,6 +22,7 @@
 #include <test-platform-abstraction.h>
 #include "test-gl-sync-abstraction.h"
 #include "test-gl-abstraction.h"
+#include "test-gl-context-helper-abstraction.h"
 #include "test-render-controller.h"
 #include "test-render-surface.h"
 #include <dali/public-api/common/dali-common.h>
@@ -40,13 +41,8 @@ public:
   static const uint32_t DEFAULT_SURFACE_WIDTH = 480;
   static const uint32_t DEFAULT_SURFACE_HEIGHT = 800;
 
-#ifdef _CPP11
   static constexpr uint32_t DEFAULT_HORIZONTAL_DPI = 220;
   static constexpr uint32_t DEFAULT_VERTICAL_DPI   = 217;
-#else
-  static const uint32_t DEFAULT_HORIZONTAL_DPI = 220;
-  static const uint32_t DEFAULT_VERTICAL_DPI   = 217;
-#endif
 
   static const uint32_t DEFAULT_RENDER_INTERVAL = 1;
 
@@ -56,9 +52,13 @@ public:
                    uint32_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
                    uint32_t horizontalDpi = DEFAULT_HORIZONTAL_DPI,
                    uint32_t verticalDpi   = DEFAULT_VERTICAL_DPI,
-                   ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA);
+                   ResourcePolicy::DataRetention policy = ResourcePolicy::DALI_DISCARDS_ALL_DATA,
+                   bool initialize = true );
 
   void Initialize();
+  void CreateCore();
+  void CreateScene();
+  void InitializeCore();
   virtual ~TestApplication();
   static void LogMessage( Dali::Integration::Log::DebugPriority level, std::string& message );
   static void LogContext( bool start, const char* tag );
@@ -67,6 +67,7 @@ public:
   TestRenderController& GetRenderController();
   TestGlAbstraction& GetGlAbstraction();
   TestGlSyncAbstraction& GetGlSyncAbstraction();
+  TestGlContextHelperAbstraction& GetGlContextHelperAbstraction();
   void ProcessEvent(const Integration::Event& event);
   void SendNotification();
   bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
@@ -94,6 +95,7 @@ protected:
   TestRenderController      mRenderController;
   TestGlAbstraction         mGlAbstraction;
   TestGlSyncAbstraction     mGlSyncAbstraction;
+  TestGlContextHelperAbstraction mGlContextHelperAbstraction;
   TestRenderSurface*        mRenderSurface;
 
   Integration::UpdateStatus mStatus;
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-context-helper-abstraction.h
new file mode 100644 (file)
index 0000000..0442f0d
--- /dev/null
@@ -0,0 +1,71 @@
+#ifndef TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
+#define TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// INTERNAL INCLUDES
+#include <dali/integration-api/gl-context-helper-abstraction.h>
+
+namespace Dali
+{
+
+/**
+ * Class to emulate the GL context helper
+ */
+class DALI_CORE_API TestGlContextHelperAbstraction: public Integration::GlContextHelperAbstraction
+{
+public:
+  /**
+   * Constructor
+   */
+  TestGlContextHelperAbstraction() {};
+
+  /**
+   * Destructor
+   */
+  ~TestGlContextHelperAbstraction() {};
+
+  /**
+   * @brief Switch to the surfaceless GL context
+   */
+  virtual void MakeSurfacelessContextCurrent() {};
+
+  /**
+   * @brief Switch to the GL context of the specific render surface
+   * @param[in] surface The render surface
+   */
+  virtual void MakeContextCurrent( Integration::RenderSurface* surface ) {};
+
+  /**
+   * @brief Clear the GL context
+   */
+  virtual void MakeContextNull() {};
+
+  /**
+   * @brief Wait until all GL rendering calls for the current GL context are executed
+   */
+  virtual void WaitClient() {};
+private:
+
+  TestGlContextHelperAbstraction( const TestGlContextHelperAbstraction& ); ///< Undefined
+  TestGlContextHelperAbstraction& operator=( const TestGlContextHelperAbstraction& ); ///< Undefined
+};
+
+} // Dali
+
+#endif // TEST_GL_CONTEXT_HELPER_ABSTRACTION_H
index e49b358..dd7f469 100644 (file)
@@ -27,6 +27,11 @@ class DisplayConnection;
 class ThreadSynchronizationInterface;
 class Window;
 
+namespace Integration
+{
+class Scene;
+}
+
 using WindowContainer = std::vector<Window>;
 
 namespace Internal
@@ -53,22 +58,39 @@ namespace Internal
 namespace Adaptor
 {
 
-class Adaptor: public BaseObject
+class Adaptor
 {
 public:
+  static Dali::Adaptor& New();
   static Dali::Adaptor& Get();
   Adaptor();
   ~Adaptor();
 
-public:
-  static Dali::RenderSurfaceInterface& GetSurface();
-  static Dali::WindowContainer GetWindows();
-  static Dali::Adaptor::AdaptorSignalType& AdaptorSignal();
-  static Dali::Adaptor::WindowCreatedSignalType& WindowCreatedSignal();
-  static bool mAvailable;
-  static Vector<CallbackBase*> mCallbacks;
-  static Dali::WindowContainer mWindows;
-  static Dali::Adaptor::WindowCreatedSignalType* mWindowCreatedSignal;
+  void Start( Dali::Window window );
+
+  bool AddIdle( CallbackBase* callback, bool hasReturnValue );
+  void RemoveIdle( CallbackBase* callback );
+  void RunIdles();
+
+  static Integration::Scene GetScene( Dali::Window window );
+
+  Dali::RenderSurfaceInterface& GetSurface();
+  Dali::WindowContainer GetWindows();
+
+  Dali::Adaptor::AdaptorSignalType& ResizedSignal();
+  Dali::Adaptor::AdaptorSignalType& LanguageChangedSignal();
+  Dali::Adaptor::WindowCreatedSignalType& WindowCreatedSignal();
+
+  static Adaptor& GetImpl( Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
+  static const Adaptor& GetImpl( const Dali::Adaptor& adaptor ) { return *adaptor.mImpl; }
+
+private:
+
+  Vector<CallbackBase*> mCallbacks;
+  Dali::WindowContainer mWindows;
+  Dali::Adaptor::AdaptorSignalType mResizedSignal;
+  Dali::Adaptor::AdaptorSignalType mLanguageChangedSignal;
+  Dali::Adaptor::WindowCreatedSignalType mWindowCreatedSignal;
 };
 
 } // namespace Adaptor
index 6507583..63bacde 100644 (file)
@@ -15,6 +15,8 @@
  *
  */
 
+#include <algorithm>
+
 #include <toolkit-window.h>
 
 // Don't want to include the actual window.h which otherwise will be indirectly included by adaptor.h.
 
 #include <dali/integration-api/adaptors/scene-holder.h>
 
-#include <dali/public-api/object/base-object.h>
-
 #include <toolkit-adaptor-impl.h>
 #include <dali/integration-api/debug.h>
+#include <dali/integration-api/scene.h>
 #include <test-application.h>
 #include <test-render-surface.h>
 
 namespace Dali
 {
 
+namespace
+{
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// LogFactoryStub
+//
+///////////////////////////////////////////////////////////////////////////////
+
+class LogFactory : public LogFactoryInterface
+{
+public:
+  LogFactory() = default;
+  virtual ~LogFactory() = default;
+
+private:
+  void InstallLogFunction() const override
+  {
+    Dali::Integration::Log::InstallLogFunction( &TestApplication::LogMessage );
+  }
+};
+LogFactory* gLogFactory = NULL; // For some reason, destroying this when the Adaptor is destroyed causes a crash in some test cases when running all of them.
+} //unnamed namespace
+
 namespace Internal
 {
 namespace Adaptor
 {
 
-bool Adaptor::mAvailable = false;
-Vector<CallbackBase*> Adaptor::mCallbacks = Vector<CallbackBase*>();
-Dali::WindowContainer Adaptor::mWindows;
-Dali::Adaptor::WindowCreatedSignalType* Adaptor::mWindowCreatedSignal = nullptr;
+///////////////////////////////////////////////////////////////////////////////
+//
+// Dali::Internal::Adaptor::Adaptor Stub
+//
+///////////////////////////////////////////////////////////////////////////////
 
-Dali::Adaptor& Adaptor::Get()
+Dali::Adaptor* gAdaptor = nullptr;
+
+Dali::Adaptor& Adaptor::New()
 {
-  Dali::Adaptor* adaptor = new Dali::Adaptor;
-  Adaptor::mAvailable = true;
-  return *adaptor;
+  DALI_ASSERT_ALWAYS( ! gAdaptor );
+  gAdaptor = new Dali::Adaptor;
+  return *gAdaptor;
 }
 
-Dali::RenderSurfaceInterface& Adaptor::GetSurface()
+Dali::Adaptor& Adaptor::Get()
 {
-  Dali::RenderSurfaceInterface* renderSurface = reinterpret_cast <Dali::RenderSurfaceInterface*>( new Dali::TestRenderSurface( Dali::PositionSize( 0, 0, 480, 800 ) ) );
-  return *renderSurface;
+  DALI_ASSERT_ALWAYS( gAdaptor );
+  return *gAdaptor;
 }
 
-Dali::WindowContainer Adaptor::GetWindows()
+Adaptor::Adaptor()
 {
-  return Adaptor::mWindows;
 }
 
-Dali::Adaptor::AdaptorSignalType& Adaptor::AdaptorSignal()
+Adaptor::~Adaptor()
 {
-  Dali::Adaptor::AdaptorSignalType* signal = new Dali::Adaptor::AdaptorSignalType;
-  return *signal;
+  gAdaptor = nullptr;
 }
 
-Dali::Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
+void Adaptor::Start( Dali::Window window )
 {
-  if ( !Adaptor::mWindowCreatedSignal )
+  if ( window )
   {
-    Adaptor::mWindowCreatedSignal = new Dali::Adaptor::WindowCreatedSignalType;
+    mWindows.push_back( window );
+    mWindowCreatedSignal.Emit( window );
   }
+}
 
-  return *Adaptor::mWindowCreatedSignal;
+Integration::Scene Adaptor::GetScene( Dali::Window window )
+{
+  return window.GetScene();
 }
 
-} // namespace Adaptor
-} // namespace Internal
+bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
+{
+  mCallbacks.PushBack( callback );
+  return true;
+}
 
-Adaptor& Adaptor::New( Window window )
+void Adaptor::RemoveIdle( CallbackBase* callback )
 {
-  return Internal::Adaptor::Adaptor::Get();
+  mCallbacks.Erase( std::find_if( mCallbacks.Begin(), mCallbacks.End(),
+                                  [ &callback ] ( CallbackBase* current ) { return callback == current; } ) );
 }
 
-Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
+void Adaptor::RunIdles()
 {
-  return Internal::Adaptor::Adaptor::Get();
+  for( auto& callback : mCallbacks )
+  {
+    CallbackBase::Execute( *callback );
+  }
+
+  mCallbacks.Clear();
 }
 
-Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface )
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
-  return Internal::Adaptor::Adaptor::Get();
+  DALI_ASSERT_ALWAYS( ! mWindows.empty() );
+
+  return reinterpret_cast < Dali::RenderSurfaceInterface& >( mWindows.front().GetRenderSurface() );
 }
 
-Adaptor& Adaptor::New( Window window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
+Dali::WindowContainer Adaptor::GetWindows()
 {
-  return Internal::Adaptor::Adaptor::Get();
+  return mWindows;
 }
 
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window )
+Dali::Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
 {
-  return Internal::Adaptor::Adaptor::Get();
+  return mResizedSignal;
 }
 
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, Configuration::ContextLoss configuration )
+Dali::Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
 {
-  return Internal::Adaptor::Adaptor::Get();
+  return mLanguageChangedSignal;
 }
 
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface )
+Dali::Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
 {
-  return Internal::Adaptor::Adaptor::Get();
+  return mWindowCreatedSignal;
 }
 
-Adaptor& Adaptor::New( Dali::Integration::SceneHolder window, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
+} // namespace Adaptor
+} // namespace Internal
+
+///////////////////////////////////////////////////////////////////////////////
+//
+// Dali::Adaptor Stub
+//
+///////////////////////////////////////////////////////////////////////////////
+
+Adaptor::Adaptor()
+: mImpl( new Internal::Adaptor::Adaptor )
 {
-  return Internal::Adaptor::Adaptor::Get();
 }
 
 Adaptor::~Adaptor()
 {
+  Internal::Adaptor::gAdaptor = nullptr;
+  delete mImpl;
 }
 
 void Adaptor::Start()
@@ -142,34 +194,12 @@ void Adaptor::Stop()
 
 bool Adaptor::AddIdle( CallbackBase* callback, bool hasReturnValue )
 {
-  const bool isAvailable = IsAvailable();
-
-  if( isAvailable )
-  {
-    Internal::Adaptor::Adaptor::mCallbacks.PushBack( callback );
-  }
-
-  return isAvailable;
+  return mImpl->AddIdle( callback, hasReturnValue );
 }
 
 void Adaptor::RemoveIdle( CallbackBase* callback )
 {
-  const bool isAvailable = IsAvailable();
-
-  if( isAvailable )
-  {
-    for( Vector<CallbackBase*>::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(),
-           endIt = Internal::Adaptor::Adaptor::mCallbacks.End();
-         it != endIt;
-         ++it )
-    {
-      if( callback == *it )
-      {
-        Internal::Adaptor::Adaptor::mCallbacks.Remove( it );
-        return;
-      }
-    }
-  }
+  mImpl->RemoveIdle( callback );
 }
 
 void Adaptor::ReplaceSurface( Window window, Dali::RenderSurfaceInterface& surface )
@@ -182,27 +212,27 @@ void Adaptor::ReplaceSurface( Dali::Integration::SceneHolder window, Dali::Rende
 
 Adaptor::AdaptorSignalType& Adaptor::ResizedSignal()
 {
-  return Internal::Adaptor::Adaptor::AdaptorSignal();
+  return mImpl->ResizedSignal();
 }
 
 Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
 {
-  return Internal::Adaptor::Adaptor::AdaptorSignal();
+  return mImpl->LanguageChangedSignal();
 }
 
 Adaptor::WindowCreatedSignalType& Adaptor::WindowCreatedSignal()
 {
-  return Internal::Adaptor::Adaptor::WindowCreatedSignal();
+  return mImpl->WindowCreatedSignal();
 }
 
 Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
-  return Internal::Adaptor::Adaptor::GetSurface();
+  return mImpl->GetSurface();
 }
 
 Dali::WindowContainer Adaptor::GetWindows() const
 {
-  return Internal::Adaptor::Adaptor::GetWindows();
+  return mImpl->GetWindows();
 }
 
 Any Adaptor::GetNativeWindowHandle()
@@ -226,7 +256,7 @@ Adaptor& Adaptor::Get()
 
 bool Adaptor::IsAvailable()
 {
-  return Internal::Adaptor::Adaptor::mAvailable;
+  return Internal::Adaptor::gAdaptor;
 }
 
 void Adaptor::NotifySceneCreated()
@@ -253,24 +283,6 @@ void Adaptor::SceneCreated()
 {
 }
 
-class LogFactory : public LogFactoryInterface
-{
-public:
-  virtual void InstallLogFunction() const
-  {
-    Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
-    Dali::Integration::Log::InstallLogFunction(logFunction);
-  }
-
-  LogFactory()
-  {
-  }
-  virtual ~LogFactory()
-  {
-  }
-};
-
-LogFactory* gLogFactory = NULL;
 const LogFactoryInterface& Adaptor::GetLogFactory()
 {
   if( gLogFactory == NULL )
@@ -280,15 +292,4 @@ const LogFactoryInterface& Adaptor::GetLogFactory()
   return *gLogFactory;
 }
 
-Adaptor::Adaptor()
-: mImpl( NULL )
-{
-  Dali::PositionSize win_size;
-  win_size.width = 640;
-  win_size.height = 800;
-
-  Dali::Window window = Dali::Window::New( win_size, "" );
-  Internal::Adaptor::Adaptor::mWindows.push_back( window );
-}
-
 } // namespace Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-options.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-input-method-options.cpp
new file mode 100644 (file)
index 0000000..b306e7e
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+/**
+ * This is a copy of dali-adaptor/devel-api/adaptor-framework/input-method-options.cpp.
+ */
+
+// CLASS HEADER
+#include <dali/devel-api/adaptor-framework/input-method-options.h>
+
+using namespace Dali::InputMethod;
+using namespace Dali::InputMethod::Category;
+
+namespace Dali
+{
+
+#define TOKEN_STRING(x) #x
+
+struct InputMethodOptions::Impl
+{
+  Impl()
+  {
+    mPanelLayout = PanelLayout::NORMAL;
+    mAutoCapital = AutoCapital::SENTENCE;
+    mButtonAction = ButtonAction::DEFAULT;
+    mVariation = NormalLayout::NORMAL;
+  }
+
+  PanelLayout::Type mPanelLayout;
+  AutoCapital::Type mAutoCapital;
+  ButtonAction::Type mButtonAction;
+  int mVariation:4;
+};
+
+InputMethodOptions::InputMethodOptions()
+{
+  mImpl.reset(new Impl());
+}
+
+InputMethodOptions::~InputMethodOptions()
+{
+  // destructor cannot be inlined and must be in a unit
+  // for unique_ptr to work with forward declaration
+}
+
+bool InputMethodOptions::IsPassword() const
+{
+  return (mImpl->mPanelLayout == Dali::InputMethod::PanelLayout::PASSWORD);
+}
+
+void InputMethodOptions::ApplyProperty( const Property::Map& settings )
+{
+  for ( unsigned int i = 0, count = settings.Count(); i < count; ++i )
+  {
+    Property::Key key = settings.GetKeyAt( i );
+    if( key.type == Property::Key::INDEX )
+    {
+      continue;
+    }
+
+    Property::Value item = settings.GetValue(i);
+
+    if( key == TOKEN_STRING( PANEL_LAYOUT ) )
+    {
+      if( item.GetType() == Property::INTEGER )
+      {
+        int value = item.Get< int >();
+        mImpl->mPanelLayout = static_cast<InputMethod::PanelLayout::Type>(value);
+      }
+    }
+    else if ( key == TOKEN_STRING( BUTTON_ACTION ) )
+    {
+      if ( item.GetType() == Property::INTEGER )
+      {
+        int value = item.Get< int >();
+        mImpl->mButtonAction = static_cast<InputMethod::ButtonAction::Type>(value);
+      }
+    }
+    else if ( key == TOKEN_STRING( AUTO_CAPITALIZE ) )
+    {
+      if ( item.GetType() == Property::INTEGER )
+      {
+        int value = item.Get< int >();
+        mImpl->mAutoCapital = static_cast<InputMethod::AutoCapital::Type>(value);
+      }
+    }
+    else if( key == TOKEN_STRING( VARIATION ) )
+    {
+      if( item.GetType() == Property::INTEGER )
+      {
+        int value = item.Get< int >();
+        mImpl->mVariation = value;
+      }
+    }
+    else
+    {
+    }
+  }
+}
+
+void InputMethodOptions::RetrieveProperty( Property::Map& settings )
+{
+  settings[TOKEN_STRING( PANEL_LAYOUT )] = mImpl->mPanelLayout;
+  settings[TOKEN_STRING( BUTTON_ACTION )] = mImpl->mButtonAction;
+  settings[TOKEN_STRING( AUTO_CAPITALIZE )] = mImpl->mAutoCapital;
+  settings[TOKEN_STRING( VARIATION )] = mImpl->mVariation;
+}
+
+bool InputMethodOptions::CompareAndSet( InputMethod::Category::Type type, const InputMethodOptions& options, int& index)
+{
+  return true;
+  bool updated = false;
+
+  switch (type)
+  {
+    case PANEL_LAYOUT:
+    {
+      if ( options.mImpl->mPanelLayout != mImpl->mPanelLayout )
+      {
+        mImpl->mPanelLayout = options.mImpl->mPanelLayout;
+        index = static_cast<int>(mImpl->mPanelLayout);
+        updated = true;
+      }
+      break;
+    }
+    case BUTTON_ACTION:
+    {
+      if ( options.mImpl->mButtonAction != mImpl->mButtonAction )
+      {
+        mImpl->mButtonAction = options.mImpl->mButtonAction;
+        index = static_cast<int>(mImpl->mButtonAction);
+        updated = true;
+      }
+      break;
+    }
+    case AUTO_CAPITALIZE:
+    {
+      if ( options.mImpl->mAutoCapital != mImpl->mAutoCapital )
+      {
+        mImpl->mAutoCapital = options.mImpl->mAutoCapital;
+        index = static_cast<int>(mImpl->mAutoCapital);
+        updated = true;
+      }
+      break;
+    }
+    case VARIATION:
+    {
+      if ( options.mImpl->mVariation != mImpl->mVariation )
+      {
+        mImpl->mVariation = options.mImpl->mVariation;
+        index = static_cast<int>(mImpl->mVariation);
+        updated = true;
+      }
+      break;
+    }
+  }
+  return updated;
+}
+
+} // namespace Dali
diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/toolkit-test-application.cpp
new file mode 100644 (file)
index 0000000..53cd1d9
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+// CLASS HEADER
+#include <toolkit-test-application.h>
+
+// INTERNAL INCLUDES
+#include <dali-test-suite-utils.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
+#include <dali/integration-api/adaptors/adaptor.h>
+#include <toolkit-adaptor-impl.h>
+#include <toolkit-singleton-service.h>
+#include <toolkit-lifecycle-controller.h>
+
+namespace Dali
+{
+
+using AdaptorImpl = Dali::Internal::Adaptor::Adaptor;
+
+ToolkitTestApplication::ToolkitTestApplication( size_t surfaceWidth, size_t surfaceHeight, float  horizontalDpi, float verticalDpi )
+: TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi, ResourcePolicy::DALI_DISCARDS_ALL_DATA, false /* Do not Initialize Core */ ),
+  mAdaptor( &AdaptorImpl::New() ) // Need to create Adaptor first as many singletons in dali-adaptor need it
+{
+  // Create Core next
+  CreateCore();
+
+  // Override Scene creation in TestApplication by creating a window.
+  // The window will create a Scene & surface and set up the scene's surface appropriately.
+  Window window( Window::New( PositionSize( 0, 0, surfaceWidth, surfaceHeight ), "" ) );
+  mScene = AdaptorImpl::GetScene( window );
+  mRenderSurface = dynamic_cast< TestRenderSurface* >( mScene.GetSurface() );
+  mScene.SetDpi( Vector2( horizontalDpi, verticalDpi ) );
+
+  // Core needs to be initialized next before we start the adaptor
+  InitializeCore();
+
+  auto singletonService = SingletonService::Get();
+  Test::SetApplication( singletonService, *this );
+
+  // This will also emit the window created signals
+  AdaptorImpl::GetImpl( *mAdaptor ).Start( window );
+
+  Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
+  lifecycleController.InitSignal().Emit();
+
+  // set the DPI value for font rendering
+  TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
+  if( fontClient )
+  {
+    fontClient.SetDpi( mDpi.x, mDpi.y );
+  }
+}
+
+ToolkitTestApplication::~ToolkitTestApplication()
+{
+  // Need to delete core before we delete the adaptor.
+  delete mCore;
+  mCore = NULL;
+
+  // Set mRenderSurface to null, it will be deleted by the window that owns it
+  mRenderSurface = nullptr;
+}
+
+void ToolkitTestApplication::RunIdles()
+{
+  AdaptorImpl::GetImpl( *mAdaptor.get() ).RunIdles();
+}
+
+} // namespace Dali
index de2d0c4..a984a37 100644 (file)
  *
  */
 
+// EXTERNAL INCLUDES
+#include <memory>
+
 // INTERNAL INCLUDES
 #include <dali-test-suite-utils.h>
-#include <dali/devel-api/text-abstraction/font-client.h>
-#include <dali/integration-api/adaptors/adaptor.h>
-#include <toolkit-adaptor-impl.h>
-#include <toolkit-singleton-service.h>
-#include <toolkit-lifecycle-controller.h>
 
 namespace Dali
 {
 
+class Adaptor;
+
 /**
  * Adds some functionality on top of TestApplication that is required by the Toolkit.
+ *
+ * This includes creation and destruction of the Adaptor and Window classes.
  */
 class ToolkitTestApplication : public TestApplication
 {
@@ -39,53 +41,9 @@ public:
   ToolkitTestApplication( size_t surfaceWidth  = DEFAULT_SURFACE_WIDTH,
                           size_t surfaceHeight = DEFAULT_SURFACE_HEIGHT,
                           float  horizontalDpi = DEFAULT_HORIZONTAL_DPI,
-                          float  verticalDpi   = DEFAULT_VERTICAL_DPI )
-  : TestApplication( surfaceWidth, surfaceHeight, horizontalDpi, verticalDpi )
-  {
-    auto singletonService = SingletonService::Get();
-    Test::SetApplication( singletonService, *this );
-
-    // set the DPI value for font rendering
-    Dali::TextAbstraction::FontClient fontClient = Dali::TextAbstraction::FontClient::Get();
-    if( fontClient )
-    {
-      fontClient.SetDpi( mDpi.x, mDpi.y );
-    }
-
-    bool isAdaptorAvailable = Dali::Internal::Adaptor::Adaptor::Get().IsAvailable();
-    if ( isAdaptorAvailable )
-    {
-      Dali::LifecycleController lifecycleController = Dali::LifecycleController::Get();
-      lifecycleController.InitSignal().Emit();
-
-      Dali::Window window = Dali::Internal::Adaptor::Adaptor::mWindows.front();
-      if ( window )
-      {
-        Dali::Internal::Adaptor::Adaptor::WindowCreatedSignal().Emit( window );
-      }
-    }
-  }
+                          float  verticalDpi   = DEFAULT_VERTICAL_DPI );
 
-  ~ToolkitTestApplication()
-  {
-    // Need to delete core before we delete the adaptor.
-    delete mCore;
-    mCore = NULL;
-  }
-
-  //ToolkitOrientation& GetOrientation()
-  //{
-  //return mOrientation;
-  //}
-
-  /**
-   * @brief Creates an adaptor implementation for those controls like the
-   * text-field and the text-editor which connects a callback to the idle signal.
-   */
-  void CreateAdaptor()
-  {
-    Adaptor::Get();
-  }
+  ~ToolkitTestApplication();
 
   /**
    * @brief Executes the idle callbacks.
@@ -93,26 +51,10 @@ public:
    * Some controls like the text-field and the text-editor connect callbacks to the
    * idle signal.
    */
-  void RunIdles()
-  {
-    if( Adaptor::IsAvailable() )
-    {
-      for( Vector<CallbackBase*>::Iterator it = Internal::Adaptor::Adaptor::mCallbacks.Begin(),
-             endIt = Internal::Adaptor::Adaptor::mCallbacks.End();
-           it != endIt;
-           ++it )
-      {
-        CallbackBase* callback = *it;
-
-        CallbackBase::Execute( *callback );
-      }
-
-      Internal::Adaptor::Adaptor::mCallbacks.Clear();
-    }
-  }
+  void RunIdles();
 
 private:
-  //ToolkitOrientation mOrientation;
+  std::unique_ptr< Adaptor > mAdaptor;
 };
 
 } // namespace Dali
index 05c4836..1b8cdbd 100644 (file)
@@ -15,6 +15,9 @@
  *
  */
 
+// CLASS HEADER
+#include "toolkit-window.h"
+
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/actor.h>
 #include <dali/public-api/actors/layer.h>
@@ -22,7 +25,7 @@
 #include <dali/public-api/object/base-object.h>
 
 // INTERNAL INCLUDES
-#include "toolkit-window.h"
+#include "test-render-surface.h"
 
 namespace Dali
 {
@@ -37,33 +40,42 @@ namespace Internal
 {
 namespace Adaptor
 {
-
 class Window : public Dali::BaseObject
 {
 public:
 
-  Window()
+  Window( const PositionSize& positionSize )
+  : mScene( Dali::Integration::Scene::New( Size( positionSize.width, positionSize.height ) ) ),
+    mRenderSurface( new TestRenderSurface( positionSize ) )
   {
+    mScene.SetSurface( *mRenderSurface );
   }
 
   virtual ~Window()
   {
+    delete mRenderSurface;
+    mRenderSurface = nullptr;
   }
 
   static Window* New(const PositionSize& positionSize, const std::string& name, const std::string& className, bool isTransparent)
   {
-    return new Window();
+    return new Window( positionSize );
   }
 
-  static Dali::Window Get( Dali::Actor actor )
-  {
-    return Dali::Window();
-  }
+  Integration::Scene mScene;
+  TestRenderSurface* mRenderSurface;
 };
 
 } // Adaptor
 } // Internal
 
+inline Internal::Adaptor::Window& GetImplementation(Dali::Window& window)
+{
+  DALI_ASSERT_ALWAYS( window && "Window handle is empty" );
+  BaseObject& object = window.GetBaseObject();
+  return static_cast<Internal::Adaptor::Window&>(object);
+}
+
 Window::Window()
 {
 }
@@ -72,6 +84,17 @@ Window::~Window()
 {
 }
 
+Window::Window(const Window& handle)
+: BaseHandle( handle )
+{
+}
+
+Window& Window::operator=(const Window& rhs)
+{
+  BaseHandle::operator=(rhs);
+  return *this;
+}
+
 Dali::Window Window::New( PositionSize windowPosition, const std::string& name, bool isTransparent )
 {
   Internal::Adaptor::Window* window = Internal::Adaptor::Window::New( windowPosition, name, "", isTransparent );
@@ -94,22 +117,42 @@ Window::Window( Internal::Adaptor::Window* window )
 {
 }
 
+Integration::Scene Window::GetScene()
+{
+  return GetImplementation( *this ).mScene;
+}
+
+Integration::RenderSurface& Window::GetRenderSurface()
+{
+  return *GetImplementation( *this ).mRenderSurface;
+}
+
 namespace DevelWindow
 {
 
 Window Get( Actor actor )
 {
-  return Internal::Adaptor::Window::Get( actor );
+  return Window();
+}
+
+EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window )
+{
+  return GetImplementation( window ).mScene.EventProcessingFinishedSignal();
 }
 
 KeyEventSignalType& KeyEventSignal( Window window )
 {
-  return Dali::Stage::GetCurrent().KeyEventSignal();
+  return GetImplementation( window ).mScene.KeyEventSignal();
 }
 
 TouchSignalType& TouchSignal( Window window )
 {
-  return Dali::Stage::GetCurrent().TouchSignal();
+  return GetImplementation( window ).mScene.TouchSignal();
+}
+
+WheelEventSignalType& WheelEventSignal( Window window )
+{
+  return GetImplementation( window ).mScene.WheelEventSignal();
 }
 
 } // namespace DevelWindow
index 4c95ad7..c830af5 100644 (file)
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/signals/dali-signal.h>
+#include <dali/integration-api/scene.h>
 
 namespace Dali
 {
 
 class Actor;
 class Layer;
-class KeyEvent;
+struct KeyEvent;
 class TouchData;
+struct WheelEvent;
 
 typedef Dali::Rect<int> PositionSize;
 
@@ -48,25 +50,33 @@ public:
 
   static Window New(PositionSize windowPosition, const std::string& name, bool isTransparent = false);
   static Window New(PositionSize windowPosition, const std::string& name, const std::string& className, bool isTransparent = false);
+
   Window();
   ~Window();
   Window(const Window& handle);
   Window& operator=(const Window& rhs);
   Layer GetRootLayer() const;
 
+  Integration::Scene GetScene();
+  Integration::RenderSurface& GetRenderSurface();
+
 public:
   explicit Window( Internal::Adaptor::Window* window );
 };
 
 namespace DevelWindow
 {
-
+typedef Signal< void () > EventProcessingFinishedSignalType;
 typedef Signal< void (const KeyEvent&) > KeyEventSignalType;
 typedef Signal< void (const TouchData&) > TouchSignalType;
+typedef Signal< void (const WheelEvent&) > WheelEventSignalType;
 
 Dali::Window Get( Actor actor );
+
+EventProcessingFinishedSignalType& EventProcessingFinishedSignal( Window window );
 KeyEventSignalType& KeyEventSignal( Dali::Window window );
 TouchSignalType& TouchSignal( Dali::Window window );
+WheelEventSignalType& WheelEventSignal( Window window );
 
 }
 
index 6e99e48..ac4bcde 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -141,6 +141,8 @@ int UtcDaliAsyncImageLoaderAssignmentOperator(void)
 
 int UtcDaliAsyncImageLoaderDownCastP(void)
 {
+  ToolkitTestApplication application;
+
   AsyncImageLoader asyncImageLoader = AsyncImageLoader::New();
   BaseHandle object(asyncImageLoader);
 
@@ -153,6 +155,8 @@ int UtcDaliAsyncImageLoaderDownCastP(void)
 
 int UtcDaliAsyncImageLoaderDownCastN(void)
 {
+  ToolkitTestApplication application;
+
   BaseHandle unInitializedObject;
   AsyncImageLoader asyncImageLoader = AsyncImageLoader::DownCast( unInitializedObject );
 
index 4d8bfe0..41c7153 100644 (file)
@@ -1204,126 +1204,6 @@ int UtcDaliBuilderAddActorsP(void)
   END_TEST;
 }
 
-int UtcDaliBuilderFrameBufferP(void)
-{
-  ToolkitTestApplication application;
-
-  // JSON with a quit event when the actor is touched
-  std::string json(
-    "{\n"
-    "  \"constants\":\n"
-    "  {\n"
-    "    \"FB_WIDTH\": 200.0,\n"
-    "    \"FB_HEIGHT\": 200.0,\n"
-    "    \"FB_SIZE\": [200,200],\n"
-    "    \"FB_ASPECT_RATIO\": 1\n"
-    "  },\n"
-    "  \"stage\": [\n"
-    "    {\n"
-    "      \"type\": \"ImageView\",\n"
-    "      \"name\": \"fbOnStage\",\n"
-    "      \"position\": [\n"
-    "        0.40461349487305,\n"
-    "        0.9150390625,\n"
-    "        0.0\n"
-    "      ],\n"
-    "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
-    "      \"size\": [300, 300, 0],\n"
-    "      \"image\": \"fb0\",\n"
-    "      \"clearColor\": [1,0,0,1]\n"
-    "    },\n"
-    "    {\n"
-    "      \"type\": \"ImageView\",\n"
-    "      \"name\": \"Image1\",\n"
-    "      \"size\": [200, 200, 0],\n"
-    "      \"parentOrigin\": [0.5, 0.5, 0.5],\n"
-    "      \"effect\": \"Ripple2D\",\n"
-    "      \"image\": {\n"
-    "        \"url\": \"{DALI_IMAGE_DIR}gallery-medium-25.jpg\"\n"
-    "      },\n"
-    "      \"signals\": [\n"
-    "        {\n"
-    "          \"name\": \"onStage\",\n"
-    "          \"action\": \"play\",\n"
-    "          \"animation\": \"Animation_1\"\n"
-    "        }\n"
-    "      ]\n"
-    "    },\n"
-    "    {\n"
-    "      \"type\":\"CameraActor\",\n"
-    "      \"name\":\"fbCam\",\n"
-    "      \"aspectRatio\": \"{FB_ASPECT_RATIO}\",\n"
-    "      \"projectionMode\": \"PERSPECTIVE_PROJECTION\",\n"
-    "      \"fieldOfView\": 0.785,\n"
-    "      \"invertYAxis\": true\n"
-    "    }\n"
-    "  ],\n"
-    "  \"frameBufferImages\":\n"
-    "  {\n"
-    "    \"fb0\":\n"
-    "    {\n"
-    "      \"type\": \"FrameBufferImage\",\n"
-    "      \"width\": { \"typeCast\":\"float\", \"value\":\"{FB_WIDTH}\" },\n"
-    "      \"height\": { \"typeCast\":\"float\", \"value\":\"{FB_HEIGHT}\" }\n"
-    "    }\n"
-    "  },\n"
-    "  \"renderTasks\":\n"
-    "  {\n"
-    "    \"stage\":\n"
-    "    [\n"
-    "      {\n"
-    "        \"sourceActor\": \"fbOnStage\"\n"
-    "      },\n"
-    "      {\n"
-    "        \"sourceActor\": \"Image1\",\n"
-    "        \"targetFrameBuffer\": \"fb0\",\n"
-    "        \"viewportSize\":\"{FB_SIZE}\",\n"
-    "        \"cameraActor\":\"fbCam\"\n"
-    "      }\n"
-    "    ]\n"
-    "  },\n"
-    "  \"paths\": {},\n"
-    "  \"animations\": {\n"
-    "    \"Animation_1\": {\n"
-    "      \"loop\":true,\n"
-    "      \"properties\": [\n"
-    "        {\n"
-    "          \"actor\": \"Image1\",\n"
-    "          \"property\": \"uTime\",\n"
-    "          \"value\": 10.0,\n"
-    "          \"alphaFunction\": \"LINEAR\",\n"
-    "          \"timePeriod\": {\n"
-    "            \"delay\": 0,\n"
-    "            \"duration\": 10.0\n"
-    "          },\n"
-    "          \"gui-builder-timeline-color\": \"#8dc0da\"\n"
-    "        }\n"
-    "      ]\n"
-    "    }\n"
-    "  }\n"
-    "}\n");
-
-  Builder builder = Builder::New();
-
-  // frame buffer coverage
-  builder.LoadFromString( json );
-
-  // Render and notify
-  application.SendNotification();
-  application.Render();
-
-  Dali::FrameBufferImage frameBuffer = builder.GetFrameBufferImage( "fb0" );
-  DALI_TEST_CHECK( frameBuffer );
-
-  Dali::FrameBufferImage frameBuffer2 = builder.GetFrameBufferImage( "fb0" );
-  DALI_TEST_CHECK( frameBuffer2 );
-  DALI_TEST_CHECK( frameBuffer == frameBuffer2 );
-
-  DALI_TEST_CHECK( true );
-
-  END_TEST;
-}
-
 int UtcDaliBuilderPathConstraintsP(void)
 {
   ToolkitTestApplication application;
index 1544a60..83c9595 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -70,7 +70,7 @@ void checkbox_button_cleanup(void)
 
 int UtcDaliCheckBoxButtonConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   CheckBoxButton checkBox;
 
@@ -80,7 +80,7 @@ int UtcDaliCheckBoxButtonConstructorP(void)
 
 int UtcDaliCheckBoxButtonCopyConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   // Initialize an object, ref count == 1
   CheckBoxButton checkBox = CheckBoxButton::New();
@@ -92,7 +92,7 @@ int UtcDaliCheckBoxButtonCopyConstructorP(void)
 
 int UtcDaliCheckBoxButtonAssignmentOperatorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   CheckBoxButton checkBox = CheckBoxButton::New();
 
@@ -105,7 +105,7 @@ int UtcDaliCheckBoxButtonAssignmentOperatorP(void)
 
 int UtcDaliCheckBoxButtonNewP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   CheckBoxButton checkBox = CheckBoxButton::New();
 
@@ -115,7 +115,7 @@ int UtcDaliCheckBoxButtonNewP(void)
 
 int UtcDaliCheckBoxButtonDownCastP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   CheckBoxButton checkBox = CheckBoxButton::New();
 
@@ -131,7 +131,7 @@ int UtcDaliCheckBoxButtonDownCastP(void)
 
 int UtcDaliCheckBoxButtonDownCastN(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   BaseHandle unInitializedObject;
 
@@ -173,7 +173,7 @@ int UtcDaliCheckBoxButtonSelectedPropertyP(void)
 
 int UtcDaliCheckBoxSetLabelP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   CheckBoxButton checkBox = CheckBoxButton::New();
 
@@ -191,7 +191,7 @@ int UtcDaliCheckBoxSetLabelP(void)
 
 int UtcDaliCheckBoxSetDisabledPropertyP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   CheckBoxButton checkBox = CheckBoxButton::New();
   Stage::GetCurrent().Add( checkBox );
@@ -362,7 +362,7 @@ int UtcDaliCheckBoxButtonSetGetSelected(void)
 
 int UtcDaliCheckBoxSetLabelDisabledP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   CheckBoxButton checkBox = CheckBoxButton::New();
   Stage::GetCurrent().Add( checkBox );
@@ -386,4 +386,4 @@ int UtcDaliCheckBoxSetLabelDisabledP(void)
   DALI_TEST_EQUALS( checkBox.GetLabelText(), "activate", TEST_LOCATION );
 
   END_TEST;
-}
\ No newline at end of file
+}
index e1282ad..17686c1 100755 (executable)
@@ -266,7 +266,7 @@ int UtcDaliDragAndDropDetectorGetAttachedControlP(void)
 
 int UtcDaliDragAndDropDetectorStartSignal(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
   Control control = Control::New();
@@ -297,7 +297,7 @@ int UtcDaliDragAndDropDetectorStartSignal(void)
 
 int UtcDaliDragAndDropDetectorEnteredSignal(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
   Control control1 = Control::New();
@@ -340,7 +340,7 @@ int UtcDaliDragAndDropDetectorEnteredSignal(void)
 
 int UtcDaliDragAndDropDetectorMovedSignal(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
   Control control1 = Control::New();
@@ -387,7 +387,7 @@ int UtcDaliDragAndDropDetectorMovedSignal(void)
 
 int UtcDaliDragAndDropDetectorExitedSignal(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
   Control control1 = Control::New();
@@ -435,7 +435,7 @@ int UtcDaliDragAndDropDetectorExitedSignal(void)
 
 int UtcDaliDragAndDropDetectorDroppedSignal(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
   Control control1 = Control::New();
@@ -483,7 +483,7 @@ int UtcDaliDragAndDropDetectorDroppedSignal(void)
 
 int UtcDaliDragAndDropDetectorEndedSignal(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
   Control control1 = Control::New();
@@ -523,7 +523,7 @@ int UtcDaliDragAndDropDetectorEndedSignal(void)
 
 int UtcDaliDragAndDropDetectorGetContent(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Dali::Toolkit::DragAndDropDetector detector = Dali::Toolkit::DragAndDropDetector::New();
   Control control1 = Control::New();
index b605fc4..0422166 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -276,7 +276,7 @@ int UtcDaliImageAtlasUploadP(void)
 
 int UtcDaliImageAtlasUploadWithObserver01(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
   ImageAtlas atlas = ImageAtlas::New( 200, 200 );
 
 
@@ -303,7 +303,7 @@ int UtcDaliImageAtlasUploadWithObserver01(void)
 
 int UtcDaliImageAtlasUploadWithObserver02(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
   ImageAtlas atlas = ImageAtlas::New( 200, 200 );
 
   gCountOfTestFuncCall = 0;
@@ -333,7 +333,7 @@ int UtcDaliImageAtlasUploadWithObserver02(void)
 
 int UtcDaliImageAtlasUploadWithObserver03(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   gCountOfTestFuncCall = 0;
   TestUploadObserver* uploadObserver = new TestUploadObserver;
@@ -364,7 +364,7 @@ int UtcDaliImageAtlasUploadWithObserver03(void)
 
 int UtcDaliImageAtlasRemove(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
   unsigned int size = 100;
   ImageAtlas atlas = ImageAtlas::New( size, size );
   Vector4 textureRect1;
index 965e258..2c23106 100644 (file)
@@ -163,7 +163,7 @@ void TestUrl( ImageView imageView, const std::string url )
 
 int UtcDaliImageViewNewP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   ImageView imageView = ImageView::New();
 
@@ -174,7 +174,7 @@ int UtcDaliImageViewNewP(void)
 
 int UtcDaliImageViewNewImageP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   BufferImage image = CreateBufferImage( 100, 200, Vector4( 1.f, 1.f, 1.f, 1.f ) );
   ImageView imageView = ImageView::New( image );
@@ -187,7 +187,7 @@ int UtcDaliImageViewNewImageP(void)
 
 int UtcDaliImageViewNewUrlP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   ImageView imageView = ImageView::New( TEST_IMAGE_FILE_NAME );
   DALI_TEST_CHECK( imageView );
@@ -199,7 +199,7 @@ int UtcDaliImageViewNewUrlP(void)
 
 int UtcDaliImageViewConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   ImageView imageView;
 
@@ -210,7 +210,7 @@ int UtcDaliImageViewConstructorP(void)
 
 int UtcDaliImageViewCopyConstructorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   // Initialize an object, ref count == 1
   ImageView imageView = ImageView::New();
@@ -223,7 +223,7 @@ int UtcDaliImageViewCopyConstructorP(void)
 
 int UtcDaliImageViewAssignmentOperatorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   ImageView imageView = ImageView::New();
 
@@ -236,7 +236,7 @@ int UtcDaliImageViewAssignmentOperatorP(void)
 
 int UtcDaliImageViewDownCastP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   ImageView imageView = ImageView::New();
 
@@ -253,7 +253,7 @@ int UtcDaliImageViewDownCastP(void)
 
 int UtcDaliImageViewDownCastN(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   BaseHandle unInitializedObject;
 
index 1607611..24c5d09 100644 (file)
@@ -33,7 +33,7 @@ namespace
 {
 const int RENDER_FRAME_INTERVAL = 16;                           ///< Duration of each frame in ms. (at approx 60FPS)
 const unsigned int TOTAL_PAGE_NUMBER = 20;
-const Vector2 PAGE_SIZE( 300.f,400.f );
+const Vector2 VIEW_PAGE_SIZE( 300.f,400.f );
 const Vector2 SPINE_SHADOW_PARAMETER( 60.0f, 30.0f );
 
 static bool gObjectCreatedCallBackCalled;
@@ -208,7 +208,7 @@ int UtcDaliPageTurnPortraitViewNew(void)
 
   // Test object creation
   TestPageFactory factory;
-  portraitView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+  portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
   DALI_TEST_CHECK( portraitView );
 
   //Additional check to ensure object is created by checking if it's registered
@@ -219,7 +219,7 @@ int UtcDaliPageTurnPortraitViewNew(void)
   registry.ObjectCreatedSignal().Connect( &TestCallback );
   {
     TestPageFactory factory;
-    PageTurnView portraitView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+    PageTurnView portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
   }
   DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
 
@@ -248,7 +248,7 @@ int UtcDaliPageTurnLandscapeViewNew(void)
 
   // Test object creation
   TestPageFactory factory;
-  landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+  landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
   DALI_TEST_CHECK( landscapeView );
 
   //Additional check to ensure object is created by checking if it's registered
@@ -259,7 +259,7 @@ int UtcDaliPageTurnLandscapeViewNew(void)
   registry.ObjectCreatedSignal().Connect( &TestCallback );
   {
     TestPageFactory factory;
-    PageTurnView landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+    PageTurnView landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
   }
   DALI_TEST_CHECK( gObjectCreatedCallBackCalled );
 
@@ -288,7 +288,7 @@ int UtcDaliPageTurnPortraitViewCopyConstructorAndAssignment(void)
 
   // Test object creation
   TestPageFactory factory;
-  portraitView = PageTurnPortraitView::New( factory, PAGE_SIZE );
+  portraitView = PageTurnPortraitView::New( factory, VIEW_PAGE_SIZE );
   DALI_TEST_CHECK( portraitView );
 
   // Test copy constructor
@@ -322,7 +322,7 @@ int UtcDaliPageTurnLandscapeViewCopyConstructorAndAssignment(void)
 
   // Test object creation
   TestPageFactory factory;
-  landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+  landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
   DALI_TEST_CHECK( landscapeView );
 
   // Test copy constructor
@@ -351,23 +351,23 @@ int UtcDaliPageTurnViewSetGetProperty(void)
   tet_infoline(" UtcDaliPageTurnViewSetGetProperty ");
 
   TestPageFactory factory;
-  PageTurnView landscapeView = PageTurnLandscapeView::New( factory, PAGE_SIZE );
+  PageTurnView landscapeView = PageTurnLandscapeView::New( factory, VIEW_PAGE_SIZE );
   DALI_TEST_CHECK( landscapeView );
 
   Stage::GetCurrent().Add( landscapeView );
 
-  // Test "pageSize" property
-  DALI_TEST_CHECK( landscapeView.GetPropertyIndex("pageSize") == PageTurnView::Property::PAGE_SIZE  );
-  DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::PAGE_SIZE).Get<Vector2>(), PAGE_SIZE, TEST_LOCATION );
+  // Test "viewPageSize" property
+  DALI_TEST_CHECK( landscapeView.GetPropertyIndex("viewPageSize") == PageTurnView::Property::VIEW_PAGE_SIZE  );
+  DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), VIEW_PAGE_SIZE, TEST_LOCATION );
 
-  Vector2 newSize( PAGE_SIZE.x*0.75, PAGE_SIZE.y*0.5f );
-  landscapeView.SetProperty( PageTurnView::Property::PAGE_SIZE, newSize );
-  DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::PAGE_SIZE).Get<Vector2>(), newSize, TEST_LOCATION );
+  Vector2 newSize( VIEW_PAGE_SIZE.x*0.75, VIEW_PAGE_SIZE.y*0.5f );
+  landscapeView.SetProperty( PageTurnView::Property::VIEW_PAGE_SIZE, newSize );
+  DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize, TEST_LOCATION );
   Wait( application);
   DALI_TEST_EQUALS( Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x*2.f, newSize.y), TEST_LOCATION);
 
-  landscapeView.SetProperty( PageTurnView::Property::PAGE_SIZE,newSize*1.5f);
-  DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::PAGE_SIZE).Get<Vector2>(), newSize*1.5f, TEST_LOCATION );
+  landscapeView.SetProperty( PageTurnView::Property::VIEW_PAGE_SIZE,newSize*1.5f);
+  DALI_TEST_EQUALS( landscapeView.GetProperty(PageTurnView::Property::VIEW_PAGE_SIZE).Get<Vector2>(), newSize*1.5f, TEST_LOCATION );
   Wait( application);
   DALI_TEST_EQUALS( Vector2(landscapeView.GetTargetSize()), Vector2(newSize.x*3.f, newSize.y*1.5f), TEST_LOCATION);
 
index 3e66bf1..7b6a1f0 100644 (file)
@@ -588,9 +588,9 @@ int UtcDaliToolkitScrollModeP1(void)
   ScrollView scrollView = ScrollView::New();
 
   // Do not rely on stage size for UTC tests.
-  Vector2 pageSize( 720.0f, 1280.0f );
+  Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( pageSize );
+  scrollView.SetSize( viewPageSize );
   scrollView.SetParentOrigin( ParentOrigin::CENTER );
   scrollView.SetAnchorPoint( AnchorPoint::CENTER );
   scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
@@ -598,8 +598,8 @@ int UtcDaliToolkitScrollModeP1(void)
   // Position rulers.
   Property::Map rulerMap;
   rulerMap.Add( ScrollMode::X_AXIS_SCROLL_ENABLED, true );
-  rulerMap.Add( ScrollMode::X_AXIS_SNAP_TO_INTERVAL, pageSize.width );
-  rulerMap.Add( ScrollMode::X_AXIS_SCROLL_BOUNDARY, pageSize.width*3 );
+  rulerMap.Add( ScrollMode::X_AXIS_SNAP_TO_INTERVAL, viewPageSize.width );
+  rulerMap.Add( ScrollMode::X_AXIS_SCROLL_BOUNDARY, viewPageSize.width*3 );
   rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_ENABLED, false );
   scrollView.SetProperty( ScrollView::Property::SCROLL_MODE, rulerMap);
 
@@ -622,7 +622,7 @@ int UtcDaliToolkitScrollModeP1(void)
   Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
 
   // Confirm the final X coord has not moved more than one page from the start X position.
-  DALI_TEST_GREATER( ( startPos.x + pageSize.width ), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION );
+  DALI_TEST_GREATER( ( startPos.x + viewPageSize.width ), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION );
 
   // Finish the gesture and wait for the snap.
   currentPos += direction;
@@ -631,7 +631,7 @@ int UtcDaliToolkitScrollModeP1(void)
   time += Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
 
   // Confirm the final X coord has snapped to exactly one page ahead of the start page.
-  DALI_TEST_EQUALS( pageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+  DALI_TEST_EQUALS( viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
 
   END_TEST;
 }
@@ -645,9 +645,9 @@ int UtcDaliToolkitScrollModeP2(void)
   ScrollView scrollView = ScrollView::New();
 
   // Do not rely on stage size for UTC tests.
-  Vector2 pageSize( 720.0f, 1280.0f );
+  Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( pageSize );
+  scrollView.SetSize( viewPageSize );
   scrollView.SetParentOrigin( ParentOrigin::CENTER );
   scrollView.SetAnchorPoint( AnchorPoint::CENTER );
   scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
@@ -656,8 +656,8 @@ int UtcDaliToolkitScrollModeP2(void)
   Property::Map rulerMap;
   rulerMap.Add( ScrollMode::X_AXIS_SCROLL_ENABLED, false );
   rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_ENABLED, true );
-  rulerMap.Add( ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, pageSize.height );
-  rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_BOUNDARY, pageSize.height*3 );
+  rulerMap.Add( ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, viewPageSize.height );
+  rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_BOUNDARY, viewPageSize.height*3 );
   scrollView.SetProperty( ScrollView::Property::SCROLL_MODE, rulerMap);
 
   scrollView.SetWrapMode( false );
@@ -679,7 +679,7 @@ int UtcDaliToolkitScrollModeP2(void)
   Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
 
   // Confirm the final X coord has not moved more than one page from the start X position.
-  DALI_TEST_GREATER( ( startPos.y + pageSize.height ), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION );
+  DALI_TEST_GREATER( ( startPos.y + viewPageSize.height ), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION );
 
   // Finish the gesture and wait for the snap.
   currentPos += direction;
@@ -689,7 +689,7 @@ int UtcDaliToolkitScrollModeP2(void)
   Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
 
   // Confirm the final Y coord has snapped to exactly one page ahead of the start page.
-  DALI_TEST_EQUALS( pageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+  DALI_TEST_EQUALS( viewPageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION );
 
   END_TEST;
 }
@@ -703,9 +703,9 @@ int UtcDaliToolkitScrollModeP3(void)
   ScrollView scrollView = ScrollView::New();
 
   // Do not rely on stage size for UTC tests.
-  Vector2 pageSize( 720.0f, 1280.0f );
+  Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( pageSize );
+  scrollView.SetSize( viewPageSize );
   scrollView.SetParentOrigin( ParentOrigin::CENTER );
   scrollView.SetAnchorPoint( AnchorPoint::CENTER );
   scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
@@ -714,8 +714,8 @@ int UtcDaliToolkitScrollModeP3(void)
   Property::Map rulerMap;
   rulerMap.Add( ScrollMode::X_AXIS_SCROLL_ENABLED, false );
   rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_ENABLED, true );
-  rulerMap.Add( ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, pageSize.height );
-  rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_BOUNDARY, pageSize.height*3 );
+  rulerMap.Add( ScrollMode::Y_AXIS_SNAP_TO_INTERVAL, viewPageSize.height );
+  rulerMap.Add( ScrollMode::Y_AXIS_SCROLL_BOUNDARY, viewPageSize.height*3 );
   scrollView.SetProperty( ScrollView::Property::SCROLL_MODE, rulerMap);
 
   scrollView.SetWrapMode( false );
@@ -737,7 +737,7 @@ int UtcDaliToolkitScrollModeP3(void)
   Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
 
   // Confirm the final X coord has not moved more than one page from the start X position.
-  DALI_TEST_GREATER( ( startPos.y + pageSize.height ), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION );
+  DALI_TEST_GREATER( ( startPos.y + viewPageSize.height ), scrollView.GetCurrentScrollPosition().y, TEST_LOCATION );
 
   // Finish the gesture and wait for the snap.
   currentPos += direction;
@@ -746,7 +746,7 @@ int UtcDaliToolkitScrollModeP3(void)
   Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
 
   // Confirm the final Y coord has snapped to exactly one page ahead of the start page.
-  DALI_TEST_EQUALS( pageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+  DALI_TEST_EQUALS( viewPageSize.height, scrollView.GetCurrentScrollPosition().y, Math::MACHINE_EPSILON_0, TEST_LOCATION );
 
   END_TEST;
 }
@@ -760,9 +760,9 @@ int UtcDaliToolkitScrollModeP4(void)
   ScrollView scrollView = ScrollView::New();
 
   // Do not rely on stage size for UTC tests.
-  Vector2 pageSize( 720.0f, 1280.0f );
+  Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( pageSize );
+  scrollView.SetSize( viewPageSize );
   scrollView.SetParentOrigin( ParentOrigin::TOP_LEFT );
   scrollView.SetAnchorPoint( AnchorPoint::TOP_LEFT );
   scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
@@ -2742,19 +2742,19 @@ int UtcDaliToolkitScrollViewGesturePageLimit(void)
   ScrollView scrollView = ScrollView::New();
 
   // Do not rely on stage size for UTC tests.
-  Vector2 pageSize( 720.0f, 1280.0f );
+  Vector2 viewPageSize( 720.0f, 1280.0f );
   scrollView.SetResizePolicy( ResizePolicy::FIXED, Dimension::ALL_DIMENSIONS );
-  scrollView.SetSize( pageSize );
+  scrollView.SetSize( viewPageSize );
   scrollView.SetParentOrigin( ParentOrigin::CENTER );
   scrollView.SetAnchorPoint( AnchorPoint::CENTER );
   scrollView.SetPosition( 0.0f, 0.0f, 0.0f );
 
   // Position rulers.
   // We set the X ruler to fixed to give us pages to snap to.
-  Dali::Toolkit::FixedRuler* rulerX = new Dali::Toolkit::FixedRuler( pageSize.width );
+  Dali::Toolkit::FixedRuler* rulerX = new Dali::Toolkit::FixedRuler( viewPageSize.width );
   // Note: The 3x page width is arbitary, but we need enough to show that we are
   // capping page movement by the page limiter, and not the domain.
-  rulerX->SetDomain( Dali::Toolkit::RulerDomain( 0.0f, pageSize.width * 3.0f, false ) );
+  rulerX->SetDomain( Dali::Toolkit::RulerDomain( 0.0f, viewPageSize.width * 3.0f, false ) );
   Dali::Toolkit::RulerPtr rulerY = new Dali::Toolkit::DefaultRuler();
   rulerY->Disable();
   scrollView.SetRulerX( rulerX );
@@ -2779,7 +2779,7 @@ int UtcDaliToolkitScrollViewGesturePageLimit(void)
   Vector2 currentPos( PerformGestureSwipe( application, startPos, direction, frames - 1, time, false ) );
 
   // Confirm the final X coord has not moved more than one page from the start X position.
-  DALI_TEST_GREATER( ( startPos.x + pageSize.width ), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION );
+  DALI_TEST_GREATER( ( startPos.x + viewPageSize.width ), scrollView.GetCurrentScrollPosition().x, TEST_LOCATION );
 
   // Finish the gesture and wait for the snap.
   currentPos += direction;
@@ -2788,7 +2788,7 @@ int UtcDaliToolkitScrollViewGesturePageLimit(void)
   time += Wait( application, RENDER_DELAY_SCROLL + RENDER_FRAME_INTERVAL );
 
   // Confirm the final X coord has snapped to exactly one page ahead of the start page.
-  DALI_TEST_EQUALS( pageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
+  DALI_TEST_EQUALS( viewPageSize.width, scrollView.GetCurrentScrollPosition().x, Math::MACHINE_EPSILON_0, TEST_LOCATION );
 
   END_TEST;
 }
index f56c3c1..91c9a79 100755 (executable)
@@ -21,6 +21,7 @@
 #include <dali/public-api/rendering/renderer.h>
 #include <dali/devel-api/adaptor-framework/clipboard.h>
 #include <dali/devel-api/adaptor-framework/key-devel.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali/integration-api/events/key-event-integ.h>
 #include <dali/integration-api/events/touch-event-integ.h>
 #include <dali-toolkit-test-suite-utils.h>
@@ -924,15 +925,13 @@ int utcDaliTextEditorTextChangedP(void)
 
 int utcDaliTextEditorInputStyleChanged01(void)
 {
-  ToolkitTestApplication application;
-  tet_infoline(" utcDaliTextEditorInputStyleChanged01");
-
   // The text-editor emits signals when the input style changes. These changes of style are
   // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
   // can't be emitted during the size negotiation as the callbacks may update the UI.
   // The text-editor adds an idle callback to the adaptor to emit the signals after the size negotiation.
-  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
-  application.CreateAdaptor();
+  // The ToolkitTestApplication creates an implementation of the adaptor stub and a queue of idle callbacks.
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorInputStyleChanged01");
 
   // Load some fonts.
 
@@ -1140,15 +1139,13 @@ int utcDaliTextEditorInputStyleChanged01(void)
 
 int utcDaliTextEditorInputStyleChanged02(void)
 {
-  ToolkitTestApplication application;
-  tet_infoline(" utcDaliTextEditorInputStyleChanged02");
-
   // The text-editor emits signals when the input style changes. These changes of style are
   // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
   // can't be emitted during the size negotiation as the callbacks may update the UI.
   // The text-editor adds an idle callback to the adaptor to emit the signals after the size negotiation.
-  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
-  application.CreateAdaptor();
+  // The ToolkitTestApplication creates an implementation of the adaptor stub and a queue of idle callbacks.
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextEditorInputStyleChanged02");
 
   // Load some fonts.
 
index 9ff0f65..881fdde 100755 (executable)
@@ -24,6 +24,7 @@
 #include <dali/integration-api/events/touch-event-integ.h>
 
 #include <dali/devel-api/adaptor-framework/key-devel.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali-toolkit/dali-toolkit.h>
 #include <dali-toolkit/devel-api/controls/text-controls/text-field-devel.h>
@@ -1091,15 +1092,13 @@ int utcDaliTextFieldMaxCharactersReachedN(void)
 
 int utcDaliTextFieldInputStyleChanged01(void)
 {
-  ToolkitTestApplication application;
-  tet_infoline(" utcDaliTextFieldInputStyleChanged01");
-
   // The text-field emits signals when the input style changes. These changes of style are
   // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
   // can't be emitted during the size negotiation as the callbacks may update the UI.
   // The text-field adds an idle callback to the adaptor to emit the signals after the size negotiation.
-  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
-  application.CreateAdaptor();
+  // The ToolkitTestApplication creates an implementation of the adaptor stub and a queue of idle callbacks.
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldInputStyleChanged01");
 
   // Load some fonts.
 
@@ -1302,15 +1301,13 @@ int utcDaliTextFieldInputStyleChanged01(void)
 
 int utcDaliTextFieldInputStyleChanged02(void)
 {
-  ToolkitTestApplication application;
-  tet_infoline(" utcDaliTextFieldInputStyleChanged02");
-
   // The text-field emits signals when the input style changes. These changes of style are
   // detected during the relayout process (size negotiation), i.e after the cursor has been moved. Signals
   // can't be emitted during the size negotiation as the callbacks may update the UI.
   // The text-field adds an idle callback to the adaptor to emit the signals after the size negotiation.
-  // This creates an implementation of the adaptor stub and a queue of idle callbacks.
-  application.CreateAdaptor();
+  // The ToolkitTestApplication creates an implementation of the adaptor stub and a queue of idle callbacks.
+  ToolkitTestApplication application;
+  tet_infoline(" utcDaliTextFieldInputStyleChanged02");
 
   // Load some fonts.
 
index 9eea425..d8c5f70 100755 (executable)
@@ -25,6 +25,7 @@
 #include <dali-toolkit/devel-api/controls/text-controls/text-style-properties-devel.h>
 #include <dali-toolkit/devel-api/text/text-enumerations-devel.h>
 #include <dali/devel-api/text-abstraction/bitmap-font.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali-toolkit/devel-api/text/bitmap-font.h>
 
 using namespace Dali;
index 3850d2a..1db1bc5 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2018 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
@@ -136,7 +136,7 @@ void CHECK_MAP_EQUALS( Property::Map test, Property::Map result )
 
 int UtcDaliTransitionDataNew(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map = CreateMap();
   Dali::Toolkit::TransitionData transition = TransitionData::New( map );
@@ -147,7 +147,7 @@ int UtcDaliTransitionDataNew(void)
 
 int UtcDaliTransitionDataDownCast(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map = CreateMap();
 
@@ -161,7 +161,7 @@ int UtcDaliTransitionDataDownCast(void)
 
 int UtcDaliTransitionDataCopyConstructor(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map = CreateMap();
 
@@ -176,7 +176,7 @@ int UtcDaliTransitionDataCopyConstructor(void)
 
 int UtcDaliTransitionDataAssignmentOperator(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map = CreateMap();
 
@@ -195,7 +195,7 @@ int UtcDaliTransitionDataAssignmentOperator(void)
 
 int UtcDaliTransitionDataCount(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map = CreateMap();
   TransitionData transitionData = TransitionData::New( map );
@@ -216,7 +216,7 @@ int UtcDaliTransitionDataCount(void)
 
 int UtcDaliTransitionDataMap1P(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing animation of a visual property using stylesheet equivalent maps\n");
 
@@ -284,7 +284,7 @@ int UtcDaliTransitionDataMap1P(void)
 
 int UtcDaliTransitionDataMap2P(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing animation of a visual property using programmatic maps\n");
 
@@ -352,7 +352,7 @@ int UtcDaliTransitionDataMap2P(void)
 
 int UtcDaliTransitionDataMap2Pb(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing animation of a visual property using programmatic maps\n");
 
@@ -424,7 +424,7 @@ int UtcDaliTransitionDataMap2Pb(void)
 
 int UtcDaliTransitionDataMap3P(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing animation of an actor's position property using bezier curve\n");
 
@@ -480,7 +480,7 @@ int UtcDaliTransitionDataMap3P(void)
 
 int UtcDaliTransitionDataMap4P(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing animation of a visual's transform property using programmatic maps\n");
 
@@ -552,7 +552,7 @@ int UtcDaliTransitionDataMap4P(void)
 
 int UtcDaliTransitionDataMap5P(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
 
@@ -625,7 +625,7 @@ int UtcDaliTransitionDataMap5P(void)
 
 int UtcDaliTransitionDataMap6P(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing animation visual opacity using stylesheet equivalent maps\n");
 
@@ -699,7 +699,7 @@ int UtcDaliTransitionDataMap6P(void)
 
 int UtcDaliTransitionDataMap1N(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map;
   map["target"] = "Actor1";
@@ -731,7 +731,7 @@ int UtcDaliTransitionDataMap1N(void)
 
 int UtcDaliTransitionDataMapN3(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing visual lookup with no renderers\n");
 
@@ -773,7 +773,7 @@ int UtcDaliTransitionDataMapN3(void)
 
 int UtcDaliTransitionDataMapN4(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing visual doesn't animate with duff bezier data \n");
 
@@ -825,7 +825,7 @@ int UtcDaliTransitionDataMapN4(void)
 
 int UtcDaliTransitionDataMapN5(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing visual doesn't animate with duff bezier data \n");
 
@@ -876,7 +876,7 @@ int UtcDaliTransitionDataMapN5(void)
 
 int UtcDaliTransitionDataMapN6(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   tet_printf("Testing visual doesn't animate with duff bezier data \n");
 
@@ -929,7 +929,7 @@ int UtcDaliTransitionDataMapN6(void)
 
 int UtcDaliTransitionDataArrayP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map1;
   map1["target"] = "Actor1";
@@ -1005,7 +1005,7 @@ int UtcDaliTransitionDataArrayP(void)
 
 int UtcDaliTransitionDataGetAnimatorP(void)
 {
-  TestApplication application;
+  ToolkitTestApplication application;
 
   Property::Map map1;
   map1["target"] = "Actor1";
index aee2e2f..374afe0 100644 (file)
@@ -21,6 +21,7 @@
 #include <toolkit-event-thread-callback.h>
 #include <dali-toolkit-test-suite-utils.h>
 #include <dali/devel-api/object/handle-devel.h>
+#include <dali/devel-api/text-abstraction/font-client.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
index 64a08a0..b66beb0 100644 (file)
@@ -139,11 +139,6 @@ void Builder::CreateRenderTask( const std::string &name )
   GetImpl(*this).CreateRenderTask( name );
 }
 
-FrameBufferImage Builder::GetFrameBufferImage( const std::string &name )
-{
-  return GetImpl(*this).GetFrameBufferImage( name );
-}
-
 Path Builder::GetPath( const std::string &name )
 {
   return GetImpl(*this).GetPath( name );
index f3975f6..1f8ea4a 100755 (executable)
@@ -394,15 +394,6 @@ class DALI_TOOLKIT_API Builder : public BaseHandle
   void CreateRenderTask( const std::string &name );
 
   /**
-   * Get or create FrameBufferImage from the FrameBufferImage instance library.
-   * An empty handle is returned otherwise.
-   * @pre The Builder has been initialized.
-   * @param name The name of a FrameBufferImage in the loaded representation
-   * @return A handle to a FrameBufferImage if found, otherwise empty
-   */
-  FrameBufferImage GetFrameBufferImage( const std::string &name );
-
-  /**
    * Get or create Path from the Path instance library.
    * An empty handle is returned otherwise.
    * @pre The Builder has been initialized.
index 3d9eed7..f8473ad 100644 (file)
@@ -16,7 +16,9 @@
  */
 
 // EXTERNAL INCLUDES
+#include <cctype>
 #include <cstring>
+#include <string>
 #include <algorithm>
 
 // INTERNAL INCLUDES
index 60ffd31..50f5d82 100644 (file)
@@ -61,9 +61,9 @@ PageTurnLandscapeView::~PageTurnLandscapeView()
 {
 }
 
-PageTurnLandscapeView PageTurnLandscapeView::New( PageFactory& pageFactory, const Vector2& pageSize )
+PageTurnLandscapeView PageTurnLandscapeView::New( PageFactory& pageFactory, const Vector2& viewPageSize )
 {
-  return Internal::PageTurnLandscapeView::New(pageFactory, pageSize);
+  return Internal::PageTurnLandscapeView::New(pageFactory, viewPageSize);
 }
 
 PageTurnLandscapeView PageTurnLandscapeView::DownCast( BaseHandle handle )
index d2397b6..8f586f8 100644 (file)
@@ -71,10 +71,10 @@ public:
    * @brief Create an initialized PageTurnLandscapeView control
    * @SINCE_1_0.0
    * @param[in] pageFactory The factory which provides PageTurnView with pages.
-   * @param[in] pageSize The size of the page
+   * @param[in] viewPageSize The size of the page
    * @return A handle to the PageTurnLandscapeView control.
    */
-  static PageTurnLandscapeView New( PageFactory& pageFactory, const Vector2& pageSize );
+  static PageTurnLandscapeView New( PageFactory& pageFactory, const Vector2& viewPageSize );
 
   /**
    * @brief Downcast an Object handle to PageTurnPortraitView. If handle points to a PageTurnLandscapeView the
index 9b4825e..175316e 100644 (file)
@@ -61,9 +61,9 @@ PageTurnPortraitView::~PageTurnPortraitView()
 {
 }
 
-PageTurnPortraitView PageTurnPortraitView::New( PageFactory& pageFactory, const Vector2& pageSize)
+PageTurnPortraitView PageTurnPortraitView::New( PageFactory& pageFactory, const Vector2& viewPageSize)
 {
-  return Internal::PageTurnPortraitView::New(pageFactory, pageSize);
+  return Internal::PageTurnPortraitView::New(pageFactory, viewPageSize);
 }
 
 PageTurnPortraitView PageTurnPortraitView::DownCast( BaseHandle handle )
index 15dc95f..9bf715c 100644 (file)
@@ -72,10 +72,10 @@ public:
    * @brief Create an initialized  PageTurnPortraitView control
    * @SINCE_1_1.4
    * @param[in] pageFactory The factory which provides PageTurnView with pages.
-   * @param[in] pageSize The size of the page
+   * @param[in] viewPageSize The size of the page
    * @return A handle to the PageTurnPortraitView control.
    */
-  static PageTurnPortraitView New( PageFactory& pageFactory, const Vector2& pageSize );
+  static PageTurnPortraitView New( PageFactory& pageFactory, const Vector2& viewPageSize );
 
   /**
    * @brief Downcast an Object handle to PageTurnPortraitView. If handle points to a PageTurnPortraitView the
index 63bc35c..3d5df87 100644 (file)
@@ -81,8 +81,8 @@ public:
   {
     enum
     {
-      PAGE_SIZE = PROPERTY_START_INDEX, ///< name "pageSize",        type Vector2 @SINCE_1_1.4
-      CURRENT_PAGE_ID,                  ///< name "currentPageId",   type Integer @SINCE_1_1.4
+      VIEW_PAGE_SIZE = PROPERTY_START_INDEX, ///< name "viewPageSize",        type Vector2 @SINCE_1_1.4
+      CURRENT_PAGE_ID,                       ///< name "currentPageId",       type Integer @SINCE_1_1.4
 
       /**
        * The two values are the major&minor radius (in pixels) to form an ellipse shape.
index 947f8ce..90a87fc 100755 (executable)
 #include <fstream>
 #include <sstream>
 
-#include <wordexp.h>
 #include <stdio.h>
 #include <unistd.h>
 
 #include <dali/devel-api/adaptor-framework/file-loader.h>
 
-inline std::string ExpandPath(const std::string &name)
-{
-  wordexp_t p;
-  char** w;
-  wordexp( name.c_str(), &p, 0 );
-  w = p.we_wordv;
-  std::stringstream s;
-  for (size_t i=0; i<p.we_wordc;i++ )
-  {
-    s << w[i];
-  }
-  wordfree( &p );
-  return s.str();
-}
-
-
-inline std::string ExePath(void)
-{
-  char buf[256];
-  ssize_t len = readlink("/proc/self/exe", buf, sizeof(buf) - 1);
-  len = len > 0 ? len : 0;
-  buf[len] = '\0';
-  return std::string(buf);
-}
-
 inline std::string GetFileContents(const std::string &fn)
 {
   std::streampos bufferSize = 0;
index 73facc7..78000be 100644 (file)
@@ -458,48 +458,6 @@ void Builder::CreateRenderTask( const std::string &name )
   }
 }
 
-FrameBufferImage Builder::GetFrameBufferImage( const std::string &name )
-{
-  Replacement constant( mReplacementMap );
-  return GetFrameBufferImage(name, constant);
-}
-
-FrameBufferImage Builder::GetFrameBufferImage( const std::string &name, const Replacement& constant )
-{
-  DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
-
-  FrameBufferImage ret;
-
-  ImageLut::const_iterator iter( mFrameBufferImageLut.find( name ) );
-  if( iter != mFrameBufferImageLut.end() )
-  {
-    ret = iter->second;
-  }
-  else
-  {
-    if( OptionalChild images = IsChild( *mParser.GetRoot(), "frameBufferImages") )
-    {
-      if( OptionalChild image = IsChild( *images, name ) )
-      {
-        Dali::Property::Value property(Property::MAP);
-        if( DeterminePropertyFromNode( *image, Property::MAP, property, constant ) )
-        {
-          Property::Map* map = property.GetMap();
-
-          if( map )
-          {
-            (*map)[ KEYNAME_TYPE ] = Property::Value(std::string("FrameBufferImage") );
-            ret = FrameBufferImage::DownCast( Dali::Scripting::NewImage( property ) );
-            mFrameBufferImageLut[ name ] = ret;
-          }
-        }
-      }
-    }
-  }
-
-  return ret;
-}
-
 Path Builder::GetPath( const std::string& name )
 {
   DALI_ASSERT_ALWAYS(mParser.GetRoot() && "Builder script not loaded");
@@ -1114,19 +1072,6 @@ void Builder::SetupTask( RenderTask& task, const TreeNode& node, const Replaceme
     }
   }
 
-  if( OptionalString s = constant.IsString( IsChild(node, "targetFrameBuffer") ) )
-  {
-    FrameBufferImage fb = GetFrameBufferImage( *s, constant );
-    if(fb)
-    {
-      task.SetTargetFrameBuffer( fb );
-    }
-    else
-    {
-      DALI_SCRIPT_WARNING("Cannot find target frame buffer '%s'\n", (*s).c_str() );
-    }
-  }
-
   if( OptionalString s = constant.IsString( IsChild(node, "screenToFrameBufferFunction") ) )
   {
     if("DEFAULT_SCREEN_TO_FRAMEBUFFER_FUNCTION" == *s)
index 2eb4a2b..7830e68 100755 (executable)
@@ -188,16 +188,6 @@ public:
   void CreateRenderTask( const std::string &name );
 
   /**
-   * @copydoc Toolkit::Builder::GetFrameBufferImage
-   */
-  FrameBufferImage GetFrameBufferImage( const std::string &name );
-
-  /**
-   * @copydoc Toolkit::Builder::GetFrameBufferImage
-   */
-  FrameBufferImage GetFrameBufferImage( const std::string &name, const Replacement& constant );
-
-  /**
    * @copydoc Toolkit::Builder::GetPath
    */
   Path GetPath( const std::string &name );
@@ -251,7 +241,6 @@ private:
   typedef struct{ std::string name; Dali::PathConstrainer pathConstrainer; } PathConstrainerEntry;
   typedef std::vector<PathConstrainerEntry> PathConstrainerLut;
   typedef std::map<const std::string, Path> PathLut;
-  typedef std::map<const std::string, FrameBufferImage> ImageLut;
 
 private:
   // Undefined
@@ -385,7 +374,6 @@ private:
 
 private:
   Toolkit::JsonParser                 mParser;
-  ImageLut                            mFrameBufferImageLut;
   PathLut                             mPathLut;
   PathConstrainerLut                  mPathConstrainerLut;
   LinearConstrainerLut                mLinearConstrainerLut;
index 3691838..636bac1 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali-toolkit/internal/builder/json-parser-state.h>
 
 // EXTERNAL INCLUDES
+#include <string>
 #include <algorithm>
 
 namespace Dali
index 8d99d68..14f179b 100644 (file)
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/rendering/renderer.h>
-#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/gaussian-blur-view/gaussian-blur-view.h>
 #include <dali-toolkit/devel-api/controls/bloom-view/bloom-view.h>
-#include <dali-toolkit/public-api/visuals/visual-properties.h>
 #include <dali-toolkit/internal/controls/gaussian-blur-view/gaussian-blur-view-impl.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 
 namespace Dali
 {
@@ -230,16 +229,16 @@ void BloomView::OnInitialize()
   // Create actors
 
   // Create an image view for rendering from the scene texture to the bloom texture
-  mBloomExtractImageView = Toolkit::ImageView::New();
-  mBloomExtractImageView.SetParentOrigin( ParentOrigin::CENTER );
+  mBloomExtractActor = Actor::New();
+  mBloomExtractActor.SetParentOrigin( ParentOrigin::CENTER );
 
   // Create an image view for compositing the result (scene and bloom textures) to output
-  mCompositeImageView = Toolkit::ImageView::New();
-  mCompositeImageView.SetParentOrigin( ParentOrigin::CENTER );
+  mCompositeActor = Actor::New();
+  mCompositeActor.SetParentOrigin( ParentOrigin::CENTER );
 
   // Create an image view for holding final result, i.e. the blurred image. This will get rendered to screen later, via default / user render task
-  mTargetImageView = Toolkit::ImageView::New();
-  mTargetImageView.SetParentOrigin( ParentOrigin::CENTER );
+  mTargetActor = Actor::New();
+  mTargetActor.SetParentOrigin( ParentOrigin::CENTER );
 
   // Create the Gaussian Blur object + render tasks
   // Note that we use mBloomExtractTarget as the source image and also re-use this as the gaussian blur final render target. This saves the gaussian blur code from creating it
@@ -264,10 +263,10 @@ void BloomView::OnInitialize()
   // Connect to actor tree
   Self().Add( mChildrenRoot );
   Self().Add( mInternalRoot );
-  mInternalRoot.Add( mBloomExtractImageView );
+  mInternalRoot.Add( mBloomExtractActor );
   mInternalRoot.Add( mGaussianBlurView );
-  mInternalRoot.Add( mCompositeImageView );
-  mInternalRoot.Add( mTargetImageView );
+  mInternalRoot.Add( mCompositeActor );
+  mInternalRoot.Add( mTargetActor );
   mInternalRoot.Add( mRenderDownsampledCamera );
   mInternalRoot.Add( mRenderFullSizeCamera );
 
@@ -279,8 +278,8 @@ void BloomView::OnSizeSet(const Vector3& targetSize)
 {
   mTargetSize = Vector2(targetSize);
   mChildrenRoot.SetSize(targetSize);
-  mCompositeImageView.SetSize(targetSize);
-  mTargetImageView.SetSize(targetSize);
+  mCompositeActor.SetSize(targetSize);
+  mTargetActor.SetSize(targetSize);
 
   // Children render camera must move when GaussianBlurView object is
   // resized. This is since we cannot change render target size - so we need
@@ -336,7 +335,6 @@ void BloomView::AllocateResources()
 
     // Create and place a camera for the renders corresponding to the (potentially downsampled) render targets' size
     mRenderDownsampledCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
-    // TODO: how do we pick a reasonable value for near clip? Needs to relate to normal camera the user renders with, but we don't have a handle on it
     mRenderDownsampledCamera.SetNearClippingPlane(1.0f);
     mRenderDownsampledCamera.SetAspectRatio(mDownsampledWidth / mDownsampledHeight);
     mRenderDownsampledCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
@@ -345,7 +343,6 @@ void BloomView::AllocateResources()
 
     // Create and place a camera for the children render, corresponding to its render target size
     mRenderFullSizeCamera.SetFieldOfView(ARBITRARY_FIELD_OF_VIEW);
-    // TODO: how do we pick a reasonable value for near clip? Needs to relate to normal camera the user renders with, but we don't have a handle on it
     mRenderFullSizeCamera.SetNearClippingPlane(1.0f);
     mRenderFullSizeCamera.SetAspectRatio(mTargetSize.width / mTargetSize.height);
     mRenderFullSizeCamera.SetType(Dali::Camera::FREE_LOOK); // camera orientation based solely on actor
@@ -364,7 +361,9 @@ void BloomView::AllocateResources()
     // Create render targets
 
     // create off screen buffer of new size to render our child actors to
-    mRenderTargetForRenderingChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+    mRenderTargetForRenderingChildren = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+    Texture textureForChildren = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+    mRenderTargetForRenderingChildren.AttachColorTexture( textureForChildren );
 
     mBloomExtractTarget = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
     Texture texture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight) );
@@ -374,34 +373,33 @@ void BloomView::AllocateResources()
     texture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mDownsampledWidth), unsigned(mDownsampledHeight) );
     blurExtractTarget.AttachColorTexture( texture );
 
-    mOutputRenderTarget = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+    mOutputRenderTarget = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+    Texture outputTexture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+    mOutputRenderTarget.AttachColorTexture( outputTexture );
 
     //////////////////////////////////////////////////////
     // Point actors and render tasks at new render targets
 
-    mBloomExtractImageView.SetImage( mRenderTargetForRenderingChildren );
-    mBloomExtractImageView.SetSize(mDownsampledWidth, mDownsampledHeight); // size needs to match render target
-    // Create shader used for extracting the bright parts of an image
-    Property::Map customShader;
-    customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = BLOOM_EXTRACT_FRAGMENT_SOURCE;
-    Property::Map visualMap;
-    visualMap.Insert( Toolkit::Visual::Property::SHADER, customShader );
-    mBloomExtractImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
+    Renderer bloomRenderer = CreateRenderer( BASIC_VERTEX_SOURCE, BLOOM_EXTRACT_FRAGMENT_SOURCE );
+    SetRendererTexture( bloomRenderer, mRenderTargetForRenderingChildren );
+    mBloomExtractActor.AddRenderer( bloomRenderer );
+    mBloomExtractActor.SetSize( mDownsampledWidth, mDownsampledHeight ); // size needs to match render target
 
     // set GaussianBlurView to blur our extracted bloom
     mGaussianBlurView.SetUserImageAndOutputRenderTarget( mBloomExtractTarget.GetColorTexture(), blurExtractTarget );
 
     // use the completed blur in the first buffer and composite with the original child actors render
-    mCompositeImageView.SetImage( mRenderTargetForRenderingChildren );
-    // Create shader used to composite bloom and original image to output render target
-    customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = COMPOSITE_FRAGMENT_SOURCE;
-    visualMap[ Toolkit::Visual::Property::SHADER ] = customShader;
-    mCompositeImageView.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
-    TextureSet textureSet = mCompositeImageView.GetRendererAt(0).GetTextures();
+    Renderer compositeRenderer = CreateRenderer( BASIC_VERTEX_SOURCE, COMPOSITE_FRAGMENT_SOURCE );
+    SetRendererTexture( compositeRenderer, mRenderTargetForRenderingChildren );
+    TextureSet textureSet = compositeRenderer.GetTextures();
+    textureSet.SetTexture( 0u, mRenderTargetForRenderingChildren.GetColorTexture() );
     textureSet.SetTexture( 1u, blurExtractTarget.GetColorTexture() );
+    mCompositeActor.AddRenderer( compositeRenderer );
 
     // set up target actor for rendering result, i.e. the blurred image
-    mTargetImageView.SetImage(mOutputRenderTarget);
+    Renderer targetRenderer = CreateRenderer( BASIC_VERTEX_SOURCE, BASIC_FRAGMENT_SOURCE );
+    SetRendererTexture( targetRenderer, mOutputRenderTarget );
+    mTargetActor.AddRenderer( targetRenderer );
   }
 }
 
@@ -416,11 +414,11 @@ void BloomView::CreateRenderTasks()
   mRenderChildrenTask.SetInputEnabled( false );
   mRenderChildrenTask.SetClearEnabled( true );
   mRenderChildrenTask.SetCameraActor(mRenderFullSizeCamera); // use camera that covers render target exactly
-  mRenderChildrenTask.SetTargetFrameBuffer( mRenderTargetForRenderingChildren );
+  mRenderChildrenTask.SetFrameBuffer( mRenderTargetForRenderingChildren );
 
   // Extract the bright part of the image and render to a new buffer. Downsampling also occurs at this stage to save pixel fill, if it is set up.
   mBloomExtractTask = taskList.CreateTask();
-  mBloomExtractTask.SetSourceActor( mBloomExtractImageView );
+  mBloomExtractTask.SetSourceActor( mBloomExtractActor );
   mBloomExtractTask.SetExclusive(true);
   mBloomExtractTask.SetInputEnabled( false );
   mBloomExtractTask.SetClearEnabled( true );
@@ -432,12 +430,12 @@ void BloomView::CreateRenderTasks()
 
   // Use an image view displaying the children render and composite it with the blurred bloom buffer, targeting the output
   mCompositeTask = taskList.CreateTask();
-  mCompositeTask.SetSourceActor( mCompositeImageView );
+  mCompositeTask.SetSourceActor( mCompositeActor );
   mCompositeTask.SetExclusive(true);
   mCompositeTask.SetInputEnabled( false );
   mCompositeTask.SetClearEnabled( true );
   mCompositeTask.SetCameraActor(mRenderFullSizeCamera);
-  mCompositeTask.SetTargetFrameBuffer( mOutputRenderTarget );
+  mCompositeTask.SetFrameBuffer( mOutputRenderTarget );
 }
 
 void BloomView::RemoveRenderTasks()
@@ -471,9 +469,9 @@ void BloomView::Deactivate()
   mOutputRenderTarget.Reset();
 
   // Reset children
-  mBloomExtractImageView.SetImage( "" );
-  mTargetImageView.SetImage( "" );
-  mCompositeImageView.SetImage( "" );
+  mBloomExtractActor.RemoveRenderer( 0u );
+  mTargetActor.RemoveRenderer( 0u );
+  mCompositeActor.RemoveRenderer( 0u );
 
   mGaussianBlurView.SetVisible( false );
 
@@ -506,19 +504,19 @@ void BloomView::SetupProperties()
   // bloom threshold
 
   // set defaults, makes sure properties are registered with shader
-  mBloomExtractImageView.RegisterProperty( BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT );
-  mBloomExtractImageView.RegisterProperty( RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME, 1.0f / (1.0f - BLOOM_THRESHOLD_DEFAULT) );
+  mBloomExtractActor.RegisterProperty( BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT );
+  mBloomExtractActor.RegisterProperty( RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME, 1.0f / (1.0f - BLOOM_THRESHOLD_DEFAULT) );
 
   // Register a property that the user can control to change the bloom threshold
   mBloomThresholdPropertyIndex = self.RegisterProperty(BLOOM_THRESHOLD_PROPERTY_NAME, BLOOM_THRESHOLD_DEFAULT);
-  Property::Index shaderBloomThresholdPropertyIndex = mBloomExtractImageView.GetPropertyIndex(BLOOM_THRESHOLD_PROPERTY_NAME);
-  Constraint bloomThresholdConstraint = Constraint::New<float>( mBloomExtractImageView, shaderBloomThresholdPropertyIndex, EqualToConstraint());
+  Property::Index shaderBloomThresholdPropertyIndex = mBloomExtractActor.GetPropertyIndex(BLOOM_THRESHOLD_PROPERTY_NAME);
+  Constraint bloomThresholdConstraint = Constraint::New<float>( mBloomExtractActor, shaderBloomThresholdPropertyIndex, EqualToConstraint());
   bloomThresholdConstraint.AddSource( Source(self, mBloomThresholdPropertyIndex) );
   bloomThresholdConstraint.Apply();
 
   // precalc 1.0 / (1.0 - threshold) on CPU to save shader insns, using constraint to tie to the normal threshold property
-  Property::Index shaderRecipOneMinusBloomThresholdPropertyIndex = mBloomExtractImageView.GetPropertyIndex(RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME);
-  Constraint thresholdConstraint = Constraint::New<float>( mBloomExtractImageView, shaderRecipOneMinusBloomThresholdPropertyIndex, RecipOneMinusConstraint());
+  Property::Index shaderRecipOneMinusBloomThresholdPropertyIndex = mBloomExtractActor.GetPropertyIndex(RECIP_ONE_MINUS_BLOOM_THRESHOLD_PROPERTY_NAME);
+  Constraint thresholdConstraint = Constraint::New<float>( mBloomExtractActor, shaderRecipOneMinusBloomThresholdPropertyIndex, RecipOneMinusConstraint());
   thresholdConstraint.AddSource( LocalSource(shaderBloomThresholdPropertyIndex) );
   thresholdConstraint.Apply();
 
@@ -538,9 +536,9 @@ void BloomView::SetupProperties()
 
   // Register a property that the user can control to fade the bloom intensity via internally hidden shader
   mBloomIntensityPropertyIndex = self.RegisterProperty(BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT);
-  mCompositeImageView.RegisterProperty( BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT );
-  Property::Index shaderBloomIntensityPropertyIndex = mCompositeImageView.GetPropertyIndex(BLOOM_INTENSITY_PROPERTY_NAME);
-  Constraint bloomIntensityConstraint = Constraint::New<float>( mCompositeImageView, shaderBloomIntensityPropertyIndex, EqualToConstraint());
+  mCompositeActor.RegisterProperty( BLOOM_INTENSITY_PROPERTY_NAME, BLOOM_INTENSITY_DEFAULT );
+  Property::Index shaderBloomIntensityPropertyIndex = mCompositeActor.GetPropertyIndex(BLOOM_INTENSITY_PROPERTY_NAME);
+  Constraint bloomIntensityConstraint = Constraint::New<float>( mCompositeActor, shaderBloomIntensityPropertyIndex, EqualToConstraint());
   bloomIntensityConstraint.AddSource( Source(self, mBloomIntensityPropertyIndex) );
   bloomIntensityConstraint.Apply();
 
@@ -550,9 +548,9 @@ void BloomView::SetupProperties()
 
   // Register a property that the user can control to fade the bloom saturation via internally hidden shader
   mBloomSaturationPropertyIndex = self.RegisterProperty(BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT);
-  mCompositeImageView.RegisterProperty( BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT );
-  Property::Index shaderBloomSaturationPropertyIndex = mCompositeImageView.GetPropertyIndex(BLOOM_SATURATION_PROPERTY_NAME);
-  Constraint bloomSaturationConstraint = Constraint::New<float>( mCompositeImageView, shaderBloomSaturationPropertyIndex, EqualToConstraint());
+  mCompositeActor.RegisterProperty( BLOOM_SATURATION_PROPERTY_NAME, BLOOM_SATURATION_DEFAULT );
+  Property::Index shaderBloomSaturationPropertyIndex = mCompositeActor.GetPropertyIndex(BLOOM_SATURATION_PROPERTY_NAME);
+  Constraint bloomSaturationConstraint = Constraint::New<float>( mCompositeActor, shaderBloomSaturationPropertyIndex, EqualToConstraint());
   bloomSaturationConstraint.AddSource( Source(self, mBloomSaturationPropertyIndex) );
   bloomSaturationConstraint.Apply();
 
@@ -562,9 +560,9 @@ void BloomView::SetupProperties()
 
   // Register a property that the user can control to fade the image intensity via internally hidden shader
   mImageIntensityPropertyIndex = self.RegisterProperty(IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT);
-  mCompositeImageView.RegisterProperty( IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT );
-  Property::Index shaderImageIntensityPropertyIndex = mCompositeImageView.GetPropertyIndex(IMAGE_INTENSITY_PROPERTY_NAME);
-  Constraint imageIntensityConstraint = Constraint::New<float>( mCompositeImageView, shaderImageIntensityPropertyIndex, EqualToConstraint());
+  mCompositeActor.RegisterProperty( IMAGE_INTENSITY_PROPERTY_NAME, IMAGE_INTENSITY_DEFAULT );
+  Property::Index shaderImageIntensityPropertyIndex = mCompositeActor.GetPropertyIndex(IMAGE_INTENSITY_PROPERTY_NAME);
+  Constraint imageIntensityConstraint = Constraint::New<float>( mCompositeActor, shaderImageIntensityPropertyIndex, EqualToConstraint());
   imageIntensityConstraint.AddSource( Source(self, mImageIntensityPropertyIndex) );
   imageIntensityConstraint.Apply();
 
@@ -574,9 +572,9 @@ void BloomView::SetupProperties()
 
   // Register a property that the user can control to fade the image saturation via internally hidden shader
   mImageSaturationPropertyIndex = self.RegisterProperty(IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT);
-  mCompositeImageView.RegisterProperty( IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT );
-  Property::Index shaderImageSaturationPropertyIndex = mCompositeImageView.GetPropertyIndex(IMAGE_SATURATION_PROPERTY_NAME);
-  Constraint imageSaturationConstraint = Constraint::New<float>( mCompositeImageView, shaderImageSaturationPropertyIndex, EqualToConstraint());
+  mCompositeActor.RegisterProperty( IMAGE_SATURATION_PROPERTY_NAME, IMAGE_SATURATION_DEFAULT );
+  Property::Index shaderImageSaturationPropertyIndex = mCompositeActor.GetPropertyIndex(IMAGE_SATURATION_PROPERTY_NAME);
+  Constraint imageSaturationConstraint = Constraint::New<float>( mCompositeActor, shaderImageSaturationPropertyIndex, EqualToConstraint());
   imageSaturationConstraint.AddSource( Source(self, mImageSaturationPropertyIndex) );
   imageSaturationConstraint.Apply();
 }
index 71ed4c7..0377146 100644 (file)
@@ -23,7 +23,7 @@
 #include <cmath>
 #include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/render-tasks/render-task.h>
-#include <dali/public-api/images/frame-buffer-image.h>
+#include <dali/public-api/rendering/frame-buffer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -133,14 +133,14 @@ private:
 
   /////////////////////////////////////////////////////////////
   // for rendering all user added children to offscreen target
-  FrameBufferImage mRenderTargetForRenderingChildren;
+  FrameBuffer mRenderTargetForRenderingChildren;
   RenderTask mRenderChildrenTask;
 
   /////////////////////////////////////////////////////////////
   // for extracting bright parts of image to an offscreen target
   FrameBuffer mBloomExtractTarget; // for rendering bright parts of image into separate texture, also used as target for gaussian blur
   RenderTask mBloomExtractTask;
-  Toolkit::ImageView mBloomExtractImageView;
+  Actor mBloomExtractActor;
 
   /////////////////////////////////////////////////////////////
   // for blurring extracted bloom
@@ -150,12 +150,12 @@ private:
   // for compositing bloom and children renders to offscreen target
   RenderTask mCompositeTask;
 
-  Toolkit::ImageView mCompositeImageView;
+  Actor mCompositeActor;
 
   /////////////////////////////////////////////////////////////
   // for holding blurred result
-  FrameBufferImage mOutputRenderTarget;
-  Toolkit::ImageView mTargetImageView;
+  FrameBuffer mOutputRenderTarget;
+  Actor mTargetActor;
 
   /////////////////////////////////////////////////////////////
   // Properties for setting by user, e.g. by animations
diff --git a/dali-toolkit/internal/controls/control/control-renderers.cpp b/dali-toolkit/internal/controls/control/control-renderers.cpp
new file mode 100644 (file)
index 0000000..052d822
--- /dev/null
@@ -0,0 +1,190 @@
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// INTERNAL INCLUDES
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+
+#define DALI_COMPOSE_SHADER(STR) #STR
+
+const char * const BASIC_VERTEX_SOURCE = DALI_COMPOSE_SHADER(
+  precision mediump float;\n
+  attribute mediump vec2 aPosition;\n
+  varying mediump vec2 vTexCoord;\n
+  uniform mediump mat4 uMvpMatrix;\n
+  uniform mediump vec3 uSize;\n
+  \n
+  void main()\n
+  {\n
+    mediump vec4 vertexPosition = vec4(aPosition * uSize.xy, 0.0, 1.0);\n
+    vTexCoord = aPosition + vec2(0.5);
+    gl_Position = uMvpMatrix * vertexPosition;\n
+  }\n
+);
+
+const char * const BASIC_FRAGMENT_SOURCE = DALI_COMPOSE_SHADER(
+  precision mediump float;\n
+  varying mediump vec2 vTexCoord;\n
+  uniform sampler2D sTexture;\n
+  uniform vec4 uColor;\n
+  \n
+  void main()\n
+  {\n
+    gl_FragColor = texture2D(sTexture, vTexCoord);\n
+    gl_FragColor *= uColor;
+  }\n
+);
+
+Geometry CreateGridGeometry( Uint16Pair gridSize )
+{
+  uint16_t gridWidth = gridSize.GetWidth();
+  uint16_t gridHeight = gridSize.GetHeight();
+
+  // Create vertices
+  Vector< Vector2 > vertices;
+  vertices.Reserve( ( gridWidth + 1 ) * ( gridHeight + 1 ) );
+
+  for( int y = 0; y < gridHeight + 1; ++y )
+  {
+    for( int x = 0; x < gridWidth + 1; ++x )
+    {
+      vertices.PushBack( Vector2( (float)x/gridWidth - 0.5f, (float)y/gridHeight  - 0.5f) );
+    }
+  }
+
+  // Create indices
+  Vector< unsigned short > indices;
+  indices.Reserve( (gridWidth+2)*gridHeight*2 - 2);
+
+  for( unsigned int row = 0u; row < gridHeight; ++row )
+  {
+    unsigned int rowStartIndex = row*(gridWidth+1u);
+    unsigned int nextRowStartIndex = rowStartIndex + gridWidth +1u;
+
+    if( row != 0u ) // degenerate index on non-first row
+    {
+      indices.PushBack( rowStartIndex );
+    }
+
+    for( unsigned int column = 0u; column < gridWidth+1u; column++) // main strip
+    {
+      indices.PushBack( rowStartIndex + column);
+      indices.PushBack( nextRowStartIndex + column);
+    }
+
+    if( row != gridHeight-1u ) // degenerate index on non-last row
+    {
+      indices.PushBack( nextRowStartIndex + gridWidth );
+    }
+  }
+
+  Property::Map vertexFormat;
+  vertexFormat[ "aPosition" ] = Property::VECTOR2;
+  PropertyBuffer vertexPropertyBuffer = PropertyBuffer::New( vertexFormat );
+  if( vertices.Size() > 0 )
+  {
+    vertexPropertyBuffer.SetData( &vertices[ 0 ], vertices.Size() );
+  }
+
+  // Create the geometry object
+  Geometry geometry = Geometry::New();
+  geometry.AddVertexBuffer( vertexPropertyBuffer );
+  if( indices.Size() > 0 )
+  {
+    geometry.SetIndexBuffer( &indices[ 0 ], indices.Size() );
+  }
+
+  geometry.SetType( Geometry::TRIANGLE_STRIP );
+
+  return geometry;
+}
+
+Dali::Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc )
+{
+  Dali::Shader shader = Dali::Shader::New( vertexSrc, fragmentSrc );
+
+  Dali::Geometry texturedQuadGeometry = Dali::Geometry::New();
+
+  struct VertexPosition { Dali::Vector2 position; };
+  struct VertexTexture { Dali::Vector2 texture; };
+
+  VertexPosition positionArray[] =
+  {
+    { Dali::Vector2( -0.5f, -0.5f ) },
+    { Dali::Vector2(  0.5f, -0.5f ) },
+    { Dali::Vector2( -0.5f,  0.5f ) },
+    { Dali::Vector2(  0.5f,  0.5f ) }
+  };
+  uint32_t numberOfVertices = sizeof(positionArray)/sizeof(VertexPosition);
+
+  Dali::Property::Map positionVertexFormat;
+  positionVertexFormat["aPosition"] = Dali::Property::VECTOR2;
+  Dali::PropertyBuffer positionVertices = Dali::PropertyBuffer::New( positionVertexFormat );
+  positionVertices.SetData( positionArray, numberOfVertices );
+  texturedQuadGeometry.AddVertexBuffer( positionVertices );
+
+  const uint16_t indices[] = { 0, 3, 1, 0, 2, 3 };
+  texturedQuadGeometry.SetIndexBuffer ( &indices[0], sizeof( indices )/ sizeof( indices[0] ) );
+
+  Dali::Renderer renderer = Dali::Renderer::New( texturedQuadGeometry, shader );
+
+  Dali::TextureSet textureSet = Dali::TextureSet::New();
+  renderer.SetTextures( textureSet );
+
+  return renderer;
+}
+
+Dali::Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc, Dali::Shader::Hint::Value hints, Uint16Pair gridSize )
+{
+  Dali::Shader shader = Dali::Shader::New( vertexSrc, fragmentSrc, hints );
+
+  Dali::Geometry gridGeometry = CreateGridGeometry( gridSize );
+
+  Dali::Renderer renderer = Dali::Renderer::New( gridGeometry, shader );
+
+  Dali::TextureSet textureSet = Dali::TextureSet::New();
+  renderer.SetTextures( textureSet );
+
+  return renderer;
+}
+
+void SetRendererTexture( Dali::Renderer renderer, Dali::Texture texture )
+{
+  if( renderer )
+  {
+    Dali::TextureSet textureSet = renderer.GetTextures();
+    textureSet.SetTexture( 0u, texture );
+  }
+}
+
+void SetRendererTexture( Dali::Renderer renderer, Dali::FrameBuffer frameBuffer )
+{
+  if( frameBuffer )
+  {
+    Dali::Texture texture = frameBuffer.GetColorTexture();
+    SetRendererTexture( renderer, texture );
+  }
+}
+
+} // namespace Internal
+} // namespace Toolkit
+} // namespace Dali
diff --git a/dali-toolkit/internal/controls/control/control-renderers.h b/dali-toolkit/internal/controls/control/control-renderers.h
new file mode 100644 (file)
index 0000000..320528c
--- /dev/null
@@ -0,0 +1,68 @@
+#ifndef DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H
+#define DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H
+
+/*
+ * Copyright (c) 2019 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <dali/dali.h>
+
+namespace Dali
+{
+namespace Toolkit
+{
+namespace Internal
+{
+
+extern const char* const BASIC_VERTEX_SOURCE;
+
+extern const char* const BASIC_FRAGMENT_SOURCE;
+
+/**
+ * Helper method for rendering an image with custom shader.
+ * @param[in] vertextSrc The custom vertex shader.
+ * @param[in] fragmentSrc The custom fragment shader.
+ * @return A newly created renderer.
+ */
+Dali::Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc );
+
+/**
+ * Helper method for rendering an image with custom shader.
+ * @param[in] vertextSrc The custom vertex shader.
+ * @param[in] fragmentSrc The custom fragment shader.
+ * @param[in] gridSize The number of grid sub-divisions required.
+ * @return A newly created renderer.
+ */
+Dali::Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc, Dali::Shader::Hint::Value hints, Dali::Uint16Pair gridSize );
+
+/**
+ * Helper method for setting the first texture passed to a renderer.
+ * @param[in] renderer The renderer using the texture.
+ * @param[in] texture The texture to set.
+ */
+void SetRendererTexture( Dali::Renderer renderer, Dali::Texture texture );
+
+/**
+ * Helper method for setting the first texture passed to a renderer.
+ * @param[in] renderer The renderer using the texture.
+ * @param[in] framebuffer A frame buffer color texture attached.
+ */
+void SetRendererTexture( Dali::Renderer renderer, Dali::FrameBuffer frameBuffer );
+
+} // namespace Internal
+} // namespace Toolkit
+} // namespace Dali
+
+#endif // DALI_TOOLKIT_INTERNAL_CONTROL_RENDERERS_H
index d2e188d..0c34673 100644 (file)
 #include <dali/public-api/object/type-registry-helper.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/rendering/renderer.h>
-#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/visuals/visual-properties.h>
 #include <dali-toolkit/devel-api/controls/control-depth-index-ranges.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 #include <dali-toolkit/internal/filters/blur-two-pass-filter.h>
 #include <dali-toolkit/internal/filters/emboss-filter.h>
 #include <dali-toolkit/internal/filters/spread-filter.h>
-#include <dali-toolkit/internal/visuals/visual-base-impl.h>
-#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 
 namespace Dali
 {
@@ -69,10 +65,6 @@ const float         ARBITRARY_FIELD_OF_VIEW = Math::PI / 4.0f;
 const Vector4       EFFECTS_VIEW_DEFAULT_BACKGROUND_COLOR( 0.0f, 0.0f, 0.0f, 0.0 );
 const bool          EFFECTS_VIEW_REFRESH_ON_DEMAND(false);
 
-// Visuals are not stylable or public
-const Property::Index CHILD_VISUAL( Toolkit::EffectsView::ANIMATABLE_PROPERTY_START_INDEX - 1);
-const Property::Index POST_FILTER_VISUAL( CHILD_VISUAL-1 );
-
 #define DALI_COMPOSE_SHADER(STR) #STR
 
 const char* EFFECTS_VIEW_VERTEX_SOURCE = DALI_COMPOSE_SHADER(
@@ -153,7 +145,7 @@ EffectsView::EffectsView()
   mEffectType( Toolkit::EffectsView::INVALID_TYPE ),
   mPixelFormat( EFFECTS_VIEW_DEFAULT_PIXEL_FORMAT ),
   mEnabled( false ),
-  mRefreshOnDemand(EFFECTS_VIEW_REFRESH_ON_DEMAND)
+  mRefreshOnDemand( EFFECTS_VIEW_REFRESH_ON_DEMAND )
 {
 }
 
@@ -191,16 +183,6 @@ void EffectsView::SetType( Toolkit::EffectsView::EffectType type )
       }
     }
 
-    FrameBufferImage dummyImage = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
-
-    Internal::InitializeVisual( self, mVisualPostFilter, dummyImage );
-    DevelControl::RegisterVisual( *this, POST_FILTER_VISUAL, mVisualPostFilter );
-
-    Property::Map customShader;
-    customShader[ Toolkit::Visual::Shader::Property::VERTEX_SHADER ] = EFFECTS_VIEW_VERTEX_SOURCE;
-    customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = EFFECTS_VIEW_FRAGMENT_SOURCE;
-    Toolkit::GetImplementation( mVisualPostFilter ).SetCustomShader( customShader );
-
     mEffectType = type;
   }
 }
@@ -221,7 +203,6 @@ void EffectsView::Enable()
 void EffectsView::Disable()
 {
   // stop render tasks processing
-  // Note: render target resources are automatically freed since we set the Image::Unused flag
   RemoveRenderTasks();
   mLastSize = Vector2::ZERO; // Ensure resources are reallocated on subsequent enable
   mEnabled = false;
@@ -309,6 +290,17 @@ void EffectsView::OnSizeSet(const Vector3& targetSize)
 
 void EffectsView::OnStageConnection( int depth )
 {
+  Actor self( Self() );
+
+  // Create renderers
+  mRendererPostFilter = CreateRenderer( EFFECTS_VIEW_VERTEX_SOURCE, EFFECTS_VIEW_FRAGMENT_SOURCE );
+  mRendererPostFilter.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, DepthIndex::CONTENT );
+  self.AddRenderer( mRendererPostFilter );
+
+  mRendererForChildren = CreateRenderer( BASIC_VERTEX_SOURCE, BASIC_FRAGMENT_SOURCE );
+  mRendererForChildren.SetProperty( Dali::Renderer::Property::DEPTH_INDEX, DepthIndex::CONTENT + 1 );
+  self.AddRenderer( mRendererForChildren );
+
   Enable();
 
   Control::OnStageConnection( depth );
@@ -316,6 +308,8 @@ void EffectsView::OnStageConnection( int depth )
 
 void EffectsView::OnStageDisconnection()
 {
+  Actor self( Self() );
+
   Disable();
 
   const size_t numFilters( mFilters.Size() );
@@ -324,6 +318,13 @@ void EffectsView::OnStageDisconnection()
     mFilters[i]->Disable();
   }
 
+  // Remove renderers
+  self.RemoveRenderer( mRendererForChildren );
+  mRendererForChildren.Reset();
+
+  self.RemoveRenderer( mRendererPostFilter );
+  mRendererPostFilter.Reset();
+
   Control::OnStageDisconnection();
 }
 
@@ -351,8 +352,8 @@ void EffectsView::SetupFilters()
     case Toolkit::EffectsView::DROP_SHADOW:
     {
       SpreadFilter* spreadFilter = static_cast< SpreadFilter* >( mFilters[0] );
-      spreadFilter->SetInputImage( mImageForChildren );
-      spreadFilter->SetOutputImage( mImagePostFilter );
+      spreadFilter->SetInputTexture( mFrameBufferForChildren.GetColorTexture() );
+      spreadFilter->SetOutputFrameBuffer( mFrameBufferPostFilter );
       spreadFilter->SetRootActor( mChildrenRoot );
       spreadFilter->SetBackgroundColor( mBackgroundColor );
       spreadFilter->SetPixelFormat( mPixelFormat );
@@ -360,8 +361,8 @@ void EffectsView::SetupFilters()
       spreadFilter->SetSpread( mEffectSize );
 
       BlurTwoPassFilter* blurFilter = static_cast< BlurTwoPassFilter* >( mFilters[1] );
-      blurFilter->SetInputImage( mImagePostFilter );
-      blurFilter->SetOutputImage( mImagePostFilter );
+      blurFilter->SetInputTexture( mFrameBufferPostFilter.GetColorTexture() );
+      blurFilter->SetOutputFrameBuffer( mFrameBufferPostFilter );
       blurFilter->SetRootActor( mChildrenRoot );
       blurFilter->SetBackgroundColor( mBackgroundColor );
       blurFilter->SetPixelFormat( mPixelFormat );
@@ -384,8 +385,8 @@ void EffectsView::SetupFilters()
     case Toolkit::EffectsView::EMBOSS:
     {
       SpreadFilter* spreadFilter = static_cast< SpreadFilter* >( mFilters[0] );
-      spreadFilter->SetInputImage( mImageForChildren );
-      spreadFilter->SetOutputImage( mImagePostFilter );
+      spreadFilter->SetInputTexture( mFrameBufferForChildren.GetColorTexture() );
+      spreadFilter->SetOutputFrameBuffer( mFrameBufferPostFilter );
       spreadFilter->SetRootActor( mChildrenRoot );
       spreadFilter->SetBackgroundColor( mBackgroundColor );
       spreadFilter->SetPixelFormat( Pixel::RGBA8888 );
@@ -393,16 +394,16 @@ void EffectsView::SetupFilters()
       spreadFilter->SetSpread( mEffectSize );
 
       EmbossFilter* embossFilter = static_cast< EmbossFilter* >( mFilters[1] );
-      embossFilter->SetInputImage( mImagePostFilter );
-      embossFilter->SetOutputImage( mImagePostFilter );
+      embossFilter->SetInputTexture( mFrameBufferPostFilter.GetColorTexture() );
+      embossFilter->SetOutputFrameBuffer( mFrameBufferPostFilter );
       embossFilter->SetRootActor( mChildrenRoot );
       embossFilter->SetBackgroundColor( mBackgroundColor );
       embossFilter->SetPixelFormat( Pixel::RGBA8888 );
       embossFilter->SetSize( mTargetSize );
 
       BlurTwoPassFilter* blurFilter = static_cast< BlurTwoPassFilter* >( mFilters[2] );
-      blurFilter->SetInputImage( mImagePostFilter );
-      blurFilter->SetOutputImage( mImagePostFilter );
+      blurFilter->SetInputTexture( mFrameBufferPostFilter.GetColorTexture() );
+      blurFilter->SetOutputFrameBuffer( mFrameBufferPostFilter );
       blurFilter->SetRootActor( mChildrenRoot );
       blurFilter->SetBackgroundColor( Vector4( 0.5f, 0.5f, 0.5f, 0.0 ) );
       blurFilter->SetPixelFormat( Pixel::RGBA8888 );
@@ -417,6 +418,7 @@ void EffectsView::SetupFilters()
     }
   }
 }
+
 void EffectsView::AllocateResources()
 {
   if(mTargetSize != mLastSize)
@@ -426,15 +428,17 @@ void EffectsView::AllocateResources()
 
     Actor self( Self() );
 
-    mImageForChildren = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
-    Internal::InitializeVisual( self, mVisualForChildren, mImageForChildren );
-    DevelControl::RegisterVisual( *this, CHILD_VISUAL, mVisualForChildren, DepthIndex::CONTENT + 1 );
+    mFrameBufferForChildren = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+    Texture textureForChildren = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+    mFrameBufferForChildren.AttachColorTexture( textureForChildren );
+
+    SetRendererTexture( mRendererForChildren, textureForChildren );
+
+    mFrameBufferPostFilter = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+    Texture texturePostFilter = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+    mFrameBufferPostFilter.AttachColorTexture( texturePostFilter );
 
-    mImagePostFilter = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
-    TextureSet textureSet = TextureSet::New();
-    TextureSetImage( textureSet, 0u,  mImagePostFilter );
-    self.GetRendererAt( 0 ).SetTextures( textureSet );
-    mVisualPostFilter.SetDepthIndex( DepthIndex::CONTENT );
+    SetRendererTexture( mRendererPostFilter, texturePostFilter );
 
     SetupFilters();
   }
@@ -479,7 +483,7 @@ void EffectsView::CreateRenderTasks()
   mRenderTaskForChildren.SetInputEnabled( false );
   mRenderTaskForChildren.SetClearColor( mBackgroundColor );
   mRenderTaskForChildren.SetClearEnabled( true );
-  mRenderTaskForChildren.SetTargetFrameBuffer( mImageForChildren );
+  mRenderTaskForChildren.SetFrameBuffer( mFrameBufferForChildren );
   mRenderTaskForChildren.SetCameraActor(mCameraForChildren); // use camera that covers render target exactly
 
   // Enable image filters
index 54527d3..0703f63 100644 (file)
 #include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/common/dali-vector.h>
 #include <dali/public-api/render-tasks/render-task.h>
+#include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/public-api/rendering/renderer.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/devel-api/controls/effects-view/effects-view.h>
 #include <dali-toolkit/public-api/controls/control-impl.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
 
 namespace Dali
 {
@@ -57,15 +58,6 @@ public:
   EffectsView();
 
   /**
-   * Constructor.
-   * @copydoc Toolkit::EffectsView New(const unsigned int,const float,const Pixel::Format,const float,const float)
-   */
-  EffectsView(const unsigned int numSamples, const float blurBellCurveWidth, const int spread,
-              const Pixel::Format pixelFormat,
-              const float downsampleWidthScale, const float downsampleHeightScale,
-              FrameBufferImage image);
-
-  /**
    * A reference counted object may only be deleted by calling Unreference()
    */
   virtual ~EffectsView();
@@ -214,8 +206,8 @@ private: // attributes/properties
 
   /////////////////////////////////////////////////////////////
   // for rendering all user added children to offscreen target
-  FrameBufferImage      mImageForChildren;
-  Toolkit::Visual::Base mVisualForChildren;
+  FrameBuffer           mFrameBufferForChildren;
+  Renderer              mRendererForChildren;
   RenderTask            mRenderTaskForChildren;
   CameraActor           mCameraForChildren;
   Actor                 mChildrenRoot; // for creating a subtree for all user added child actors
@@ -230,8 +222,8 @@ private: // attributes/properties
   Vector2 mLastSize;
   /////////////////////////////////////////////////////////////
   // post blur image
-  FrameBufferImage      mImagePostFilter;
-  Toolkit::Visual::Base mVisualPostFilter;
+  FrameBuffer           mFrameBufferPostFilter;
+  Renderer              mRendererPostFilter;
 
   Vector<ImageFilter*> mFilters;
 
index 987acbe..d83ed24 100644 (file)
@@ -35,6 +35,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 
 // TODO:
 // pixel format / size - set from JSON
@@ -100,37 +101,6 @@ const float GAUSSIAN_BLUR_VIEW_DEFAULT_DOWNSAMPLE_HEIGHT_SCALE = 0.5f;
 
 const float ARBITRARY_FIELD_OF_VIEW = Math::PI / 4.0f;
 
-#define DALI_COMPOSE_SHADER(STR) #STR
-
-const char * const BASIC_VERTEX_SOURCE = DALI_COMPOSE_SHADER(
-  precision mediump float;\n
-  attribute mediump vec2 aPosition;\n
-  attribute mediump vec2 aTexture;\n
-  varying mediump vec2 vTexCoord;\n
-  uniform mediump mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
-  \n
-  void main()\n
-  {\n
-    mediump vec4 vertexPosition = vec4(aPosition * uSize.xy, 0.0, 1.0);\n
-    vTexCoord = aTexture;\n
-    gl_Position = uMvpMatrix * vertexPosition;\n
-  }\n
-);
-
-const char * const BASIC_FRAGMENT_SOURCE = DALI_COMPOSE_SHADER(
-  precision mediump float;\n
-  varying mediump vec2 vTexCoord;\n
-  uniform sampler2D sTexture;\n
-  uniform vec4 uColor;\n
-  \n
-  void main()\n
-  {\n
-    gl_FragColor = texture2D(sTexture, vTexCoord);\n
-    gl_FragColor *= uColor;
-  }\n
-);
-
 const char* const GAUSSIAN_BLUR_FRAGMENT_SOURCE = DALI_COMPOSE_SHADER(
     varying mediump vec2 vTexCoord;\n
     uniform sampler2D sTexture;\n
@@ -149,72 +119,6 @@ const char* const GAUSSIAN_BLUR_FRAGMENT_SOURCE = DALI_COMPOSE_SHADER(
     }\n
 );
 
-Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc )
-{
-  Shader shader = Shader::New( vertexSrc, fragmentSrc );
-
-  Geometry texturedQuadGeometry = Geometry::New();
-
-  struct VertexPosition { Vector2 position; };
-  struct VertexTexture { Vector2 texture; };
-
-  VertexPosition positionArray[] =
-  {
-    { Vector2( -0.5f, -0.5f ) },
-    { Vector2(  0.5f, -0.5f ) },
-    { Vector2( -0.5f,  0.5f ) },
-    { Vector2(  0.5f,  0.5f ) }
-  };
-  uint32_t numberOfVertices = sizeof(positionArray)/sizeof(VertexPosition);
-
-  VertexTexture uvArray[] =
-  {
-    { Vector2( 0.0f, 0.0f ) },
-    { Vector2( 1.0f, 0.0f ) },
-    { Vector2( 0.0f, 1.0f ) },
-    { Vector2( 1.0f, 1.0f ) }
-  };
-
-  Property::Map positionVertexFormat;
-  positionVertexFormat["aPosition"] = Property::VECTOR2;
-  PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat );
-  positionVertices.SetData( positionArray, numberOfVertices );
-  texturedQuadGeometry.AddVertexBuffer( positionVertices );
-
-  Property::Map textureVertexFormat;
-  textureVertexFormat["aTexture"] = Property::VECTOR2;
-  PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat );
-  textureVertices.SetData( uvArray, numberOfVertices );
-  texturedQuadGeometry.AddVertexBuffer( textureVertices );
-
-  const uint16_t indices[] = { 0, 3, 1, 0, 2, 3 };
-  texturedQuadGeometry.SetIndexBuffer ( &indices[0], sizeof( indices )/ sizeof( indices[0] ) );
-
-  Renderer renderer = Renderer::New( texturedQuadGeometry, shader );
-
-  TextureSet textureSet = TextureSet::New();
-  renderer.SetTextures( textureSet );
-
-  return renderer;
-}
-
-void SetTexture( Actor actor, Texture texture )
-{
-  if( Renderer renderer = actor.GetRendererAt(0) )
-  {
-    TextureSet textureSet = renderer.GetTextures();
-    textureSet.SetTexture( 0u, texture );
-  }
-}
-
-void SetTexture( Actor actor, FrameBuffer frameBuffer )
-{
-  if( frameBuffer )
-  {
-    SetTexture( actor, frameBuffer.GetColorTexture() );
-  }
-}
-
 } // namespace
 
 
@@ -322,7 +226,7 @@ void GaussianBlurView::SetUserImageAndOutputRenderTarget(Texture inputImage, Fra
 
   mUserInputImage = inputImage;
 
-  SetTexture( mHorizBlurActor, inputImage );
+  SetRendererTexture( mHorizBlurActor.GetRendererAt(0), inputImage );
 
   mUserOutputRenderTarget = outputRenderTarget;
 }
@@ -519,7 +423,7 @@ void GaussianBlurView::AllocateResources()
       mRenderTargetForRenderingChildren.AttachColorTexture( texture );
 
       // Set actor for performing a horizontal blur
-      SetTexture( mHorizBlurActor, mRenderTargetForRenderingChildren );
+      SetRendererTexture( mHorizBlurActor.GetRendererAt(0), mRenderTargetForRenderingChildren );
 
       // Create offscreen buffer for vert blur pass
       mRenderTarget1 = FrameBuffer::New( mDownsampledWidth, mDownsampledHeight, FrameBuffer::Attachment::NONE );
@@ -527,10 +431,10 @@ void GaussianBlurView::AllocateResources()
       mRenderTarget1.AttachColorTexture( texture );
 
       // use the completed blur in the first buffer and composite with the original child actors render
-      SetTexture( mCompositingActor, mRenderTarget1 );
+      SetRendererTexture( mCompositingActor.GetRendererAt(0), mRenderTarget1 );
 
       // set up target actor for rendering result, i.e. the blurred image
-      SetTexture( mTargetActor, mRenderTargetForRenderingChildren );
+      SetRendererTexture( mTargetActor.GetRendererAt(0), mRenderTargetForRenderingChildren );
     }
 
     // Create offscreen buffer for horiz blur pass
@@ -543,7 +447,7 @@ void GaussianBlurView::AllocateResources()
 
     // size needs to match render target
     mVertBlurActor.SetSize(mDownsampledWidth, mDownsampledHeight);
-    SetTexture( mVertBlurActor, mRenderTarget2 );
+    SetRendererTexture( mVertBlurActor.GetRendererAt(0), mRenderTarget2 );
 
     // set gaussian blur up for new sized render targets
     SetShaderConstants();
index 290cdf2..5bc97dc 100644 (file)
@@ -39,18 +39,18 @@ DALI_TYPE_REGISTRATION_END()
 
 }
 
-PageTurnLandscapeView::PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& pageSize )
-: PageTurnView( pageFactory, pageSize )
+PageTurnLandscapeView::PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& viewPageSize )
+: PageTurnView( pageFactory, viewPageSize )
 {
 }
 
 PageTurnLandscapeView::~PageTurnLandscapeView()
 {}
 
-Toolkit::PageTurnLandscapeView PageTurnLandscapeView::New( PageFactory& pageFactory, const Vector2& pageSize )
+Toolkit::PageTurnLandscapeView PageTurnLandscapeView::New( PageFactory& pageFactory, const Vector2& viewPageSize )
 {
   // Create the implementation, temporarily owned on stack
-  IntrusivePtr< PageTurnLandscapeView > internalPageTurnView = new PageTurnLandscapeView( pageFactory, pageSize );
+  IntrusivePtr< PageTurnLandscapeView > internalPageTurnView = new PageTurnLandscapeView( pageFactory, viewPageSize );
 
   // Pass ownership to CustomActor
   Dali::Toolkit::PageTurnLandscapeView pageTurnView( *internalPageTurnView );
index 4137796..aee1d5e 100644 (file)
@@ -38,16 +38,16 @@ public:
   /**
    * @copydoc Toolkit::PageTurnLandscapeView::New( PageFactory&, const Vector2& )
    */
-  static Toolkit::PageTurnLandscapeView New( PageFactory& pageFactory, const Vector2& pageSize );
+  static Toolkit::PageTurnLandscapeView New( PageFactory& pageFactory, const Vector2& viewPageSize );
 
 protected:
   /**
    * Constructor.
    * It initializes the PageTurnPortraitView members
    * @param[in] pageFactory The factory which provides image to PageTurnView as the page content.
-   * @param[in] pageSize The size of the page
+   * @param[in] viewPageSize The size of the page
    */
-  PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& pageSize );
+  PageTurnLandscapeView( PageFactory& pageFactory, const Vector2& viewPageSize );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
index 25393e9..4bde36a 100644 (file)
@@ -48,8 +48,8 @@ const float PAGE_TURN_OVER_ANIMATION_DURATION(0.5f);
 
 }
 
-PageTurnPortraitView::PageTurnPortraitView( PageFactory& pageFactory, const Vector2& pageSize )
-: PageTurnView( pageFactory, pageSize )
+PageTurnPortraitView::PageTurnPortraitView( PageFactory& pageFactory, const Vector2& viewPageSize )
+: PageTurnView( pageFactory, viewPageSize )
 {
 }
 
@@ -57,10 +57,10 @@ PageTurnPortraitView::~PageTurnPortraitView()
 {
 }
 
-Toolkit::PageTurnPortraitView PageTurnPortraitView::New( PageFactory& pageFactory, const Vector2& pageSize )
+Toolkit::PageTurnPortraitView PageTurnPortraitView::New( PageFactory& pageFactory, const Vector2& viewPageSize )
 {
   // Create the implementation, temporarily owned on stack
-  IntrusivePtr< PageTurnPortraitView > internalPageTurnView = new PageTurnPortraitView( pageFactory, pageSize );
+  IntrusivePtr< PageTurnPortraitView > internalPageTurnView = new PageTurnPortraitView( pageFactory, viewPageSize );
 
   // Pass ownership to CustomActor
   Dali::Toolkit::PageTurnPortraitView pageTurnView( *internalPageTurnView );
index 5e950f8..3cf9ef4 100644 (file)
@@ -41,7 +41,7 @@ public:
   /**
    * @copydoc Toolkit::PageTurnPortraitView::New( PageFactory&, const Vector2& )
    */
-  static Toolkit::PageTurnPortraitView New( PageFactory& pageFactory, const Vector2& pageSize );
+  static Toolkit::PageTurnPortraitView New( PageFactory& pageFactory, const Vector2& viewPageSize );
 
 protected:
 
@@ -49,9 +49,9 @@ protected:
    * Constructor.
    * It initializes the PageTurnPortraitView members
    * @param[in] pageFactory The factory which provides image to PageTurnView as the page content.
-   * @param[in] pageSize The size of the page
+   * @param[in] viewPageSize The size of the page
    */
-  PageTurnPortraitView( PageFactory& pageFactory, const Vector2& pageSize );
+  PageTurnPortraitView( PageFactory& pageFactory, const Vector2& viewPageSize );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
index 0ee82e9..7a00f87 100644 (file)
@@ -51,13 +51,13 @@ const char * const PROPERTY_PAN_CENTER( "panCenter" );// property used to constr
 // default grid density for page turn effect, 20 pixels by 20 pixels
 const float DEFAULT_GRID_DENSITY(20.0f);
 
-// to bent the page, the minimal horizontal pan start position is pageSize.x * MINIMUM_START_POSITION_RATIO
+// to bent the page, the minimal horizontal pan start position is viewPageSize.x * MINIMUM_START_POSITION_RATIO
 const float MINIMUM_START_POSITION_RATIO(0.6f);
 
-// the maximum vertical displacement of pan gesture, if exceed, will reduce it: pageSize.y * MAXIMUM_VERTICAL_MOVEMENT_RATIO
+// the maximum vertical displacement of pan gesture, if exceed, will reduce it: viewPageSize.y * MAXIMUM_VERTICAL_MOVEMENT_RATIO
 const float MAXIMUM_VERTICAL_MOVEMENT_RATIO(0.15f);
 
-// when the x component of pan position reaches pageSize.x * PAGE_TURN_OVER_THRESHOLD_RATIO, page starts to turn over
+// when the x component of pan position reaches viewPageSize.x * PAGE_TURN_OVER_THRESHOLD_RATIO, page starts to turn over
 const float PAGE_TURN_OVER_THRESHOLD_RATIO(0.5f);
 
 // duration of animation, shorter for faster speed
@@ -237,7 +237,7 @@ BaseHandle Create()
 // Setup properties, signals and actions using the type-registry.
 DALI_TYPE_REGISTRATION_BEGIN( Toolkit::PageTurnView, Toolkit::Control, Create );
 
-DALI_PROPERTY_REGISTRATION( Toolkit, PageTurnView, "pageSize",        VECTOR2, PAGE_SIZE )
+DALI_PROPERTY_REGISTRATION( Toolkit, PageTurnView, "viewPageSize",        VECTOR2, VIEW_PAGE_SIZE )
 DALI_PROPERTY_REGISTRATION( Toolkit, PageTurnView, "currentPageId",   INTEGER, CURRENT_PAGE_ID )
 DALI_PROPERTY_REGISTRATION( Toolkit, PageTurnView, "spineShadow",     VECTOR2, SPINE_SHADOW )
 
@@ -340,10 +340,10 @@ void PageTurnView::Page::SetCurrentCenter( const Vector2& value )
   actor.SetProperty( propertyCurrentCenter, value );
 }
 
-PageTurnView::PageTurnView( PageFactory& pageFactory, const Vector2& pageSize )
+PageTurnView::PageTurnView( PageFactory& pageFactory, const Vector2& viewPageSize )
 : Control( ControlBehaviour( CONTROL_BEHAVIOUR_DEFAULT ) ),
   mPageFactory( &pageFactory ),
-  mPageSize( pageSize ),
+  mPageSize( viewPageSize ),
   mSpineShadowParameter( DEFAULT_SPINE_SHADOW_PARAMETER ),
   mDistanceUpCorner( 0.f ),
   mDistanceBottomCorner( 0.f ),
@@ -494,9 +494,9 @@ void PageTurnView::OnStageDisconnection()
   Control::OnStageDisconnection();
 }
 
-void PageTurnView::SetPageSize( const Vector2& pageSize )
+void PageTurnView::SetPageSize( const Vector2& viewPageSize )
 {
-  mPageSize = pageSize;
+  mPageSize = viewPageSize;
 
   if( mPointLight )
   {
@@ -1044,7 +1044,7 @@ void PageTurnView::SetProperty( BaseObject* object, Property::Index index, const
 
     switch( index )
     {
-      case Toolkit::PageTurnView::Property::PAGE_SIZE:
+      case Toolkit::PageTurnView::Property::VIEW_PAGE_SIZE:
       {
         pageTurnViewImpl.SetPageSize( value.Get<Vector2>() );
         break;
@@ -1075,7 +1075,7 @@ Property::Value PageTurnView::GetProperty( BaseObject* object, Property::Index i
 
     switch( index )
     {
-      case Toolkit::PageTurnView::Property::PAGE_SIZE:
+      case Toolkit::PageTurnView::Property::VIEW_PAGE_SIZE:
       {
         value = pageTurnViewImpl.GetPageSize();
         break;
index 73aff02..b553dca 100644 (file)
@@ -123,7 +123,7 @@ protected:
    * Constructor.
    * It initializes the PageTurnView members
    */
-  PageTurnView( PageFactory& pageFactory, const Vector2& pageSize );
+  PageTurnView( PageFactory& pageFactory, const Vector2& viewPageSize );
 
   /**
    * A reference counted object may only be deleted by calling Unreference()
@@ -134,9 +134,9 @@ public:
 
   /**
    * Set the page size
-   * @param[in] pageSize The size of pages
+   * @param[in] viewPageSize The size of pages
    */
-  void SetPageSize( const Vector2& pageSize );
+  void SetPageSize( const Vector2& viewPageSize );
 
   /**
    * Retrieve the page size.
index bb83e7d..e395194 100755 (executable)
@@ -428,9 +428,9 @@ struct InternalPrePositionConstraint
         // Note: A further 1.0f is subtracted to handle a compensation that happens later within the flick handling code in SnapWithVelocity().
         //       When a flick is completed, an adjustment of 1.0f is sometimes made to allow for the scenario where:
         //       A flick finishes before the update thread has advanced the scroll position past the previous snap point.
-        Vector2 pageSizeLimit( size.x - ( 1.0f + 1.0f ), size.y - ( 1.0f - 1.0f ) );
-        Vector2 minPosition( mStartPosition.x - pageSizeLimit.x, mStartPosition.y - pageSizeLimit.y );
-        Vector2 maxPosition( mStartPosition.x + pageSizeLimit.x, mStartPosition.y + pageSizeLimit.y );
+        Vector2 viewPageSizeLimit( size.x - ( 1.0f + 1.0f ), size.y - ( 1.0f - 1.0f ) );
+        Vector2 minPosition( mStartPosition.x - viewPageSizeLimit.x, mStartPosition.y - viewPageSizeLimit.y );
+        Vector2 maxPosition( mStartPosition.x + viewPageSizeLimit.x, mStartPosition.y + viewPageSizeLimit.y );
 
         if( mFixedRulerX )
         {
index 89268b3..5d2c91b 100644 (file)
@@ -33,8 +33,8 @@ namespace Toolkit
 namespace Internal
 {
 
-ScrollViewPagePathEffect::ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount)
-:mPageSize(pageSize),
+ScrollViewPagePathEffect::ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount)
+:mPageSize(viewPageSize),
  mInputPropertyIndex(inputPropertyIndex),
  mPageCount(pageCount)
 {
index 033ddb5..d6fcccd 100644 (file)
@@ -48,10 +48,10 @@ public:
    * @param[in] path Pages will follow this path
    * @param[in] forward Vector in page local space which will be aligned with tangent of the path
    * @param[in] inputPropertyIndex index of the property in the scrollview used to drivce the path
-   * @param[in] pageSize size of a page in the scrollview
+   * @param[in] viewPageSize size of a page in the scrollview
    * @param[in] pageCount total number of pages in the scrollview
    */
-  ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount );
+  ScrollViewPagePathEffect(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount );
 
 public:
 
index 70fd250..0233991 100644 (file)
@@ -31,6 +31,7 @@
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 #include <dali-toolkit/internal/controls/shadow-view/shadow-view-impl.h>
 #include <dali-toolkit/internal/filters/blur-two-pass-filter.h>
 
@@ -153,19 +154,22 @@ void ShadowView::SetShadowPlaneBackground(Actor shadowPlaneBackground)
 {
   mShadowPlaneBg = shadowPlaneBackground;
 
-  mShadowPlane = Toolkit::ImageView::New( mOutputImage );
+  mShadowPlane = Actor::New();
   mShadowPlane.SetName( "SHADOW_PLANE" );
-  mShadowPlane.SetParentOrigin(ParentOrigin::CENTER);
-  mShadowPlane.SetAnchorPoint(AnchorPoint::CENTER);
+  mShadowPlane.SetParentOrigin( ParentOrigin::CENTER );
+  mShadowPlane.SetAnchorPoint( AnchorPoint::CENTER );
+  Renderer shadowRenderer = CreateRenderer( RENDER_SHADOW_VERTEX_SOURCE, RENDER_SHADOW_FRAGMENT_SOURCE, Shader::Hint::OUTPUT_IS_TRANSPARENT, Uint16Pair(20,20) );
+  TextureSet textureSet = shadowRenderer.GetTextures();
+  textureSet.SetTexture( 0u, mOutputFrameBuffer.GetColorTexture() );
+  mShadowPlane.AddRenderer( shadowRenderer );
 
-  mShadowPlane.SetProperty( Toolkit::ImageView::Property::IMAGE, mShadowVisualMap );
   SetShaderConstants();
 
   // Rather than parent the shadow plane drawable and have constraints to move it to the same
   // position, instead parent the shadow plane drawable on the shadow plane passed in.
-  mShadowPlaneBg.Add(mShadowPlane);
-  mShadowPlane.SetParentOrigin(ParentOrigin::CENTER);
-  mShadowPlane.SetZ(1.0f);
+  mShadowPlaneBg.Add( mShadowPlane );
+  mShadowPlane.SetParentOrigin( ParentOrigin::CENTER );
+  mShadowPlane.SetZ( 1.0f );
 
   ConstrainCamera();
 
@@ -242,22 +246,14 @@ void ShadowView::OnInitialize()
   mCameraActor.SetOrientation(Radian(Degree(180)), Vector3::YAXIS);
   mCameraActor.SetPosition(DEFAULT_LIGHT_POSITION);
 
-
-  Property::Map customShader;
-  customShader[ Toolkit::Visual::Shader::Property::VERTEX_SHADER ] = RENDER_SHADOW_VERTEX_SOURCE;
-  customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = RENDER_SHADOW_FRAGMENT_SOURCE;
-
-  customShader[ Toolkit::Visual::Shader::Property::SUBDIVIDE_GRID_X ] = 20;
-  customShader[ Toolkit::Visual::Shader::Property::SUBDIVIDE_GRID_Y ] = 20;
-
-  customShader[ Toolkit::Visual::Shader::Property::HINTS ] = Shader::Hint::OUTPUT_IS_TRANSPARENT;
-
-  mShadowVisualMap[ Toolkit::Visual::Property::SHADER ] = customShader;
-
   // Create render targets needed for rendering from light's point of view
-  mSceneFromLightRenderTarget = FrameBufferImage::New( stageSize.width, stageSize.height, Pixel::RGBA8888 );
+  mSceneFromLightRenderTarget = FrameBuffer::New( stageSize.width, stageSize.height, FrameBuffer::Attachment::NONE );
+  Texture textureFromLight = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, unsigned(stageSize.width), unsigned(stageSize.height) );
+  mSceneFromLightRenderTarget.AttachColorTexture( textureFromLight );
 
-  mOutputImage = FrameBufferImage::New( stageSize.width * 0.5f, stageSize.height * 0.5f, Pixel::RGBA8888 );
+  mOutputFrameBuffer = FrameBuffer::New( stageSize.width * 0.5f, stageSize.height * 0.5f, FrameBuffer::Attachment::NONE );
+  Texture outputTexture = Texture::New( TextureType::TEXTURE_2D, Pixel::RGBA8888, unsigned(stageSize.width * 0.5f), unsigned(stageSize.height * 0.5f) );
+  mOutputFrameBuffer.AttachColorTexture( outputTexture );
 
   //////////////////////////////////////////////////////
   // Connect to actor tree
@@ -265,23 +261,23 @@ void ShadowView::OnInitialize()
   Self().Add( mChildrenRoot );
   Stage::GetCurrent().Add( mCameraActor );
 
-  mBlurFilter.SetRefreshOnDemand(false);
-  mBlurFilter.SetInputImage(mSceneFromLightRenderTarget);
-  mBlurFilter.SetOutputImage(mOutputImage);
-  mBlurFilter.SetSize(stageSize * 0.5f);
-  mBlurFilter.SetPixelFormat(Pixel::RGBA8888);
+  mBlurFilter.SetRefreshOnDemand( false );
+  mBlurFilter.SetInputTexture( mSceneFromLightRenderTarget.GetColorTexture() );
+  mBlurFilter.SetOutputFrameBuffer( mOutputFrameBuffer );
+  mBlurFilter.SetSize( stageSize * 0.5f );
+  mBlurFilter.SetPixelFormat( Pixel::RGBA8888 );
 
   mBlurRootActor = Actor::New();
   mBlurRootActor.SetName( "BLUR_ROOT_ACTOR" );
 
   // Turn off inheritance to ensure filter renders properly
   mBlurRootActor.SetParentOrigin( ParentOrigin::CENTER );
-  mBlurRootActor.SetInheritPosition(false);
-  mBlurRootActor.SetInheritOrientation(false);
-  mBlurRootActor.SetInheritScale(false);
-  mBlurRootActor.SetColorMode(USE_OWN_COLOR);
+  mBlurRootActor.SetInheritPosition( false );
+  mBlurRootActor.SetInheritOrientation( false );
+  mBlurRootActor.SetInheritScale( false );
+  mBlurRootActor.SetColorMode( USE_OWN_COLOR );
 
-  Self().Add(mBlurRootActor);
+  Self().Add( mBlurRootActor );
 
   mBlurFilter.SetRootActor(mBlurRootActor);
   mBlurFilter.SetBackgroundColor(Vector4::ZERO);
@@ -340,7 +336,7 @@ void ShadowView::CreateRenderTasks()
 
   mRenderSceneTask.SetCameraActor( mCameraActor );
   mRenderSceneTask.SetSourceActor( mChildrenRoot );
-  mRenderSceneTask.SetTargetFrameBuffer( mSceneFromLightRenderTarget );
+  mRenderSceneTask.SetFrameBuffer( mSceneFromLightRenderTarget );
   mRenderSceneTask.SetInputEnabled( false );
   mRenderSceneTask.SetClearEnabled( true );
 
index bd0b376..1cc97ca 100644 (file)
@@ -137,14 +137,14 @@ private:
   void CreateBlurFilter();
 
 private:
-  Toolkit::ImageView mShadowPlane; // Shadow renders into this actor
+  Actor mShadowPlane; // Shadow renders into this actor
   Actor mShadowPlaneBg; // mShadowPlane renders directly in front of this actor
   Actor mPointLight;  // Shadow is cast from this point light
 
   /////////////////////////////////////////////////////////////
-  FrameBufferImage mSceneFromLightRenderTarget;  // for rendering normal scene seen from light to texture instead of the screen
+  FrameBuffer mSceneFromLightRenderTarget;  // for rendering normal scene seen from light to texture instead of the screen
 
-  FrameBufferImage mOutputImage;
+  FrameBuffer mOutputFrameBuffer;
 
   Actor mChildrenRoot; // Subtree for all user added child actors that should be rendered normally
   Actor mBlurRootActor; // Root actor for blur filter processing
index 78f354b..70bd49d 100644 (file)
@@ -32,6 +32,7 @@
 // INTERNAL_INCLUDES
 #include <dali-toolkit/public-api/image-loader/sync-image-loader.h>
 #include <dali-toolkit/devel-api/controls/control-devel.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 #include <dali-toolkit/internal/visuals/visual-base-impl.h>
 #include <dali-toolkit/internal/visuals/visual-factory-impl.h>
 
@@ -95,104 +96,6 @@ struct ActorOpacityConstraint
   Vector2 mRange;
 };
 
-#define DALI_COMPOSE_SHADER(STR) #STR
-
-const char * const BASIC_VERTEX_SOURCE = DALI_COMPOSE_SHADER(
-  precision mediump float;\n
-  attribute mediump vec2 aPosition;\n
-  attribute mediump vec2 aTexture;\n
-  varying mediump vec2 vTexCoord;\n
-  uniform mediump mat4 uMvpMatrix;\n
-  uniform mediump vec3 uSize;\n
-  \n
-  void main()\n
-  {\n
-    mediump vec4 vertexPosition = vec4(aPosition * uSize.xy, 0.0, 1.0);\n
-    vTexCoord = aTexture;\n
-    gl_Position = uMvpMatrix * vertexPosition;\n
-  }\n
-);
-
-const char * const BASIC_FRAGMENT_SOURCE = DALI_COMPOSE_SHADER(
-  precision mediump float;\n
-  varying mediump vec2 vTexCoord;\n
-  uniform sampler2D sTexture;\n
-  uniform vec4 uColor;\n
-  \n
-  void main()\n
-  {\n
-    gl_FragColor = texture2D(sTexture, vTexCoord);\n
-    gl_FragColor *= uColor;
-  }\n
-);
-
-Renderer CreateRenderer( const char* vertexSrc, const char* fragmentSrc )
-{
-  Shader shader = Shader::New( vertexSrc, fragmentSrc );
-
-  Geometry texturedQuadGeometry = Geometry::New();
-
-  struct VertexPosition { Vector2 position; };
-  struct VertexTexture { Vector2 texture; };
-
-  VertexPosition positionArray[] =
-  {
-    { Vector2( -0.5f, -0.5f ) },
-    { Vector2(  0.5f, -0.5f ) },
-    { Vector2( -0.5f,  0.5f ) },
-    { Vector2(  0.5f,  0.5f ) }
-  };
-  uint32_t numberOfVertices = sizeof(positionArray)/sizeof(VertexPosition);
-
-  VertexTexture uvArray[] =
-  {
-    { Vector2( 0.0f, 0.0f ) },
-    { Vector2( 1.0f, 0.0f ) },
-    { Vector2( 0.0f, 1.0f ) },
-    { Vector2( 1.0f, 1.0f ) }
-  };
-
-  Property::Map positionVertexFormat;
-  positionVertexFormat["aPosition"] = Property::VECTOR2;
-  PropertyBuffer positionVertices = PropertyBuffer::New( positionVertexFormat );
-  positionVertices.SetData( positionArray, numberOfVertices );
-  texturedQuadGeometry.AddVertexBuffer( positionVertices );
-
-  Property::Map textureVertexFormat;
-  textureVertexFormat["aTexture"] = Property::VECTOR2;
-  PropertyBuffer textureVertices = PropertyBuffer::New( textureVertexFormat );
-  textureVertices.SetData( uvArray, numberOfVertices );
-  texturedQuadGeometry.AddVertexBuffer( textureVertices );
-
-  const uint16_t indices[] = { 0, 3, 1, 0, 2, 3 };
-  texturedQuadGeometry.SetIndexBuffer ( &indices[0], sizeof( indices )/ sizeof( indices[0] ) );
-
-  Renderer renderer = Renderer::New( texturedQuadGeometry, shader );
-
-  TextureSet textureSet = TextureSet::New();
-  renderer.SetTextures( textureSet );
-
-  return renderer;
-}
-
-void SetRendererTexture( Renderer& renderer, Texture& texture )
-{
-  if( renderer )
-  {
-    TextureSet textureSet = renderer.GetTextures();
-    textureSet.SetTexture( 0u, texture );
-  }
-}
-
-void SetRendererTexture( Renderer& renderer, FrameBuffer& frameBuffer )
-{
-  if( frameBuffer )
-  {
-    Texture texture = frameBuffer.GetColorTexture();
-    SetRendererTexture( renderer, texture );
-  }
-}
-
 } // namespace
 
 namespace Dali
index c6ef0dc..8512a10 100644 (file)
@@ -19,7 +19,9 @@
 #include <dali-toolkit/internal/controls/text-controls/text-selection-popup-impl.h>
 
 // EXTERNAL INCLUDES
+#if defined(__GLIBC__)
 #include <libintl.h>
+#endif
 #include <string.h>
 #include <cfloat>
 #include <dali/public-api/animation/animation.h>
@@ -53,8 +55,9 @@ namespace Internal
 
 namespace
 {
-
+#if defined(__GLIBC__)
 #define GET_LOCALE_TEXT(string) dgettext("dali-toolkit", string)
+#endif
 
 const std::string TEXT_SELECTION_POPUP_BUTTON_STYLE_NAME( "TextSelectionPopupButton" );
 const Dali::Vector4 DEFAULT_OPTION_PRESSED_COLOR( Dali::Vector4( 0.24f, 0.72f, 0.8f, 1.0f ) );
@@ -805,6 +808,7 @@ std::string TextSelectionPopup::GetPressedImage() const
 
    // Whether to mirror the list of buttons (for right to left languages)
    bool mirror = false;
+#if defined(__GLIBC__)
    char* idsLtr = GET_LOCALE_TEXT( IDS_LTR.c_str() );
    if( NULL != idsLtr )
    {
@@ -815,6 +819,7 @@ std::string TextSelectionPopup::GetPressedImage() const
        std::reverse( mOrderListOfButtons.begin(), mOrderListOfButtons.end() );
      }
    }
+#endif
 
    // Iterate list of buttons and add active ones to Toolbar
    std::size_t numberOfOptionsRequired =  GetNumberOfEnabledOptions();
index c2b60e2..5d23e8f 100755 (executable)
@@ -56,6 +56,7 @@ toolkit_src_files = \
    $(toolkit_src_dir)/controls/buttons/toggle-button-impl.cpp \
    $(toolkit_src_dir)/controls/control/control-data-impl.cpp \
    $(toolkit_src_dir)/controls/control/control-debug.cpp \
+   $(toolkit_src_dir)/controls/control/control-renderers.cpp \
    $(toolkit_src_dir)/controls/effects-view/effects-view-impl.cpp \
    $(toolkit_src_dir)/controls/flex-container/flex-container-impl.cpp \
    $(toolkit_src_dir)/controls/gaussian-blur-view/gaussian-blur-view-impl.cpp \
index f2689ef..5dabfb7 100644 (file)
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/rendering/renderer.h>
-#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 
 namespace Dali
 {
@@ -116,7 +115,7 @@ BlurTwoPassFilter::BlurTwoPassFilter()
 {
   // create blending actor and register the property in constructor
   // to make sure that GetBlurStrengthPropertyIndex() always returns a valid index
-  mActorForBlending = Toolkit::ImageView::New();
+  mActorForBlending = Actor::New();
   mBlurStrengthPropertyIndex = mActorForBlending.RegisterProperty( BLUR_STRENGTH_UNIFORM_NAME, 1.f );
 }
 
@@ -126,32 +125,54 @@ BlurTwoPassFilter::~BlurTwoPassFilter()
 
 void BlurTwoPassFilter::Enable()
 {
+  // create custom shader effect
+  if( !GetKernelSize() )
+  {
+    CreateKernel( DEFAULT_KERNEL4, sizeof(DEFAULT_KERNEL4)/sizeof(DEFAULT_KERNEL4[0]) );
+  }
+  int kernelSize( static_cast< int >(GetKernelSize()) );
+
+  // Set up blur-two-pass custom shader
+  std::ostringstream sstream;
+  sstream << "#define NUM_SAMPLES " << kernelSize << "\n";
+  sstream << BLUR_TWO_PASS_FRAGMENT_SOURCE;
+  std::string fragmentSource( sstream.str() );
+
   // create actor to render input with applied emboss effect
-  mActorForInput = Toolkit::ImageView::New( mInputImage );
+  mActorForInput = Actor::New();
   mActorForInput.SetParentOrigin( ParentOrigin::CENTER );
   mActorForInput.SetSize( mTargetSize );
+  Renderer rendererForInput = CreateRenderer( BASIC_VERTEX_SOURCE, fragmentSource.c_str() );
+  SetRendererTexture( rendererForInput, mInputTexture );
+  mActorForInput.AddRenderer( rendererForInput );
 
   // create internal offscreen for result of horizontal pass
-  mImageForHorz = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+  mFrameBufferForHorz = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+  Texture textureForHorz = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+  mFrameBufferForHorz.AttachColorTexture( textureForHorz );
+
   // create an actor to render mImageForHorz for vertical blur pass
-  mActorForHorz = Toolkit::ImageView::New( mImageForHorz );
+  mActorForHorz = Actor::New();
   mActorForHorz.SetParentOrigin( ParentOrigin::CENTER );
   mActorForHorz.SetSize( mTargetSize );
+  Renderer rendererForHorz = CreateRenderer( BASIC_VERTEX_SOURCE, fragmentSource.c_str() );
+  SetRendererTexture( rendererForHorz, textureForHorz );
+  mActorForHorz.AddRenderer( rendererForHorz );
 
   // create internal offscreen for result of the two pass blurred image
-  mBlurredImage = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+  mBlurredFrameBuffer = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+  Texture blurredTexture = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+  mBlurredFrameBuffer.AttachColorTexture( blurredTexture );
+
   // create an actor to blend the blurred image and the input image with the given blur strength
-  mActorForBlending.SetImage( mBlurredImage );
+  Renderer rendererForBlending = CreateRenderer( BASIC_VERTEX_SOURCE, BLEND_TWO_IMAGES_FRAGMENT_SOURCE );
+  TextureSet textureSetForBlending = rendererForBlending.GetTextures();
+  textureSetForBlending.SetTexture( 0u, blurredTexture );
+  textureSetForBlending.SetTexture( 1u, mInputTexture );
+  mActorForBlending.AddRenderer( rendererForBlending );
   mActorForBlending.SetParentOrigin( ParentOrigin::CENTER );
   mActorForBlending.SetSize( mTargetSize );
 
-  // create custom shader effect
-  if( !GetKernelSize() )
-  {
-    CreateKernel( DEFAULT_KERNEL4, sizeof(DEFAULT_KERNEL4)/sizeof(DEFAULT_KERNEL4[0]) );
-  }
-  int kernelSize( static_cast< int >(GetKernelSize()) );
-
   for( int i = 0; i < kernelSize; ++i )
   {
     const std::string offsetUniform( GetOffsetUniformName( i ) );
@@ -164,34 +185,10 @@ void BlurTwoPassFilter::Enable()
     mActorForHorz.RegisterProperty( weightUniform, mKernel[i].z );
   }
 
-  // Set up blur-two-pass custom shader
-  std::ostringstream fragmentSource;
-  fragmentSource << "#define NUM_SAMPLES " << kernelSize << "\n";
-  fragmentSource << BLUR_TWO_PASS_FRAGMENT_SOURCE;
-
-  Property::Map customShader;
-  customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = fragmentSource.str();
-  Property::Map visualMap;
-  visualMap.Insert( Toolkit::Visual::Property::SHADER, customShader );
-  mActorForInput.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
-  mActorForHorz.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
-
-  // Set up blend-two-image custom shader
-  customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = BLEND_TWO_IMAGES_FRAGMENT_SOURCE;
-  visualMap[ Toolkit::Visual::Property::SHADER ] = customShader;
-  mActorForBlending.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
-
   mRootActor.Add( mActorForInput );
   mRootActor.Add( mActorForHorz );
   mRootActor.Add( mActorForBlending );
 
-  // Add effect texture to blend-two-image custom shader
-  TextureSet textureSet = mActorForBlending.GetRendererAt(0).GetTextures();
-  if( textureSet )
-  {
-    TextureSetImage( textureSet, 1u, mInputImage );
-  }
-
   SetupCamera();
   CreateRenderTasks();
 }
@@ -289,7 +286,7 @@ void BlurTwoPassFilter::CreateRenderTasks()
   mRenderTaskForHorz.SetInputEnabled( false );
   mRenderTaskForHorz.SetClearEnabled( true );
   mRenderTaskForHorz.SetClearColor( mBackgroundColor );
-  mRenderTaskForHorz.SetTargetFrameBuffer( mImageForHorz );
+  mRenderTaskForHorz.SetFrameBuffer( mFrameBufferForHorz );
   mRenderTaskForHorz.SetCameraActor( mCameraActor );
 
   // use the internal buffer and perform a horizontal blur targeting the output buffer
@@ -300,7 +297,7 @@ void BlurTwoPassFilter::CreateRenderTasks()
   mRenderTaskForVert.SetInputEnabled( false );
   mRenderTaskForVert.SetClearEnabled( true );
   mRenderTaskForVert.SetClearColor( mBackgroundColor );
-  mRenderTaskForVert.SetTargetFrameBuffer( mBlurredImage );
+  mRenderTaskForVert.SetFrameBuffer( mBlurredFrameBuffer );
   mRenderTaskForVert.SetCameraActor( mCameraActor );
 
   //Perform a blending between the blurred image and the input image
@@ -311,7 +308,7 @@ void BlurTwoPassFilter::CreateRenderTasks()
   mRenderTaskForBlending.SetInputEnabled( false );
   mRenderTaskForBlending.SetClearEnabled( true );
   mRenderTaskForBlending.SetClearColor( mBackgroundColor );
-  mRenderTaskForBlending.SetTargetFrameBuffer( mOutputImage );
+  mRenderTaskForBlending.SetFrameBuffer( mOutputFrameBuffer );
   mRenderTaskForBlending.SetCameraActor( mCameraActor );
 }
 
index 438761d..9dd33af 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/render-tasks/render-task.h>
-#include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
 // INTERNAL INCLUDES
 #include "image-filter.h"
@@ -89,19 +88,19 @@ private:
 
 private: // Attributes
 
-  // To perform horizontal blur from mInputImage to mImageForHorz
+  // To perform horizontal blur from mInputTexture to mFrameBufferForHorz
   RenderTask         mRenderTaskForHorz;
-  Toolkit::ImageView mActorForInput;
-  FrameBufferImage   mImageForHorz;
+  Actor              mActorForInput;
+  FrameBuffer        mFrameBufferForHorz;
 
-  // To perform vertical blur from mImageForHorz to mOutputImage
+  // To perform vertical blur from mFrameBufferForHorz to mOutputFrameBuffer
   RenderTask         mRenderTaskForVert;
-  Toolkit::ImageView mActorForHorz;
-  FrameBufferImage   mBlurredImage;
+  Actor              mActorForHorz;
+  FrameBuffer        mBlurredFrameBuffer;
 
   // To blend the blurred image and input image according to the blur strength
   RenderTask         mRenderTaskForBlending;
-  Toolkit::ImageView mActorForBlending;
+  Actor              mActorForBlending;
   Actor              mRootActorForBlending;
   Property::Index    mBlurStrengthPropertyIndex;
 
index 7f6dd18..d8349da 100644 (file)
 #include <dali/public-api/object/property-map.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
 #include <dali/public-api/rendering/renderer.h>
-#include <dali/devel-api/images/texture-set-image.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/devel-api/visual-factory/visual-factory.h>
-#include <dali-toolkit/public-api/visuals/visual-properties.h>
-#include <dali-toolkit/internal/visuals/visual-base-impl.h>
-#include <dali-toolkit/internal/visuals/visual-factory-impl.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 
 namespace Dali
 {
@@ -91,32 +87,36 @@ EmbossFilter::~EmbossFilter()
 
 void EmbossFilter::Enable()
 {
-  mImageForEmboss1 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
-  mImageForEmboss2 = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+  mFrameBufferForEmboss1 = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+  Texture texture1 = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+  mFrameBufferForEmboss1.AttachColorTexture( texture1 );
 
-  Property::Map customShader;
-  customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = EMBOSS_FRAGMENT_SOURCE;
-  Property::Map visualMap;
-  visualMap.Insert( Toolkit::Visual::Property::SHADER, customShader );
+  mFrameBufferForEmboss2 = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+  Texture texture2 = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+  mFrameBufferForEmboss2.AttachColorTexture( texture2 );
 
   // create actor to render input with applied emboss effect
-  mActorForInput1 = Toolkit::ImageView::New(mInputImage);
+  mActorForInput1 = Actor::New();
   mActorForInput1.SetParentOrigin( ParentOrigin::CENTER );
   mActorForInput1.SetSize(mTargetSize);
   Vector2 textureScale( 1.5f/mTargetSize.width, 1.5f/mTargetSize.height);
   mActorForInput1.RegisterProperty( TEX_SCALE_UNIFORM_NAME, textureScale );
   mActorForInput1.RegisterProperty( COEFFICIENT_UNIFORM_NAME, Vector3( 2.f, -1.f, -1.f ) );
   // set EMBOSS custom shader
-  mActorForInput1.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
+  Renderer renderer1 = CreateRenderer( BASIC_VERTEX_SOURCE, EMBOSS_FRAGMENT_SOURCE );
+  SetRendererTexture( renderer1, mInputTexture );
+  mActorForInput1.AddRenderer( renderer1 );
   mRootActor.Add( mActorForInput1 );
 
-  mActorForInput2 = Toolkit::ImageView::New(mInputImage);
+  mActorForInput2 = Actor::New();
   mActorForInput2.SetParentOrigin( ParentOrigin::CENTER );
   mActorForInput2.SetSize(mTargetSize);
   mActorForInput2.RegisterProperty( TEX_SCALE_UNIFORM_NAME, textureScale );
   mActorForInput2.RegisterProperty( COEFFICIENT_UNIFORM_NAME, Vector3( -1.f, -1.f, 2.f ) );
   // set EMBOSS custom shader
-  mActorForInput2.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
+  Renderer renderer2 = CreateRenderer( BASIC_VERTEX_SOURCE, EMBOSS_FRAGMENT_SOURCE );
+  SetRendererTexture( renderer2, mInputTexture );
+  mActorForInput2.AddRenderer( renderer2 );
   mRootActor.Add( mActorForInput2 );
 
   mActorForComposite = Actor::New();
@@ -124,16 +124,17 @@ void EmbossFilter::Enable()
   mActorForComposite.SetSize(mTargetSize);
   mActorForComposite.SetColor( Color::BLACK );
 
-  customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = COMPOSITE_FRAGMENT_SOURCE;
-
   mRootActor.Add( mActorForComposite );
 
-  Internal::InitializeVisual( mActorForComposite, mVisualForEmboss1, mImageForEmboss1 );
-  Toolkit::GetImplementation( mVisualForEmboss1 ).SetCustomShader( customShader );
-  mActorForComposite.GetRendererAt(0).RegisterProperty( COLOR_UNIFORM_NAME, Color::BLACK );
-  Internal::InitializeVisual( mActorForComposite, mVisualForEmboss2, mImageForEmboss2 );
-  Toolkit::GetImplementation( mVisualForEmboss2 ).SetCustomShader( customShader );
-  mActorForComposite.GetRendererAt(1).RegisterProperty( COLOR_UNIFORM_NAME, Color::WHITE );
+  mRendererForEmboss1 = CreateRenderer( BASIC_VERTEX_SOURCE, COMPOSITE_FRAGMENT_SOURCE );
+  SetRendererTexture( mRendererForEmboss1, mFrameBufferForEmboss1 );
+  mRendererForEmboss1.RegisterProperty( COLOR_UNIFORM_NAME, Color::BLACK );
+  mActorForComposite.AddRenderer( mRendererForEmboss1 );
+
+  mRendererForEmboss2 = CreateRenderer( BASIC_VERTEX_SOURCE, COMPOSITE_FRAGMENT_SOURCE );
+  SetRendererTexture( mRendererForEmboss2, mFrameBufferForEmboss2 );
+  mRendererForEmboss2.RegisterProperty( COLOR_UNIFORM_NAME, Color::WHITE );
+  mActorForComposite.AddRenderer( mRendererForEmboss2 );
 
   SetupCamera();
   CreateRenderTasks();
@@ -163,10 +164,12 @@ void EmbossFilter::Disable()
 
     if( mActorForComposite )
     {
-      Toolkit::GetImplementation(mVisualForEmboss1).SetOffStage( mActorForComposite );
-      Toolkit::GetImplementation(mVisualForEmboss2).SetOffStage( mActorForComposite );
-      mVisualForEmboss1.Reset();
-      mVisualForEmboss2.Reset();
+      mActorForComposite.RemoveRenderer( mRendererForEmboss1 );
+      mRendererForEmboss1.Reset();
+
+      mActorForComposite.RemoveRenderer( mRendererForEmboss2 );
+      mRendererForEmboss2.Reset();
+
       mRootActor.Remove( mActorForComposite );
       mActorForComposite.Reset();
     }
@@ -231,7 +234,7 @@ void EmbossFilter::CreateRenderTasks()
   mRenderTaskForEmboss1.SetInputEnabled( false );
   mRenderTaskForEmboss1.SetClearColor( Vector4( 0.0f, 0.0f, 0.0f, 0.0f ) );
   mRenderTaskForEmboss1.SetClearEnabled( true );
-  mRenderTaskForEmboss1.SetTargetFrameBuffer( mImageForEmboss1 );
+  mRenderTaskForEmboss1.SetFrameBuffer( mFrameBufferForEmboss1 );
   mRenderTaskForEmboss1.SetCameraActor( mCameraActor );
 
   mRenderTaskForEmboss2 = taskList.CreateTask();
@@ -241,7 +244,7 @@ void EmbossFilter::CreateRenderTasks()
   mRenderTaskForEmboss2.SetInputEnabled( false );
   mRenderTaskForEmboss2.SetClearColor( Vector4( 1.0f, 1.0f, 1.0f, 0.0f ) );
   mRenderTaskForEmboss2.SetClearEnabled( true );
-  mRenderTaskForEmboss2.SetTargetFrameBuffer( mImageForEmboss2 );
+  mRenderTaskForEmboss2.SetFrameBuffer( mFrameBufferForEmboss2 );
   mRenderTaskForEmboss2.SetCameraActor( mCameraActor );
 
   mRenderTaskForOutput = taskList.CreateTask();
@@ -251,7 +254,7 @@ void EmbossFilter::CreateRenderTasks()
   mRenderTaskForOutput.SetInputEnabled( false );
   mRenderTaskForOutput.SetClearColor( Vector4( 0.5f, 0.5f, 0.5f, 0.0f ) );
   mRenderTaskForOutput.SetClearEnabled( true );
-  mRenderTaskForOutput.SetTargetFrameBuffer( mOutputImage );
+  mRenderTaskForOutput.SetFrameBuffer( mOutputFrameBuffer );
   mRenderTaskForOutput.SetCameraActor( mCameraActor );
 }
 
index d61a823..2d58538 100644 (file)
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/render-tasks/render-task.h>
-#include <dali-toolkit/public-api/controls/image-view/image-view.h>
-#include <dali-toolkit/devel-api/visual-factory/visual-base.h>
+#include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/public-api/rendering/renderer.h>
+
+// INTERNAL INCLUDES
 #include "image-filter.h"
 
 namespace Dali
@@ -77,12 +79,12 @@ private: // Attributes
   RenderTask            mRenderTaskForEmboss1;
   RenderTask            mRenderTaskForEmboss2;
   RenderTask            mRenderTaskForOutput;
-  FrameBufferImage      mImageForEmboss1;
-  FrameBufferImage      mImageForEmboss2;
-  Toolkit::ImageView    mActorForInput1;
-  Toolkit::ImageView    mActorForInput2;
-  Toolkit::Visual::Base mVisualForEmboss1;
-  Toolkit::Visual::Base mVisualForEmboss2;
+  FrameBuffer           mFrameBufferForEmboss1;
+  FrameBuffer           mFrameBufferForEmboss2;
+  Actor                 mActorForInput1;
+  Actor                 mActorForInput2;
+  Renderer              mRendererForEmboss1;
+  Renderer              mRendererForEmboss2;
   Actor                 mActorForComposite;
 }; // class EmbossFilter
 
index f564c96..e90e07e 100644 (file)
@@ -51,14 +51,14 @@ void ImageFilter::SetRefreshOnDemand( bool onDemand )
   mRefreshOnDemand = onDemand;
 }
 
-void ImageFilter::SetInputImage( Image image )
+void ImageFilter::SetInputTexture( Texture texture )
 {
-  mInputImage = image;
+  mInputTexture = texture;
 }
 
-void ImageFilter::SetOutputImage( FrameBufferImage image )
+void ImageFilter::SetOutputFrameBuffer( FrameBuffer frameBuffer )
 {
-  mOutputImage = image;
+  mOutputFrameBuffer = frameBuffer;
 }
 
 void ImageFilter::SetSize( const Vector2& size )
index dbab5b1..d73f9e6 100644 (file)
@@ -20,6 +20,8 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/actors/camera-actor.h>
+#include <dali/public-api/rendering/frame-buffer.h>
+#include <dali/public-api/rendering/texture.h>
 
 // INTERNAL INCLUDES
 #include <dali-toolkit/public-api/controls/control-impl.h>
@@ -36,7 +38,7 @@ namespace Internal
 
 /**
  * An interface class that provides a interface for image filters that perform
- * a simple shader effect on an input image, rendering the output to a FrameBufferImage.
+ * a simple shader effect on an input texture, rendering the output to a FrameBuffer.
  */
 class ImageFilter
 {
@@ -76,16 +78,16 @@ public:
   void SetRefreshOnDemand( bool onDemand );
 
   /**
-   * Set the input image
-   * @param[in] The input/original image.
+   * Set the input texture
+   * @param[in] The input/original texture.
    */
-  void SetInputImage( Image image );
+  void SetInputTexture( Texture texture );
 
   /**
-   * Set the output image
-   * @return The output image.
+   * Set the output frame buffer
+   * @return The output frame buffer.
    */
-  void SetOutputImage( FrameBufferImage image );
+  void SetOutputFrameBuffer( FrameBuffer frameBuffer );
 
   /**
    * Set size of ImageFilter. Used to create internal offscreen buffers
@@ -145,8 +147,8 @@ protected:
   void SetupCamera();
 
 protected:
-  Image            mInputImage;
-  FrameBufferImage mOutputImage;
+  Texture          mInputTexture;
+  FrameBuffer      mOutputFrameBuffer;
   FilterKernel     mKernel;
   Actor            mRootActor;
   CameraActor      mCameraActor;
index 0ed7934..5100821 100644 (file)
@@ -25,7 +25,7 @@
 #include <dali/public-api/render-tasks/render-task-list.h>
 
 // INTERNAL INCLUDES
-#include <dali-toolkit/public-api/visuals/visual-properties.h>
+#include <dali-toolkit/internal/controls/control/control-renderers.h>
 
 namespace Dali
 {
@@ -83,31 +83,32 @@ void SpreadFilter::SetSpread( float spread )
 void SpreadFilter::Enable()
 {
   // create actor to render input with applied emboss effect
-  mActorForInput = Toolkit::ImageView::New( mInputImage );
+  mActorForInput = Actor::New();
   mActorForInput.SetParentOrigin( ParentOrigin::CENTER );
   mActorForInput.SetSize(mTargetSize);
   // register properties as shader uniforms
   mActorForInput.RegisterProperty( SPREAD_UNIFORM_NAME, mSpread );
   mActorForInput.RegisterProperty( TEX_SCALE_UNIFORM_NAME, Vector2( 1.0f / mTargetSize.width, 0.0f ) );
 
+  Renderer rendererForInput = CreateRenderer( BASIC_VERTEX_SOURCE, SPREAD_FRAGMENT_SOURCE );
+  SetRendererTexture( rendererForInput, mInputTexture );
+  mActorForInput.AddRenderer( rendererForInput );
+
   // create internal offscreen for result of horizontal pass
-  mImageForHorz = FrameBufferImage::New( mTargetSize.width, mTargetSize.height, mPixelFormat );
+  mFrameBufferForHorz = FrameBuffer::New( mTargetSize.width, mTargetSize.height, FrameBuffer::Attachment::NONE );
+  Texture textureForHorz = Texture::New( TextureType::TEXTURE_2D, mPixelFormat, unsigned(mTargetSize.width), unsigned(mTargetSize.height) );
+  mFrameBufferForHorz.AttachColorTexture( textureForHorz );
+
   // create an actor to render mImageForHorz for vertical blur pass
-  mActorForHorz = Toolkit::ImageView::New( mImageForHorz );
+  mActorForHorz = Actor::New();
   mActorForHorz.SetParentOrigin( ParentOrigin::CENTER );
   mActorForHorz.SetSize(mTargetSize);
   // register properties as shader uniforms
   mActorForHorz.RegisterProperty( SPREAD_UNIFORM_NAME, mSpread );
   mActorForHorz.RegisterProperty( TEX_SCALE_UNIFORM_NAME, Vector2( 0.0f, 1.0f / mTargetSize.height ) );
-
-  Property::Map customShader;
-  customShader[ Toolkit::Visual::Shader::Property::FRAGMENT_SHADER ] = SPREAD_FRAGMENT_SOURCE;
-  Property::Map visualMap;
-  visualMap.Insert( Toolkit::Visual::Property::SHADER, customShader );
-
-  // set SPREAD custom shader
-  mActorForInput.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
-  mActorForHorz.SetProperty( Toolkit::ImageView::Property::IMAGE, visualMap );
+  Renderer rendererForHorz = CreateRenderer( BASIC_VERTEX_SOURCE, SPREAD_FRAGMENT_SOURCE );
+  SetRendererTexture( rendererForHorz, textureForHorz );
+  mActorForHorz.AddRenderer( rendererForHorz );
 
   mRootActor.Add( mActorForInput );
   mRootActor.Add( mActorForHorz );
@@ -191,7 +192,7 @@ void SpreadFilter::CreateRenderTasks()
   mRenderTaskForHorz.SetInputEnabled( false );
   mRenderTaskForHorz.SetClearEnabled( true );
   mRenderTaskForHorz.SetClearColor( mBackgroundColor );
-  mRenderTaskForHorz.SetTargetFrameBuffer( mImageForHorz );
+  mRenderTaskForHorz.SetFrameBuffer( mFrameBufferForHorz );
   mRenderTaskForHorz.SetCameraActor( mCameraActor );
 
   // use the internal buffer and perform a horizontal blur targeting the output buffer
@@ -202,7 +203,7 @@ void SpreadFilter::CreateRenderTasks()
   mRenderTaskForVert.SetInputEnabled( false );
   mRenderTaskForVert.SetClearEnabled( true );
   mRenderTaskForVert.SetClearColor( mBackgroundColor );
-  mRenderTaskForVert.SetTargetFrameBuffer( mOutputImage );
+  mRenderTaskForVert.SetFrameBuffer( mOutputFrameBuffer );
   mRenderTaskForVert.SetCameraActor( mCameraActor );
 }
 
index bc498de..83809f1 100644 (file)
@@ -20,7 +20,6 @@
 
 // EXTERNAL INCLUDES
 #include <dali/public-api/render-tasks/render-task.h>
-#include <dali-toolkit/public-api/controls/image-view/image-view.h>
 
 // INTERNAL INCLUDES
 #include "image-filter.h"
@@ -82,14 +81,14 @@ private:
 
 private: // Attributes
 
-  // To perform horizontal spread from mInputImage to mImageForHorz
+  // To perform horizontal spread from mInputTexture to mFrameBufferForHorz
   RenderTask         mRenderTaskForHorz;
-  Toolkit::ImageView mActorForInput;
-  FrameBufferImage   mImageForHorz;
+  Actor              mActorForInput;
+  FrameBuffer        mFrameBufferForHorz;
 
-  // To perform vertical spread from mImageForHorz to mOutputImage
+  // To perform vertical spread from mFrameBufferForHorz to mOutputFrameBuffer
   RenderTask         mRenderTaskForVert;
-  Toolkit::ImageView mActorForHorz;
+  Actor              mActorForHorz;
 
   int                mSpread;
 }; // class SpreadFilter
index 26ad3e0..4becddf 100644 (file)
@@ -19,7 +19,7 @@
 #include "atlas-packer.h"
 
 // EXTERNAL HEADER
-#include <stdlib.h> // For abs()
+#include <cstdlib> // For abs()
 #include <dali/integration-api/debug.h>
 
 namespace Dali
@@ -36,7 +36,7 @@ namespace
 
 bool ApproximatelyEqual( uint32_t a, uint32_t b  )
 {
-  return abs( a-b ) <= 1;
+  return std::abs( static_cast<int32_t>( a - b ) ) <= 1;
 }
 
 uint16_t MaxDimension( const Uint16Pair& dimensions )
index b35ce74..9d1b93d 100755 (executable)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <limits>
+#include <cmath>
 #include <dali/integration-api/debug.h>
 #include <dali/devel-api/text-abstraction/font-client.h>
 
@@ -397,7 +398,7 @@ struct Engine::Impl
       const GlyphInfo& glyph = *( glyphsBuffer + i );
       Vector2& position = *( glyphPositionsBuffer + i );
 
-      position.x = std::round( penX + glyph.xBearing );
+      position.x = std::roundf( penX + glyph.xBearing );
       position.y = -glyph.yBearing;
 
       penX += ( glyph.advance + interGlyphExtraAdvance );
index a7b098a..5ca9858 100755 (executable)
@@ -20,6 +20,7 @@
 
 // EXTERNAL INCLUDES
 #include <limits>
+#include <cmath>
 #include <memory.h>
 #include <dali/public-api/adaptor-framework/key.h>
 #include <dali/integration-api/debug.h>
@@ -1440,7 +1441,7 @@ const std::string& Controller::GetDefaultOutlineProperties() const
 
 bool Controller::SetDefaultLineSpacing( float lineSpacing )
 {
-  if( std::abs(lineSpacing - mImpl->mLayoutEngine.GetDefaultLineSpacing()) > Math::MACHINE_EPSILON_1000 )
+  if( std::fabs( lineSpacing - mImpl->mLayoutEngine.GetDefaultLineSpacing() ) > Math::MACHINE_EPSILON_1000 )
   {
     mImpl->mLayoutEngine.SetDefaultLineSpacing(lineSpacing);
     mImpl->mRecalculateNaturalSize = true;
index a38f551..d8bdc75 100644 (file)
@@ -29,9 +29,9 @@ namespace Dali
 namespace Toolkit
 {
 
-ScrollViewPagePathEffect ScrollViewPagePathEffect::New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount)
+ScrollViewPagePathEffect ScrollViewPagePathEffect::New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount)
 {
-  return ScrollViewPagePathEffect(new Internal::ScrollViewPagePathEffect(path, forward, inputPropertyIndex, pageSize,pageCount));
+  return ScrollViewPagePathEffect(new Internal::ScrollViewPagePathEffect(path, forward, inputPropertyIndex, viewPageSize,pageCount));
 }
 
 ScrollViewPagePathEffect::ScrollViewPagePathEffect()
index 4207633..6847d43 100755 (executable)
@@ -76,11 +76,11 @@ public:
    * @param[in] path The path that will be used by the scroll effect
    * @param[in] forward Vector in page object space which will be aligned with the tangent of the path
    * @param[in] inputPropertyIndex Index of a property of the scroll-view which will be used as the input for the path
-   * @param[in] pageSize Size of a page in the scrollview
+   * @param[in] viewPageSize Size of a page in the scrollview
    * @param[in] pageCount Total number of pages in the scrollview
    * @return A handle to a newly allocated Dali resource
    */
-  static ScrollViewPagePathEffect New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& pageSize, unsigned int pageCount);
+  static ScrollViewPagePathEffect New(Path path, const Vector3& forward, Dali::Property::Index inputPropertyIndex, const Vector3& viewPageSize, unsigned int pageCount);
 
   /**
    * @brief Creates an uninitialized ScrollViewPagePathEffect; this can be initialized with ScrollViewPagePathEffect::New().
index f26d56a..14ab7cd 100644 (file)
@@ -31,7 +31,7 @@ namespace Toolkit
 
 const unsigned int TOOLKIT_MAJOR_VERSION = 1;
 const unsigned int TOOLKIT_MINOR_VERSION = 4;
-const unsigned int TOOLKIT_MICRO_VERSION = 28;
+const unsigned int TOOLKIT_MICRO_VERSION = 29;
 const char * const TOOLKIT_BUILD_DATE    = __DATE__ " " __TIME__;
 
 #ifdef DEBUG_ENABLED
index 54dd713..e11d328 100644 (file)
@@ -2,7 +2,7 @@ third_party_src_files = \
    $(third_party_src_dir)/nanosvg/nanosvg.cc \
    $(third_party_src_dir)/nanosvg/nanosvgrast.cc \
    $(third_party_src_dir)/yoga/Utils.cpp \
-   $(third_party_src_dir)/yoga/YGConfig.cpp \  
+   $(third_party_src_dir)/yoga/YGConfig.cpp \
    $(third_party_src_dir)/yoga/YGEnums.cpp \
    $(third_party_src_dir)/yoga/YGFloatOptional.cpp \
    $(third_party_src_dir)/yoga/YGLayout.cpp \
index e3532b8..2b497ab 100644 (file)
@@ -1,6 +1,6 @@
 Name:       dali-toolkit
 Summary:    Dali 3D engine Toolkit
-Version:    1.4.28
+Version:    1.4.29
 Release:    1
 Group:      System/Libraries
 License:    Apache-2.0 and BSD-3-Clause and MIT