Support multiple window rendering 33/193933/23
authorRichard Huang <r.huang@samsung.com>
Tue, 27 Nov 2018 14:34:29 +0000 (14:34 +0000)
committerRichard Huang <r.huang@samsung.com>
Wed, 20 Feb 2019 11:33:35 +0000 (11:33 +0000)
Change-Id: If6a530db891bb564547cbf9c4890a604d7c80a7a

52 files changed:
automated-tests/src/dali-adaptor-internal/CMakeLists.txt
automated-tests/src/dali-adaptor/CMakeLists.txt
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.cpp
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-application.h
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.cpp [new file with mode: 0644]
automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.h [new file with mode: 0644]
automated-tests/src/dali-platform-abstraction/CMakeLists.txt
dali/devel-api/adaptor-framework/window-devel.cpp
dali/devel-api/adaptor-framework/window-devel.h
dali/integration-api/adaptor.h
dali/integration-api/egl-interface.h
dali/integration-api/file.list
dali/integration-api/native-render-surface.h
dali/integration-api/render-surface-interface.h [moved from dali/integration-api/render-surface.h with 59% similarity]
dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/adaptor-impl.h
dali/internal/adaptor/common/adaptor-internal-services.h
dali/internal/adaptor/common/adaptor.cpp
dali/internal/adaptor/common/application-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller.cpp
dali/internal/adaptor/common/combined-update-render-controller.h
dali/internal/adaptor/common/thread-controller-interface.h
dali/internal/adaptor/tizen-wayland/framework-tizen.cpp
dali/internal/graphics/gles/egl-graphics.cpp
dali/internal/graphics/gles/egl-implementation.cpp
dali/internal/graphics/gles/egl-implementation.h
dali/internal/input/tizen-wayland/input-method-context-impl-ecore-wl.cpp
dali/internal/system/common/thread-controller.cpp
dali/internal/system/common/thread-controller.h
dali/internal/window-system/common/display-connection-impl.h
dali/internal/window-system/common/display-connection.cpp
dali/internal/window-system/common/display-connection.h
dali/internal/window-system/common/event-handler.cpp
dali/internal/window-system/common/event-handler.h
dali/internal/window-system/common/native-render-surface-factory.cpp
dali/internal/window-system/common/pixmap-render-surface.h
dali/internal/window-system/common/window-impl.cpp
dali/internal/window-system/common/window-impl.h
dali/internal/window-system/common/window-render-surface.cpp
dali/internal/window-system/common/window-render-surface.h
dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/display-connection-impl-ecore-wl.h
dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/indicator-impl-ecore-wl.h
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.cpp
dali/internal/window-system/tizen-wayland/native-render-surface-ecore-wl.h
dali/internal/window-system/ubuntu-x11/display-connection-impl-x.cpp
dali/internal/window-system/ubuntu-x11/display-connection-impl-x.h
dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.cpp
dali/internal/window-system/ubuntu-x11/pixmap-render-surface-ecore-x.h
dali/public-api/adaptor-framework/window.cpp
dali/public-api/adaptor-framework/window.h

index f60e70d..ea46563 100644 (file)
@@ -31,6 +31,7 @@ LIST(APPEND TC_SOURCES
     ../dali-adaptor/dali-test-suite-utils/test-native-image.cpp
     ../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
     ../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
+    ../dali-adaptor/dali-test-suite-utils/test-render-surface.cpp
     ../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
     ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
 )
index 41cc886..f2b10e6 100644 (file)
@@ -33,6 +33,7 @@ LIST(APPEND TC_SOURCES
     dali-test-suite-utils/test-native-image.cpp
     dali-test-suite-utils/test-platform-abstraction.cpp
     dali-test-suite-utils/test-render-controller.cpp
+    dali-test-suite-utils/test-render-surface.cpp
     dali-test-suite-utils/test-trace-call-stack.cpp
     dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
 )
index c953f50..1562d27 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.
@@ -54,8 +54,6 @@ void TestApplication::Initialize()
                                         Integration::StencilBufferAvailable::TRUE );
 
   mCore->ContextCreated();
-  mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
-  mCore->SetDpi( mDpi.x, mDpi.y );
 
   Dali::Integration::Log::LogFunction logFunction(&TestApplication::LogMessage);
   Dali::Integration::Log::InstallLogFunction(logFunction);
@@ -65,12 +63,22 @@ void TestApplication::Initialize()
 
   Dali::Integration::Trace::LogContext( true, "Test" );
 
+  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 );
+
   mCore->SceneCreated();
+  mCore->Initialize();
 }
 
 TestApplication::~TestApplication()
 {
   Dali::Integration::Log::UninstallLogFunction();
+  delete mRenderSurface;
   delete mCore;
 }
 
@@ -149,19 +157,6 @@ void TestApplication::SendNotification()
   mCore->ProcessEvents();
 }
 
-void TestApplication::SetSurfaceWidth( uint32_t width, uint32_t height )
-{
-  mSurfaceWidth = width;
-  mSurfaceHeight = height;
-
-  mCore->SurfaceResized( mSurfaceWidth, mSurfaceHeight );
-}
-
-void TestApplication::SetTopMargin( uint32_t margin )
-{
-  mCore->SetTopMargin( margin );
-}
-
 void TestApplication::DoUpdate( uint32_t intervalMilliseconds, const char* location )
 {
   if( GetUpdateStatus() == 0 &&
index d1e042d..fc2929c 100644 (file)
@@ -2,7 +2,7 @@
 #define __DALI_TEST_APPLICATION_H__
 
 /*
- * 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.
 #include "test-gl-sync-abstraction.h"
 #include "test-gl-abstraction.h"
 #include "test-render-controller.h"
+#include "test-render-surface.h"
 #include <dali/public-api/common/dali-common.h>
 #include <dali/integration-api/resource-policies.h>
 #include <dali/integration-api/trace.h>
+#include <dali/integration-api/scene.h>
 
 namespace Dali
 {
@@ -69,8 +71,6 @@ public:
   TestGestureManager& GetGestureManager();
   void ProcessEvent(const Integration::Event& event);
   void SendNotification();
-  void SetSurfaceWidth( uint32_t width, unsigned height );
-  void SetTopMargin( uint32_t margin );
   bool Render( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL, const char* location=NULL );
   uint32_t GetUpdateStatus();
   bool UpdateOnly( uint32_t intervalMilliseconds = DEFAULT_RENDER_INTERVAL );
@@ -83,6 +83,11 @@ public:
     mLoggingEnabled = enabled;
   }
 
+  Integration::Scene GetScene() const
+  {
+    return mScene;
+  }
+
 private:
   void DoUpdate( uint32_t intervalMilliseconds, const char* location=NULL );
 
@@ -92,11 +97,13 @@ protected:
   TestGlAbstraction         mGlAbstraction;
   TestGlSyncAbstraction     mGlSyncAbstraction;
   TestGestureManager        mGestureManager;
+  TestRenderSurface*        mRenderSurface;
 
   Integration::UpdateStatus mStatus;
   Integration::RenderStatus mRenderStatus;
 
   Integration::Core* mCore;
+  Dali::Integration::Scene mScene;
 
   uint32_t mSurfaceWidth;
   uint32_t mSurfaceHeight;
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.cpp b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.cpp
new file mode 100644 (file)
index 0000000..332d77e
--- /dev/null
@@ -0,0 +1,115 @@
+/*
+ * 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 "test-render-surface.h"
+
+namespace Dali
+{
+
+TestRenderSurface::TestRenderSurface( Dali::PositionSize positionSize )
+: mPositionSize( positionSize ),
+  mBackgroundColor()
+{
+}
+
+TestRenderSurface::~TestRenderSurface()
+{
+}
+
+Dali::PositionSize TestRenderSurface::GetPositionSize() const
+{
+  return mPositionSize;
+};
+
+void TestRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical )
+{
+  dpiHorizontal = dpiVertical = 96;
+};
+
+void TestRenderSurface::InitializeGraphics()
+{
+}
+
+void TestRenderSurface::CreateSurface()
+{
+}
+
+void TestRenderSurface::DestroySurface()
+{
+}
+
+bool TestRenderSurface::ReplaceGraphicsSurface()
+{
+  return false;
+}
+
+void TestRenderSurface::MoveResize( Dali::PositionSize positionSize )
+{
+  mPositionSize = positionSize;
+}
+
+void TestRenderSurface::StartRender()
+{
+}
+
+bool TestRenderSurface::PreRender( bool resizingSurface )
+{
+  return true;
+}
+
+void TestRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface )
+{
+}
+
+void TestRenderSurface::StopRender()
+{
+}
+
+void TestRenderSurface::ReleaseLock()
+{
+}
+
+Dali::Integration::RenderSurface::Type TestRenderSurface::GetSurfaceType()
+{
+  return WINDOW_RENDER_SURFACE;
+}
+
+void TestRenderSurface::MakeContextCurrent()
+{
+}
+
+Integration::DepthBufferAvailable TestRenderSurface::GetDepthBufferRequired()
+{
+  return Integration::DepthBufferAvailable::TRUE;
+}
+
+Integration::StencilBufferAvailable TestRenderSurface::GetStencilBufferRequired()
+{
+  return Integration::StencilBufferAvailable::TRUE;
+}
+
+void TestRenderSurface::SetBackgroundColor( Vector4 color )
+{
+  mBackgroundColor = color;
+}
+
+Vector4 TestRenderSurface::GetBackgroundColor()
+{
+  return mBackgroundColor;
+}
+
+} // Namespace dali
diff --git a/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.h b/automated-tests/src/dali-adaptor/dali-test-suite-utils/test-render-surface.h
new file mode 100644 (file)
index 0000000..fba89c2
--- /dev/null
@@ -0,0 +1,155 @@
+#ifndef TEST_REENDER_SURFACE_H
+#define TEST_REENDER_SURFACE_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/public-api/common/dali-common.h>
+#include <dali/integration-api/render-surface.h>
+
+namespace Dali
+{
+
+/**
+ * Concrete implementation of the RenderSurface class.
+ */
+class DALI_CORE_API TestRenderSurface : public Dali::Integration::RenderSurface
+{
+public:
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::RenderSurface
+   */
+  TestRenderSurface( Dali::PositionSize positionSize );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::~RenderSurface
+   */
+  virtual ~TestRenderSurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetPositionSize
+   */
+  virtual Dali::PositionSize GetPositionSize() const;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetDpi
+   */
+  virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::InitializeGraphics
+   */
+  virtual void InitializeGraphics();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::CreateSurface
+   */
+  virtual void CreateSurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::DestroySurface
+   */
+  virtual void DestroySurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface
+   */
+  virtual bool ReplaceGraphicsSurface();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::MoveResize
+   */
+  virtual void MoveResize( Dali::PositionSize positionSize );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::StartRender
+   */
+  virtual void StartRender();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::PreRender
+   */
+  virtual bool PreRender( bool resizingSurface );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::PostRender
+   */
+  virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::StopRender
+   */
+  virtual void StopRender();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::ReleaseLock
+   */
+  virtual void ReleaseLock();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetSurfaceType
+   */
+  virtual Dali::Integration::RenderSurface::Type GetSurfaceType();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent
+   */
+  virtual void MakeContextCurrent();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired
+   */
+  virtual Integration::DepthBufferAvailable GetDepthBufferRequired();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired
+   */
+  virtual Integration::StencilBufferAvailable GetStencilBufferRequired();
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::SetBackgroundColor
+   */
+  virtual void SetBackgroundColor( Vector4 color );
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetBackgroundColor
+   */
+  virtual Vector4 GetBackgroundColor();
+
+private:
+
+  /**
+   * @brief Undefined copy constructor. RenderSurface cannot be copied
+   */
+  TestRenderSurface( const TestRenderSurface& rhs );
+
+  /**
+   * @brief Undefined assignment operator. RenderSurface cannot be copied
+   */
+  TestRenderSurface& operator=( const TestRenderSurface& rhs );
+
+private:
+
+  Dali::PositionSize mPositionSize;
+  Vector4 mBackgroundColor;                                     ///< The background color of the surface
+};
+
+} // Dali
+
+#endif
index 6ad89b6..be00390 100644 (file)
@@ -21,6 +21,7 @@ LIST(APPEND TC_SOURCES
     ../dali-adaptor/dali-test-suite-utils/test-native-image.cpp
     ../dali-adaptor/dali-test-suite-utils/test-platform-abstraction.cpp
     ../dali-adaptor/dali-test-suite-utils/test-render-controller.cpp
+    ../dali-adaptor/dali-test-suite-utils/test-render-surface.cpp
     ../dali-adaptor/dali-test-suite-utils/test-trace-call-stack.cpp
     ../dali-adaptor/dali-test-suite-utils/adaptor-test-adaptor-impl.cpp
     tct-dali-platform-abstraction-core.cpp
index f14bc8d..a2a1246 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.
@@ -30,6 +30,41 @@ void SetPositionSize( Window window, PositionSize positionSize )
   GetImplementation( window ).SetPositionSize( positionSize );
 }
 
+void Add( Window window, Dali::Actor actor )
+{
+  GetImplementation( window ).Add( actor );
+}
+
+void Remove( Window window, Dali::Actor actor )
+{
+  GetImplementation( window ).Remove( actor );
+}
+
+void SetBackgroundColor( Window window, Vector4 color )
+{
+  GetImplementation( window ).SetBackgroundColor( color );
+}
+
+Vector4 GetBackgroundColor( Window window )
+{
+  return GetImplementation( window ).GetBackgroundColor();
+}
+
+Dali::Layer GetRootLayer( Window window )
+{
+  return GetImplementation( window ).GetRootLayer();
+}
+
+uint32_t GetLayerCount( Window window )
+{
+  return GetImplementation( window ).GetLayerCount();
+}
+
+Dali::Layer GetLayer( Window window, uint32_t depth )
+{
+  return GetImplementation( window ).GetLayer( depth );
+}
+
 } // namespace DevelWindow
 
 } // namespace Dali
index 9ed8a18..eec41b7 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_WINDOW_DEVEL_H
 
 /*
- * 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.
@@ -35,6 +35,71 @@ namespace DevelWindow
  */
 DALI_ADAPTOR_API void SetPositionSize( Window window, PositionSize positionSize );
 
+/**
+ * @brief Adds a child Actor to the Window.
+ *
+ * The child will be referenced.
+ * @param[in] window The window instance
+ * @param[in] actor The child
+ * @pre The actor has been initialized.
+ * @pre The actor does not have a parent.
+ */
+DALI_ADAPTOR_API void Add( Window window, Dali::Actor actor );
+
+/**
+ * @brief Removes a child Actor from the Window.
+ *
+ * The child will be unreferenced.
+ * @param[in] window The window instance
+ * @param[in] actor The child
+ * @pre The actor has been added to the stage.
+ */
+DALI_ADAPTOR_API void Remove( Window window, Dali::Actor actor );
+
+/**
+ * @brief Sets the background color of the window.
+ *
+ * @param[in] window The window instance
+ * @param[in] color The new background color
+ */
+DALI_ADAPTOR_API void SetBackgroundColor( Window window, Vector4 color );
+
+/**
+ * @brief Gets the background color of the surface.
+ *
+ * @param[in] window The window instance
+ * @return The background color
+ */
+DALI_ADAPTOR_API Vector4 GetBackgroundColor( Window window );
+
+/**
+ * @brief Returns the Scene's Root Layer.
+ *
+ * @param[in] window The window instance
+ * @return The root layer
+ */
+DALI_ADAPTOR_API Dali::Layer GetRootLayer( Window window );
+
+/**
+ * @brief Queries the number of on-stage layers.
+ *
+ * Note that a default layer is always provided (count >= 1).
+ * @param[in] window The window instance
+ * @return The number of layers
+ */
+DALI_ADAPTOR_API uint32_t GetLayerCount( Window window );
+
+/**
+ * @brief Retrieves the layer at a specified depth.
+ *
+ * @param[in] window The window instance
+ * @param[in] depth The depth
+ * @return The layer found at the given depth
+ * @pre Depth is less than layer count; see GetLayerCount().
+ */
+DALI_ADAPTOR_API Dali::Layer GetLayer( Window window, uint32_t depth );
+
+
 } // namespace DevelWindow
 
 } // namespace Dali
index 14ff203..04f9429 100755 (executable)
@@ -41,7 +41,7 @@
 namespace Dali
 {
 
-class RenderSurface;
+class RenderSurfaceInterface;
 
 namespace Internal
 {
@@ -141,7 +141,7 @@ public:
    * @param[in] surface The surface to draw onto
    * @return a reference to the adaptor handle
    */
-  static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface );
+  static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface );
 
   /**
    * @brief Create a new adaptor using render surface.
@@ -151,7 +151,7 @@ public:
    * @param[in] configuration The context loss configuration.
    * @return a reference to the adaptor handle
    */
-  static Adaptor& New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
+  static Adaptor& New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration = Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS);
 
   /**
    * @brief Virtual Destructor.
@@ -221,14 +221,14 @@ public:
    * @param[in] nativeWindow native window handle
    * @param[in] surface to use
    */
-  void ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface );
+  void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface );
 
   /**
    * @brief Get the render surface the adaptor is using to render to.
    *
    * @return reference to current render surface
    */
-  RenderSurface& GetSurface();
+  Dali::RenderSurfaceInterface& GetSurface();
 
   /**
    * @brief Gets native window handle
index 5208501..823cfa6 100644 (file)
@@ -18,6 +18,9 @@
  *
  */
 
+// EXTERNAL INCLUDES
+#include <EGL/egl.h>
+
 namespace Dali
 {
 
@@ -42,7 +45,7 @@ public:
   /**
    * Make the OpenGL context current
    */
-  virtual void MakeContextCurrent() = 0;
+  virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext ) = 0;
 
   /**
    * Terminate GL
@@ -52,12 +55,12 @@ public:
   /**
    * Performs an OpenGL swap buffers command
    */
-  virtual void SwapBuffers() = 0;
+  virtual void SwapBuffers( EGLSurface& eglSurface ) = 0;
 
   /**
    * Performs an OpenGL copy buffers command
    */
-  virtual void CopyBuffers() = 0;
+  virtual void CopyBuffers( EGLSurface& eglSurface ) = 0;
 
   /**
    * Performs an EGL wait GL command
index d091cf0..40f91cf 100755 (executable)
@@ -4,7 +4,7 @@ adaptor_integration_api_header_files = \
   $(adaptor_integration_api_dir)/log-factory-interface.h \
   $(adaptor_integration_api_dir)/native-render-surface.h \
   $(adaptor_integration_api_dir)/native-render-surface-factory.h \
-  $(adaptor_integration_api_dir)/render-surface.h \
+  $(adaptor_integration_api_dir)/render-surface-interface.h \
   $(adaptor_integration_api_dir)/thread-synchronization-interface.h \
   $(adaptor_integration_api_dir)/trigger-event-interface.h \
   $(adaptor_integration_api_dir)/trigger-event-factory-interface.h \
index bbd5e9b..530468d 100644 (file)
 
 // INTERNAL INCLUDES
 #include <dali/public-api/dali-adaptor-common.h>
+
 #ifdef DALI_ADAPTOR_COMPILATION
 #include <dali/integration-api/egl-interface.h>
-#include <dali/integration-api/render-surface.h>
+#include <dali/integration-api/render-surface-interface.h>
 #else
 #include <dali/integration-api/adaptors/egl-interface.h>
-#include <dali/integration-api/adaptors/render-surface.h>
+#include <dali/integration-api/adaptors/render-surface-interface.h>
 #endif
 
 namespace Dali
@@ -36,7 +37,7 @@ class TriggerEventInterface;
 /**
  * Native interface of render surface.
  */
-class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurface
+class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurfaceInterface
 {
 public:
 
similarity index 59%
rename from dali/integration-api/render-surface.h
rename to dali/integration-api/render-surface-interface.h
index edb9022..ad672ca 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef DALI_RENDER_SURFACE_H
-#define DALI_RENDER_SURFACE_H
+#ifndef DALI_RENDER_SURFACE_INTERFACE_H
+#define DALI_RENDER_SURFACE_INTERFACE_H
 
 /*
  * Copyright (c) 2018 Samsung Electronics Co., Ltd.
  */
 
 // EXTERNAL INCLUDES
-#include <dali/public-api/math/rect.h>
-#include <dali/public-api/object/any.h>
-#include <dali/public-api/common/view-mode.h>
+#include <dali/integration-api/render-surface.h>
+#include <dali/integration-api/core-enumerations.h>
+#include <dali/public-api/math/vector4.h>
 
 // INTERNAL INCLUDES
-#include <dali/public-api/dali-adaptor-common.h>
-
 
 namespace Dali
 {
@@ -35,27 +33,12 @@ class ThreadSynchronizationInterface;
 
 namespace Internal
 {
-
 namespace Adaptor
 {
-
+class AdaptorInternalServices;
 class GraphicsInterface;
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-namespace Integration
-{
-
-class GlAbstraction;
-
-} // namespace Integration
-
-/**
- * @brief The position and size of the render surface.
- */
-typedef Dali::Rect<int> PositionSize;
+}
+}
 
 /**
  * @brief Interface for a render surface onto which Dali draws.
@@ -70,34 +53,34 @@ typedef Dali::Rect<int> PositionSize;
  * implementation of RenderSurface for the given platform
  */
 
-class RenderSurface
+class RenderSurfaceInterface : public Dali::Integration::RenderSurface
 {
 public:
 
-  enum Type
-  {
-    WINDOW_RENDER_SURFACE,
-    PIXMAP_RENDER_SURFACE,
-    NATIVE_RENDER_SURFACE
-  };
-
   /**
    * @brief Constructor
    * Inlined as this is a pure abstract interface
    */
-  RenderSurface() {}
+  RenderSurfaceInterface()
+  : mAdaptor( nullptr ),
+    mGraphics( nullptr ),
+    mDisplayConnection( nullptr ),
+    mDepthBufferRequired( Integration::DepthBufferAvailable::FALSE ),
+    mStencilBufferRequired( Integration::StencilBufferAvailable::FALSE ),
+    mBackgroundColor()
+  {}
 
   /**
    * @brief Virtual Destructor.
    * Inlined as this is a pure abstract interface
    */
-  virtual ~RenderSurface() {}
+  virtual ~RenderSurfaceInterface() {}
 
   /**
    * @brief Return the size and position of the surface.
    * @return The position and size
    */
-  virtual PositionSize GetPositionSize() const = 0;
+  virtual Dali::PositionSize GetPositionSize() const = 0;
 
   /**
    * @brief Get DPI
@@ -108,10 +91,8 @@ public:
 
   /**
    * @brief InitializeGraphics the platform specific graphics surface interfaces
-   * @param[in] graphics The abstracted graphics interface
-   * @param[in] displayConnection The display connection interface
    */
-  virtual void InitializeGraphics( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) = 0;
+  virtual void InitializeGraphics() = 0;
 
   /**
    * @brief Creates the Surface
@@ -176,21 +157,86 @@ public:
   /**
    * @brief Gets the surface type
    */
-  virtual RenderSurface::Type GetSurfaceType() = 0;
+  virtual Dali::Integration::RenderSurface::Type GetSurfaceType() = 0;
+
+  /**
+   * @brief Makes the graphics context current
+   */
+  virtual void MakeContextCurrent() = 0;
+
+  /**
+   * @brief Get whether the depth buffer is required
+   * @return TRUE if the depth buffer is required
+   */
+  virtual Integration::DepthBufferAvailable GetDepthBufferRequired() = 0;
+
+  /**
+   * @brief Get whether the stencil buffer is required
+   * @return TRUE if the stencil buffer is required
+   */
+  virtual Integration::StencilBufferAvailable GetStencilBufferRequired() = 0;
+
+  /**
+   * @brief Sets the background color of the surface.
+   * @param[in] color The new background color
+   */
+  virtual void SetBackgroundColor( Vector4 color ) override
+  {
+    mBackgroundColor = color;
+  }
+
+  /**
+   * @brief Gets the background color of the surface.
+   * @return The background color
+   */
+  virtual Vector4 GetBackgroundColor() override
+  {
+    return mBackgroundColor;
+  }
+
+public:
+
+  void SetAdaptor( Dali::Internal::Adaptor::AdaptorInternalServices& adaptor )
+  {
+    mAdaptor = &adaptor;
+  }
+
+  void SetGraphicsInterface( Dali::Internal::Adaptor::GraphicsInterface& graphics )
+  {
+    mGraphics = &graphics;
+  }
+
+  void SetDisplayConnection( Dali::DisplayConnection& displayConnection )
+  {
+    mDisplayConnection = &displayConnection;
+  }
 
 private:
 
   /**
    * @brief Undefined copy constructor. RenderSurface cannot be copied
    */
-  RenderSurface( const RenderSurface& rhs );
+  RenderSurfaceInterface( const RenderSurfaceInterface& rhs );
 
   /**
    * @brief Undefined assignment operator. RenderSurface cannot be copied
    */
-  RenderSurface& operator=( const RenderSurface& rhs );
+  RenderSurfaceInterface& operator=( const RenderSurfaceInterface& rhs );
+
+protected:
+
+  Dali::Internal::Adaptor::AdaptorInternalServices* mAdaptor;
+  Dali::Internal::Adaptor::GraphicsInterface* mGraphics;
+  Dali::DisplayConnection* mDisplayConnection;
+
+private:
+
+  Integration::DepthBufferAvailable mDepthBufferRequired;       ///< Whether the depth buffer is required
+  Integration::StencilBufferAvailable mStencilBufferRequired;   ///< Whether the stencil buffer is required
+
+  Vector4 mBackgroundColor;                                     ///< The background color of the surface
 };
 
 } // namespace Dali
 
-#endif // DALI_RENDER_SURFACE_H
+#endif // DALI_RENDER_SURFACE_INTERFACE_H
index 73c18d8..daeb943 100755 (executable)
@@ -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.
@@ -83,7 +83,7 @@ thread_local Adaptor* gThreadLocalAdaptor = NULL; // raw thread specific pointer
 } // unnamed namespace
 
 
-Dali::Adaptor* Adaptor::New( Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( Any nativeWindow, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
 {
   Dali::Adaptor* adaptor = new Dali::Adaptor;
   Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions );
@@ -108,7 +108,7 @@ Dali::Adaptor* Adaptor::New( Dali::Window window, Dali::Configuration::ContextLo
   return adaptor;
 }
 
-Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, RenderSurface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
+Dali::Adaptor* Adaptor::New( GraphicsFactory& graphicsFactory, Any nativeWindow, Dali::RenderSurfaceInterface *surface, Dali::Configuration::ContextLoss configuration, EnvironmentOptions* environmentOptions )
 {
   Dali::Adaptor* adaptor = new Dali::Adaptor; // Public adaptor
   Adaptor* impl = new Adaptor( nativeWindow, *adaptor, surface, environmentOptions ); // Impl adaptor
@@ -166,6 +166,8 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
 
   PositionSize size = defaultWindow.surface->GetPositionSize();
 
+  defaultWindow.surface->SetAdaptor(*this);
+
   mGestureManager = new GestureManager(*this, Vector2(size.width, size.height), mCallbackManager, *mEnvironmentOptions);
 
   mGraphics = &( graphicsFactory.Create() );
@@ -173,6 +175,9 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
 
   auto eglGraphics = static_cast<EglGraphics *>( mGraphics ); // This interface is temporary until Core has been updated to match
 
+  // This will only be created once
+  eglGraphics->Create();
+
   GlImplementation& mGLES = eglGraphics->GetGlesInterface();
   EglSyncImplementation& eglSyncImpl = eglGraphics->GetSyncImplementation();
 
@@ -271,8 +276,6 @@ void Adaptor::Initialize( GraphicsFactory& graphicsFactory, Dali::Configuration:
   {
     Dali::TizenPlatform::ImageLoader::SetMaxTextureSize( mEnvironmentOptions->GetMaxTextureSize() );
   }
-
-  SetupSystemInformation();
 }
 
 Adaptor::~Adaptor()
@@ -321,6 +324,10 @@ void Adaptor::Start()
     return;
   }
 
+  mCore->Initialize();
+
+  SetupSystemInformation();
+
   // Start the callback manager
   mCallbackManager->Start();
 
@@ -340,17 +347,12 @@ void Adaptor::Start()
 
   defaultWindow.surface->GetDpi( dpiHor, dpiVer );
 
-  // tell core about the DPI value
-  mCore->SetDpi(dpiHor, dpiVer);
-
   // set the DPI value for font rendering
   FontClient fontClient = FontClient::Get();
   fontClient.SetDpi( dpiHor, dpiVer );
 
   // Tell the core the size of the surface just before we start the render-thread
-  PositionSize size = defaultWindow.surface->GetPositionSize();
-
-  mCore->SurfaceResized( size.width, size.height );
+  mCore->SurfaceResized( defaultWindow.surface );
 
   // Initialize the thread controller
   mThreadController->Initialize();
@@ -488,18 +490,17 @@ void Adaptor::FeedKeyEvent( KeyEvent& keyEvent )
   mEventHandler->FeedKeyEvent( keyEvent );
 }
 
-void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface )
+void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& newSurface )
 {
-  PositionSize positionSize = newSurface.GetPositionSize();
-
   // Let the core know the surface size has changed
-  mCore->SurfaceResized( positionSize.width, positionSize.height );
+  mCore->SurfaceResized( &newSurface );
 
   mResizedSignal.Emit( mAdaptor );
 
   WindowPane newDefaultWindow;
   newDefaultWindow.nativeWindow = nativeWindow;
   newDefaultWindow.surface = &newSurface;
+  newDefaultWindow.surface->SetAdaptor(*this);
 
   WindowPane oldDefaultWindow = mWindowFrame.front();
 
@@ -519,7 +520,7 @@ void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface )
   oldDefaultWindow.surface = nullptr;
 }
 
-RenderSurface& Adaptor::GetSurface() const
+Dali::RenderSurfaceInterface& Adaptor::GetSurface() const
 {
   WindowPane defaultWindow = mWindowFrame.front();
   return *(defaultWindow.surface);
@@ -567,19 +568,21 @@ void Adaptor::SetPreRenderCallback( CallbackBase* callback )
 
 bool Adaptor::AddWindow( Dali::Window* childWindow, const std::string& childWindowName, const std::string& childWindowClassName, const bool& childWindowMode )
 {
+  Window& windowImpl = Dali::GetImplementation( *childWindow );
+  windowImpl.SetAdaptor( Get() );
+
   // This is any Window that is not the main (default) one
   WindowPane additionalWindow;
   additionalWindow.instance = childWindow;
   additionalWindow.window_name = childWindowName;
   additionalWindow.class_name = childWindowClassName;
   additionalWindow.window_mode = childWindowMode;
+  additionalWindow.surface = windowImpl.GetSurface();
+  additionalWindow.id = windowImpl.GetId();
 
   // Add the new Window to the Frame - the order is not important
   mWindowFrame.push_back( additionalWindow );
 
-  Window& windowImpl = Dali::GetImplementation( *childWindow );
-  windowImpl.SetAdaptor( Get() );
-
   return true;
 }
 
@@ -611,6 +614,20 @@ bool Adaptor::RemoveWindow( std::string childWindowName )
   return false;
 }
 
+bool Adaptor::RemoveWindow( Window* childWindow )
+{
+  for ( WindowFrames::iterator iter = mWindowFrame.begin(); iter != mWindowFrame.end(); ++iter )
+  {
+    if( iter->id == childWindow->GetId() )
+    {
+      mWindowFrame.erase( iter );
+      return true;
+    }
+  }
+
+  return false;
+}
+
 Dali::Adaptor& Adaptor::Get()
 {
   DALI_ASSERT_ALWAYS( IsAvailable() && "Adaptor not instantiated" );
@@ -674,7 +691,7 @@ SocketFactoryInterface& Adaptor::GetSocketFactoryInterface()
   return mSocketFactory;
 }
 
-RenderSurface* Adaptor::GetRenderSurfaceInterface()
+Dali::RenderSurfaceInterface* Adaptor::GetRenderSurfaceInterface()
 {
   if( !mWindowFrame.empty())
   {
@@ -894,15 +911,15 @@ void Adaptor::OnDamaged( const DamageArea& area )
   RequestUpdate( false );
 }
 
-void Adaptor::SurfaceResizePrepare( SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
 {
   // Let the core know the surface size has changed
-  mCore->SurfaceResized( surfaceSize.GetWidth(), surfaceSize.GetHeight() );
+  mCore->SurfaceResized( surface );
 
   mResizedSignal.Emit( mAdaptor );
 }
 
-void Adaptor::SurfaceResizeComplete( SurfaceSize surfaceSize )
+void Adaptor::SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize )
 {
   // Flush the event queue to give the update-render thread chance
   // to start processing messages for new camera setup etc as soon as possible
@@ -957,12 +974,6 @@ void Adaptor::RequestUpdateOnce()
   }
 }
 
-void Adaptor::IndicatorSizeChanged(int height)
-{
-  // Let the core know the indicator height is changed
-  mCore->SetTopMargin(height);
-}
-
 bool Adaptor::ProcessCoreEventsFromIdle()
 {
   ProcessCoreEvents();
@@ -973,7 +984,7 @@ bool Adaptor::ProcessCoreEventsFromIdle()
   return false;
 }
 
-Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions)
+Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions)
 : mResizedSignal(),
   mLanguageChangedSignal(),
   mAdaptor( adaptor ),
@@ -1011,6 +1022,7 @@ Adaptor::Adaptor(Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surfac
   WindowPane defaultWindow;
   defaultWindow.nativeWindow = nativeWindow;
   defaultWindow.surface = surface;
+  defaultWindow.id = 0;
 
   std::vector<WindowPane>::iterator iter = mWindowFrame.begin();
   iter = mWindowFrame.insert( iter, defaultWindow );
index af7eb87..428680c 100755 (executable)
@@ -49,7 +49,7 @@
 namespace Dali
 {
 
-class RenderSurface;
+class RenderSurfaceInterface;
 class Window;
 
 namespace Integration
@@ -106,7 +106,7 @@ public:
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
   static Dali::Adaptor* New( Any nativeWindow,
-                             RenderSurface* surface,
+                             Dali::RenderSurfaceInterface* surface,
                              Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
 
@@ -132,7 +132,7 @@ public:
    */
   static Dali::Adaptor* New( GraphicsFactory& graphicsFactory,
                              Any nativeWindow,
-                             RenderSurface* surface,
+                             Dali::RenderSurfaceInterface* surface,
                              Dali::Configuration::ContextLoss configuration,
                              EnvironmentOptions* environmentOptions );
 
@@ -224,12 +224,12 @@ public: // AdaptorInternalServices implementation
   /**
    * @copydoc AdaptorInterface::ReplaceSurface()
    */
-  virtual void ReplaceSurface( Any nativeWindow, RenderSurface& surface );
+  virtual void ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface );
 
   /**
    * @copydoc Dali::Adaptor::GetSurface()
    */
-  virtual RenderSurface& GetSurface() const;
+  virtual Dali::RenderSurfaceInterface& GetSurface() const;
 
   /**
    * @copydoc Dali::Adaptor::ReleaseSurfaceLock()
@@ -283,6 +283,12 @@ public: // AdaptorInternalServices implementation
    */
   void SetPreRenderCallback( CallbackBase* callback );
 
+  /**
+   * Removes an existing Window instance from the Adaptor
+   * @param[in]  childWindow The Window instance
+   */
+  bool RemoveWindow( Dali::Internal::Adaptor::Window* childWindow );
+
 public:
 
   /**
@@ -380,11 +386,6 @@ public:
   void RequestUpdateOnce();
 
   /**
-   * Request adaptor to update indicator's height
-   */
-  void IndicatorSizeChanged(int height);
-
-  /**
    * @copydoc Dali::Adaptor::NotifySceneCreated()
    */
   void NotifySceneCreated();
@@ -402,12 +403,12 @@ public:
   /**
    * Informs core the surface size has changed
    */
-  void SurfaceResizePrepare( SurfaceSize surfaceSize );
+  void SurfaceResizePrepare( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
 
   /**
    * Informs ThreadController the surface size has changed
    */
-  void SurfaceResizeComplete( SurfaceSize surfaceSize );
+  void SurfaceResizeComplete( Dali::RenderSurfaceInterface* surface, SurfaceSize surfaceSize );
 
   /**
    * Sets layout direction of root by system language
@@ -470,7 +471,7 @@ public:  //AdaptorInternalServices
   /**
    * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetRenderSurfaceInterface()
    */
-  virtual RenderSurface* GetRenderSurfaceInterface();
+  virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface();
 
   /**
    * @copydoc Dali::Internal::Adaptor::AdaptorInternalServices::GetVSyncMonitorInterface()
@@ -565,7 +566,7 @@ private:
    * Assigns the render surface to the adaptor
    *
    */
-  void SetSurface(RenderSurface *surface);
+  void SetSurface(Dali::RenderSurfaceInterface *surface);
 
   /**
    * called after surface is created
@@ -615,7 +616,7 @@ private:
    *                          - Window, adaptor will use existing Window to draw on to
    * @param[in]  environmentOptions  A pointer to the environment options. If NULL then one is created.
    */
-  Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, RenderSurface* surface, EnvironmentOptions* environmentOptions );
+  Adaptor( Any nativeWindow, Dali::Adaptor& adaptor, Dali::RenderSurfaceInterface* surface, EnvironmentOptions* environmentOptions );
 
 private: // Types
 
@@ -636,7 +637,8 @@ private: // Types
     std::string    class_name;   ///< Class name that the window belongs to
     bool           window_mode;  ///< Display mode of the window
     Any            nativeWindow; ///< window identifier
-    RenderSurface* surface;      ///< The surface the Window is bound to
+    uint32_t       id;           ///< unique Window ID
+    Dali::RenderSurfaceInterface* surface;      ///< The surface the Window is bound to
   } WindowPane;
 
   typedef std::vector<WindowPane> WindowFrames;
index 4823a6b..db4a360 100644 (file)
@@ -25,6 +25,7 @@
 // INTERNAL INCLUDES
 #include <dali/integration-api/trigger-event-interface.h>
 #include <dali/integration-api/trigger-event-factory-interface.h>
+#include <dali/integration-api/render-surface-interface.h>
 #include <dali/internal/window-system/common/display-connection.h>
 #include <dali/internal/graphics/common/graphics-interface.h>
 #include <dali/internal/graphics/gles/egl-factory-interface.h>
@@ -34,7 +35,6 @@
 #include <dali/internal/network/common/trace-interface.h>
 #include <dali/integration-api/render-surface.h>
 
-
 namespace Dali
 {
 
@@ -97,7 +97,7 @@ public:
   /**
    * @return render surface
    */
-  virtual RenderSurface* GetRenderSurfaceInterface() = 0;
+  virtual Dali::RenderSurfaceInterface* GetRenderSurfaceInterface() = 0;
 
   /**
    * @return vsync monitor interface
index 377a031..66b28ee 100755 (executable)
@@ -41,14 +41,14 @@ Adaptor& Adaptor::New( Window window, Configuration::ContextLoss configuration )
   return *adaptor;
 }
 
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface )
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface )
 {
   return New( nativeWindow, surface, Configuration::APPLICATION_DOES_NOT_HANDLE_CONTEXT_LOSS );
 }
 
-Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurface& surface, Configuration::ContextLoss configuration )
+Adaptor& Adaptor::New( Any nativeWindow, const Dali::RenderSurfaceInterface& surface, Configuration::ContextLoss configuration )
 {
-  Dali::RenderSurface* pSurface = const_cast<Dali::RenderSurface *>(&surface);
+  Dali::RenderSurfaceInterface* pSurface = const_cast<Dali::RenderSurfaceInterface *>(&surface);
   Adaptor* adaptor = Internal::Adaptor::Adaptor::New( nativeWindow, pSurface, configuration, NULL );
   return *adaptor;
 }
@@ -88,7 +88,7 @@ void Adaptor::RemoveIdle( CallbackBase* callback )
   mImpl->RemoveIdle( callback );
 }
 
-void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurface& surface )
+void Adaptor::ReplaceSurface( Any nativeWindow, Dali::RenderSurfaceInterface& surface )
 {
   mImpl->ReplaceSurface(nativeWindow, surface);
 }
@@ -103,7 +103,7 @@ Adaptor::AdaptorSignalType& Adaptor::LanguageChangedSignal()
   return mImpl->LanguageChangedSignal();
 }
 
-RenderSurface& Adaptor::GetSurface()
+Dali::RenderSurfaceInterface& Adaptor::GetSurface()
 {
   return mImpl->GetSurface();
 }
index 7856020..8e90b04 100644 (file)
 #include <dali/internal/adaptor/common/framework.h>
 #include <dali/internal/system/common/singleton-service-impl.h>
 #include <dali/internal/adaptor/common/lifecycle-controller-impl.h>
+#include <dali/internal/window-system/common/window-impl.h>
 #include <dali/internal/window-system/common/window-render-surface.h>
 
+#undef Status
+
 namespace Dali
 {
 
@@ -439,7 +442,7 @@ void Application::ReplaceWindow( const PositionSize& positionSize, const std::st
     GetImplementation( newWindow ).SetIndicatorVisibleMode( static_cast< Dali::Window::IndicatorVisibleMode >( indicatorVisibleMode ) );
   }
 
-  Dali::RenderSurface* renderSurface = windowImpl.GetSurface();
+  Internal::Adaptor::WindowRenderSurface* renderSurface = windowImpl.GetSurface();
 
   Any nativeWindow = newWindow.GetNativeHandle();
   Internal::Adaptor::Adaptor::GetImplementation( *mAdaptor ).ReplaceSurface(nativeWindow, *renderSurface);
index 4c7b79f..25555a5 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.
@@ -29,6 +29,9 @@
 #include <dali/internal/system/common/time-service.h>
 #include <dali/internal/adaptor/common/adaptor-internal-services.h>
 #include <dali/devel-api/adaptor-framework/thread-settings.h>
+#include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/graphics/gles/egl-implementation.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
 
 namespace Dali
 {
@@ -119,7 +122,7 @@ CombinedUpdateRenderController::CombinedUpdateRenderController( AdaptorInternalS
   SetRenderRefreshRate( environmentOptions.GetRenderRefreshRate() );
 
   // Set the thread-synchronization interface on the render-surface
-  RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+  Dali::RenderSurfaceInterface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
   {
     currentSurface->SetThreadSynchronization( *this );
@@ -169,7 +172,7 @@ void CombinedUpdateRenderController::Start()
     sem_wait( &mEventThreadSemaphore );
   }
 
-  RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+  Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
   {
     currentSurface->StartRender();
@@ -215,7 +218,7 @@ void CombinedUpdateRenderController::Stop()
   LOG_EVENT_TRACE;
 
   // Stop Rendering and the Update/Render Thread
-  RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+  Integration::RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
   {
     currentSurface->StopRender();
@@ -275,7 +278,7 @@ void CombinedUpdateRenderController::RequestUpdateOnce()
   }
 }
 
-void CombinedUpdateRenderController::ReplaceSurface( RenderSurface* newSurface )
+void CombinedUpdateRenderController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
 {
   LOG_EVENT_TRACE;
 
@@ -407,12 +410,38 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   LOG_UPDATE_RENDER( "THREAD CREATED" );
 
-  RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+  // Initialize EGL & OpenGL
+  Dali::DisplayConnection& displayConnection = mAdaptorInterfaces.GetDisplayConnectionInterface();
+  displayConnection.Initialize();
+
+  RenderSurfaceInterface* currentSurface = nullptr;
+
+#if DALI_GLES_VERSION >= 30
+
+  GraphicsInterface& graphics = mAdaptorInterfaces.GetGraphicsInterface();
+  EglGraphics* eglGraphics = static_cast<EglGraphics *>(&graphics);
+
+  // This will only be created once
+  EglInterface* eglInterface = &eglGraphics->GetEglInterface();
+
+  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( *eglInterface );
+  eglImpl.ChooseConfig( true, COLOR_DEPTH_32 ); // Always use this for shared context???
+
+  // Create a surfaceless OpenGL context for shared resources
+  eglImpl.CreateContext();
+  eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() );
+
+#else // DALI_GLES_VERSION >= 30
+
+  currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
   {
-    currentSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
+    currentSurface->InitializeGraphics();
+    currentSurface->MakeContextCurrent();
   }
 
+#endif
+
   // Tell core it has a context
   mCore.ContextCreated();
 
@@ -458,7 +487,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     // REPLACE SURFACE
     //////////////////////////////
 
-    RenderSurface* newSurface = ShouldSurfaceBeReplaced();
+    Integration::RenderSurface* newSurface = ShouldSurfaceBeReplaced();
     if( DALI_UNLIKELY( newSurface ) )
     {
       LOG_UPDATE_RENDER_TRACE_FMT( "Replacing Surface" );
@@ -469,7 +498,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       // If the new surface has a different display connection, then the context will be lost
 
       mAdaptorInterfaces.GetDisplayConnectionInterface().Initialize();
-      newSurface->InitializeGraphics( mAdaptorInterfaces.GetGraphicsInterface(), mAdaptorInterfaces.GetDisplayConnectionInterface() );
+      newSurface->InitializeGraphics();
       newSurface->ReplaceGraphicsSurface();
       SurfaceReplaced();
     }
@@ -516,7 +545,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
     }
 
     // Check resize
-    bool surfaceResized = false;
     bool shouldSurfaceBeResized = ShouldSurfaceBeResized();
     if( DALI_UNLIKELY( shouldSurfaceBeResized ) )
     {
@@ -524,7 +552,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       {
         LOG_UPDATE_RENDER_TRACE_FMT( "Resizing Surface" );
         SurfaceResized();
-        surfaceResized = true;
       }
     }
 
@@ -547,11 +574,10 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       }
     }
 
-    currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
-    if( currentSurface )
-    {
-      currentSurface->PreRender( surfaceResized );
-    }
+#if DALI_GLES_VERSION >= 30
+    // Make the shared surfaceless context as current before rendering
+    eglImpl.MakeContextCurrent( EGL_NO_SURFACE, eglImpl.GetContext() );
+#endif
 
     Integration::RenderStatus renderStatus;
 
@@ -561,14 +587,6 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
     mForceClear = false;
 
-    if( renderStatus.NeedsPostRender() )
-    {
-      if( currentSurface )
-      {
-        currentSurface->PostRender( isRenderingToFbo, ( mNewSurface != NULL ), surfaceResized );
-      }
-    }
-
     // Trigger event thread to request Update/Render thread to sleep if update not required
     if( ( Integration::KeepUpdating::NOT_REQUESTED == keepUpdatingStatus ) && !renderStatus.NeedsUpdate() )
     {
@@ -691,11 +709,11 @@ bool CombinedUpdateRenderController::UpdateRenderReady( bool& useElapsedTime, bo
   return ! mDestroyUpdateRenderThread;
 }
 
-RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced()
+Integration::RenderSurface* CombinedUpdateRenderController::ShouldSurfaceBeReplaced()
 {
   ConditionalWait::ScopedLock lock( mUpdateRenderThreadWaitCondition );
 
-  RenderSurface* newSurface = mNewSurface;
+  Integration::RenderSurface* newSurface = mNewSurface;
   mNewSurface = NULL;
 
   return newSurface;
index 6eafcf1..bdb51b0 100644 (file)
@@ -36,7 +36,7 @@
 namespace Dali
 {
 
-class RenderSurface;
+class RenderSurfaceInterface;
 class TriggerEventInterface;
 
 namespace Internal
@@ -124,7 +124,7 @@ public:
   /**
    * @copydoc ThreadControllerInterface::ReplaceSurface()
    */
-  virtual void ReplaceSurface( RenderSurface* surface );
+  virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
 
   /**
    * @copydoc ThreadControllerInterface::ResizeSurface()
@@ -217,7 +217,7 @@ private:
    *
    * @return Pointer to the new surface, NULL otherwise
    */
-  RenderSurface* ShouldSurfaceBeReplaced();
+  Integration::RenderSurface* ShouldSurfaceBeReplaced();
 
   /**
    * Called by the Update/Render thread after a surface has been replaced.
@@ -334,7 +334,7 @@ private:
 
   volatile unsigned int             mUseElapsedTimeAfterWait;          ///< Whether we should use the elapsed time after waiting (set by the event-thread, read by the update-render-thread).
 
-  RenderSurface* volatile           mNewSurface;                       ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
+  Integration::RenderSurface* volatile mNewSurface;                    ///< Will be set to the new-surface if requested (set by the event-thread, read & cleared by the update-render thread).
 
   volatile unsigned int             mPostRendering;                    ///< Whether post-rendering is taking place (set by the event & render threads, read by the render-thread).
   volatile unsigned int             mSurfaceResized;                   ///< Will be set to resize the surface (set by the event-thread, read & cleared by the update-render thread).
index 8f4aabc..6885819 100644 (file)
@@ -23,7 +23,7 @@
 namespace Dali
 {
 
-class RenderSurface;
+class RenderSurfaceInterface;
 
 namespace Internal
 {
@@ -83,7 +83,7 @@ public:
    * Replaces the surface.
    * @param surface new surface
    */
-  virtual void ReplaceSurface( RenderSurface* surface ) = 0;
+  virtual void ReplaceSurface( Dali::RenderSurfaceInterface* surface ) = 0;
 
   /**
    * Resize the surface.
index f944bd7..8e6d5be 100644 (file)
@@ -193,12 +193,20 @@ struct Framework::Impl
     mApplicationType = type;
     mCallbackManager = CallbackManager::New();
 
-    char* region;
-    char* language;
+    char* region = nullptr;
+    char* language = nullptr;
     system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY, &region );
     system_settings_get_value_string( SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE, &language );
-    mRegion = std::string( region );
-    mLanguage = std::string( language );
+
+    if (region != nullptr)
+    {
+      mRegion = std::string( region );
+    }
+
+    if ( language != nullptr)
+    {
+      mLanguage = std::string( language );
+    }
   }
 
   ~Impl()
index de42dea..ebaaa5a 100644 (file)
@@ -72,7 +72,6 @@ void EglGraphics::Destroy()
 {
 }
 
-//Dali::Integration::GlAbstraction& EglGraphics::GetGlesInterface()
 GlImplementation& EglGraphics::GetGlesInterface()
 {
   return *mGLES;
index 783c06a..1e6ce24 100755 (executable)
@@ -68,7 +68,6 @@ EglImplementation::EglImplementation( int multiSamplingLevel,
   mColorDepth( COLOR_DEPTH_24 ),
   mGlesInitialized( false ),
   mIsOwnSurface( true ),
-  mContextCurrent( false ),
   mIsWindow( true ),
   mDepthBufferRequired( depthBufferRequired == Integration::DepthBufferAvailable::TRUE ),
   mStencilBufferRequired( stencilBufferRequired == Integration::StencilBufferAvailable::TRUE )
@@ -149,32 +148,53 @@ bool EglImplementation::CreateContext()
   return true;
 }
 
-void EglImplementation::DestroyContext()
+bool EglImplementation::CreateWindowContext( EGLContext& eglContext )
+{
+  // make sure a context isn't created twice
+  DALI_ASSERT_ALWAYS( (eglContext == 0) && "EGL context recreated" );
+
+  eglContext = eglCreateContext(mEglDisplay, mEglConfig, mEglContext, &(mContextAttribs[0]));
+  TEST_EGL_ERROR("eglCreateContext render thread");
+
+  DALI_ASSERT_ALWAYS( EGL_NO_CONTEXT != eglContext && "EGL context not created" );
+
+  DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VENDOR : %s ***\n", glGetString(GL_VENDOR));
+  DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_RENDERER : %s ***\n", glGetString(GL_RENDERER));
+  DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_VERSION : %s ***\n", glGetString(GL_VERSION));
+  DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** GL_SHADING_LANGUAGE_VERSION : %s***\n", glGetString(GL_SHADING_LANGUAGE_VERSION));
+  DALI_LOG_INFO(Debug::Filter::gShader, Debug::General, "*** Supported Extensions ***\n%s\n\n", glGetString(GL_EXTENSIONS));
+
+  mEglWindowContexts.push_back( eglContext );
+
+  return true;
+}
+
+void EglImplementation::DestroyContext( EGLContext& eglContext )
 {
   DALI_ASSERT_ALWAYS( mEglContext && "no EGL context" );
 
-  eglDestroyContext( mEglDisplay, mEglContext );
-  mEglContext = 0;
+  eglDestroyContext( mEglDisplay, eglContext );
+  eglContext = 0;
 }
 
-void EglImplementation::DestroySurface()
+void EglImplementation::DestroySurface( EGLSurface& eglSurface )
 {
-  if(mIsOwnSurface && mCurrentEglSurface)
+  if(mIsOwnSurface && eglSurface)
   {
     // Make context null to prevent crash in driver side
     MakeContextNull();
-    eglDestroySurface( mEglDisplay, mCurrentEglSurface );
-    mCurrentEglSurface = 0;
+    eglDestroySurface( mEglDisplay, eglSurface );
+    eglSurface = 0;
   }
 }
 
-void EglImplementation::MakeContextCurrent()
+void EglImplementation::MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext )
 {
-  mContextCurrent = true;
+  mCurrentEglSurface = eglSurface;
 
   if(mIsOwnSurface)
   {
-    eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, mEglContext );
+    eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, eglContext );
   }
 
   EGLint error = eglGetError();
@@ -205,7 +225,7 @@ void EglImplementation::MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglS
 
   if(mIsOwnSurface)
   {
-    eglMakeCurrent( mEglDisplay, mCurrentEglSurface, mCurrentEglSurface, mEglContext );
+    eglMakeCurrent( mEglDisplay, eglSurface, eglSurface, mEglContext );
   }
 
   EGLint error = eglGetError();
@@ -220,7 +240,6 @@ void EglImplementation::MakeCurrent( EGLNativePixmapType pixmap, EGLSurface eglS
 
 void EglImplementation::MakeContextNull()
 {
-  mContextCurrent = false;
   // clear the current context
   eglMakeCurrent( mEglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT );
 }
@@ -232,11 +251,18 @@ void EglImplementation::TerminateGles()
     // Make context null to prevent crash in driver side
     MakeContextNull();
 
-    if(mIsOwnSurface && mCurrentEglSurface)
+    for ( auto eglSurface : mEglWindowSurfaces )
     {
-      eglDestroySurface(mEglDisplay, mCurrentEglSurface);
+      if(mIsOwnSurface && eglSurface)
+      {
+        eglDestroySurface(mEglDisplay, eglSurface);
+      }
     }
     eglDestroyContext(mEglDisplay, mEglContext);
+    for ( auto eglContext : mEglWindowContexts )
+    {
+      eglDestroyContext(mEglDisplay, eglContext);
+    }
 
     eglTerminate(mEglDisplay);
 
@@ -254,14 +280,17 @@ bool EglImplementation::IsGlesInitialized() const
   return mGlesInitialized;
 }
 
-void EglImplementation::SwapBuffers()
+void EglImplementation::SwapBuffers( EGLSurface& eglSurface )
 {
-  eglSwapBuffers( mEglDisplay, mCurrentEglSurface );
+  if ( eglSurface != EGL_NO_SURFACE ) // skip if using surfaceless context
+  {
+    eglSwapBuffers( mEglDisplay, eglSurface );
+  }
 }
 
-void EglImplementation::CopyBuffers()
+void EglImplementation::CopyBuffers( EGLSurface& eglSurface )
 {
-  eglCopyBuffers( mEglDisplay, mCurrentEglSurface, mCurrentEglNativePixmap );
+  eglCopyBuffers( mEglDisplay, eglSurface, mCurrentEglNativePixmap );
 }
 
 void EglImplementation::WaitGL()
@@ -276,6 +305,8 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
     return;
   }
 
+  bool isTransparent = ( depth == COLOR_DEPTH_32 );
+
   mIsWindow = isWindowType;
 
   EGLint numConfigs;
@@ -326,15 +357,18 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
   configAttribs.PushBack( EGL_BLUE_SIZE );
   configAttribs.PushBack( 8 );
 
-  configAttribs.PushBack( EGL_ALPHA_SIZE );
+  if ( isTransparent )
+  {
+    configAttribs.PushBack( EGL_ALPHA_SIZE );
 #ifdef _ARCH_ARM_
-  // For underlay video playback, we also need to set the alpha value of the 24/32bit window.
-  configAttribs.PushBack( 8 );
+    // For underlay video playback, we also need to set the alpha value of the 24/32bit window.
+    configAttribs.PushBack( 8 );
 #else
-  // There is a bug in the desktop emulator
-  // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing
-  configAttribs.PushBack( 0 );
+    // There is a bug in the desktop emulator
+    // setting EGL_ALPHA_SIZE to 8 results in eglChooseConfig failing
+    configAttribs.PushBack( 8 );
 #endif // _ARCH_ARM_
+  }
 
   configAttribs.PushBack( EGL_DEPTH_SIZE );
   configAttribs.PushBack( mDepthBufferRequired ? 24 : 0 );
@@ -393,10 +427,8 @@ void EglImplementation::ChooseConfig( bool isWindowType, ColorDepth depth )
   }
 }
 
-void EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth )
+EGLSurface EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth )
 {
-  DALI_ASSERT_ALWAYS( ( mCurrentEglSurface == 0 ) && "EGL surface already exists" );
-
   mEglNativeWindow = window;
   mColorDepth = depth;
   mIsWindow = true;
@@ -408,6 +440,8 @@ void EglImplementation::CreateSurfaceWindow( EGLNativeWindowType window, ColorDe
   TEST_EGL_ERROR("eglCreateWindowSurface");
 
   DALI_ASSERT_ALWAYS( mCurrentEglSurface && "Create window surface failed" );
+
+  return mCurrentEglSurface;
 }
 
 EGLSurface EglImplementation::CreateSurfacePixmap( EGLNativePixmapType pixmap, ColorDepth depth )
@@ -427,7 +461,7 @@ EGLSurface EglImplementation::CreateSurfacePixmap( EGLNativePixmapType pixmap, C
   return mCurrentEglSurface;
 }
 
-bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window )
+bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext )
 {
   bool contextLost = false;
 
@@ -436,13 +470,13 @@ bool EglImplementation::ReplaceSurfaceWindow( EGLNativeWindowType window )
   MakeContextNull();
 
   // destroy the surface
-  DestroySurface();
+  DestroySurface( eglSurface );
 
   // create the EGL surface
   CreateSurfaceWindow( window, mColorDepth );
 
   // set the context to be current with the new surface
-  MakeContextCurrent();
+  MakeContextCurrent( eglSurface, eglContext );
 
   return contextLost;
 }
@@ -466,7 +500,7 @@ EGLDisplay EglImplementation::GetDisplay() const
   return mEglDisplay;
 }
 
-EGLDisplay EglImplementation::GetContext() const
+EGLContext EglImplementation::GetContext() const
 {
   return mEglContext;
 }
index eeb33e3..e299da7 100644 (file)
@@ -22,6 +22,7 @@
 #include <EGL/egl.h>
 #include <EGL/eglext.h>
 #include <dali/public-api/common/dali-vector.h>
+#include <dali/public-api/common/vector-wrapper.h>
 #include <dali/integration-api/core-enumerations.h>
 
 // INTERNAL INCLUDES
@@ -69,25 +70,31 @@ public:
   bool InitializeGles( EGLNativeDisplayType display, bool isOwnSurface = true );
 
   /**
-    * Create the OpenGL context.
+    * Create the OpenGL context for the shared resource.
     * @return true if successful
     */
   virtual bool CreateContext();
 
   /**
+    * Create the OpenGL context for the window.
+    * @return true if successful
+    */
+  bool CreateWindowContext( EGLContext& mEglContext );
+
+  /**
     * Destroy the OpenGL context.
     */
-  void DestroyContext();
+  void DestroyContext( EGLContext& eglContext );
 
   /**
     * Destroy the OpenGL surface.
     */
-  void DestroySurface();
+  void DestroySurface( EGLSurface& eglSurface );
 
   /**
    * Make the OpenGL context current
    */
-  virtual void MakeContextCurrent();
+  virtual void MakeContextCurrent( EGLSurface eglSurface, EGLContext eglContext );
 
   /**
    * clear the OpenGL context
@@ -116,12 +123,12 @@ public:
   /**
    * Performs an OpenGL swap buffers command
    */
-  virtual void SwapBuffers();
+  virtual void SwapBuffers( EGLSurface& eglSurface );
 
   /**
    * Performs an OpenGL copy buffers command
    */
-  virtual void CopyBuffers();
+  virtual void CopyBuffers( EGLSurface& eglSurface );
 
   /**
    * Performs an EGL wait GL command
@@ -139,9 +146,9 @@ public:
     * Create an OpenGL surface using a window
     * @param window The window to create the surface on
     * @param colorDepth Bit per pixel value (ex. 32 or 24)
-    * @return true on success, false on failure
+    * @return Handle to an on-screen EGL window surface (the requester has an ownership of this egl surface)
     */
-  void CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth );
+  EGLSurface CreateSurfaceWindow( EGLNativeWindowType window, ColorDepth depth );
 
   /**
    * Create the OpenGL surface using a pixmap
@@ -157,7 +164,7 @@ public:
    * @return true if the context was lost due to a change in display
    *         between old surface and new surface
    */
-  bool ReplaceSurfaceWindow( EGLNativeWindowType window );
+  bool ReplaceSurfaceWindow( EGLNativeWindowType window, EGLSurface& eglSurface, EGLContext& eglContext );
 
   /**
    * Replaces the render surface
@@ -192,16 +199,22 @@ private:
 
   EGLDisplay           mEglDisplay;
   EGLConfig            mEglConfig;
-  EGLContext           mEglContext;
+  EGLContext           mEglContext;                            ///< The resource context holding assets such as textures to be shared
+
+  typedef std::vector<EGLContext> EglWindowContextContainer;
+  EglWindowContextContainer mEglWindowContexts;                ///< The EGL context for the window
+
   EGLSurface           mCurrentEglSurface;
 
+  typedef std::vector<EGLSurface> EglWindowSurfaceContainer;
+  EglWindowSurfaceContainer mEglWindowSurfaces;                ///< The EGL surface for the window
+
   int                  mMultiSamplingLevel;
 
   ColorDepth           mColorDepth;
 
   bool                 mGlesInitialized;
   bool                 mIsOwnSurface;
-  bool                 mContextCurrent;
   bool                 mIsWindow;
   bool                 mDepthBufferRequired;
   bool                 mStencilBufferRequired;
index 0a50e91..34255a5 100755 (executable)
@@ -329,7 +329,7 @@ void InputMethodContextEcoreWl::CreateContext()
       // If we fail to get window id, we can't use the InputMethodContext correctly.
       // Thus you have to call "ecore_imf_context_client_window_set" somewhere.
       // In EvasPlugIn, this function is called in EvasPlugin::ConnectEcoreEvent().
-      RenderSurface& renderSurface = Dali::Adaptor::Get().GetSurface();
+      Dali::RenderSurfaceInterface& renderSurface = Dali::Adaptor::Get().GetSurface();
       WindowRenderSurface& windowRenderSurface = static_cast< WindowRenderSurface& >( renderSurface );
 
       int windowId = windowRenderSurface.GetNativeWindowId();
index 3cffd54..3d70efe 100644 (file)
@@ -85,7 +85,7 @@ void ThreadController::RequestUpdateOnce()
   mThreadControllerInterface->RequestUpdateOnce();
 }
 
-void ThreadController::ReplaceSurface( RenderSurface* newSurface )
+void ThreadController::ReplaceSurface( Dali::RenderSurfaceInterface* newSurface )
 {
   mThreadControllerInterface->ReplaceSurface( newSurface );
 }
index e4c3541..85d94fa 100644 (file)
@@ -25,7 +25,7 @@
 namespace Dali
 {
 
-class RenderSurface;
+class RenderSurfaceInterface;
 
 namespace Internal
 {
@@ -105,7 +105,7 @@ public:
    *
    * @param surface new surface
    */
-  void ReplaceSurface( RenderSurface* surface );
+  void ReplaceSurface( Dali::RenderSurfaceInterface* surface );
 
   /**
    * Resize the surface.
index b5fe5b3..4c21cb6 100644 (file)
@@ -74,7 +74,7 @@ public:
    * Sets the render surface type
    * @param[in] type The render surface type
    */
-  virtual void SetSurfaceType( RenderSurface::Type type ) = 0;
+  virtual void SetSurfaceType( Integration::RenderSurface::Type type ) = 0;
 
   /**
    * Sets the graphics interface
index 1535056..8d3a080 100644 (file)
@@ -38,7 +38,7 @@ DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInte
   return new DisplayConnection(internal);
 }
 
-DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type )
+DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Integration::RenderSurface::Type type )
 {
   auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
   auto displayConnection = factory->CreateDisplayConnection();
index 1fc12ca..00c67c8 100644 (file)
@@ -56,7 +56,7 @@ public:
    * @param[in] type Render surface type
    * @return A handle to a newly allocated DisplayConnection resource.
    */
-  static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, RenderSurface::Type type );
+  static DisplayConnection* New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Integration::RenderSurface::Type type );
 
   /**
    * @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
index a52915f..744d9a9 100755 (executable)
@@ -97,7 +97,7 @@ static unsigned int GetCurrentMilliSeconds(void)
 
 } // unnamed namespace
 
-EventHandler::EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector )
+EventHandler::EventHandler( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector )
 : mCoreEventInterface( coreEventInterface ),
   mGestureManager( gestureManager ),
   mStyleMonitor( StyleMonitor::Get() ),
index 18125f8..be46842 100755 (executable)
 namespace Dali
 {
 
+namespace Integration
+{
+
 class RenderSurface;
 
+}
+
 namespace Internal
 {
 
@@ -65,7 +70,7 @@ public:
    * @param[in]  damageObserver           The damage observer (to pass damage events to).
    * @param[in]  dndDetector              The Drag & Drop listener (to pass DnD events to).
    */
-  EventHandler( RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector );
+  EventHandler( Integration::RenderSurface* surface, CoreEventInterface& coreEventInterface, GestureManager& gestureManager, DamageObserver& damageObserver, DragAndDropDetectorPtr dndDetector );
 
   /**
    * Destructor.
index ded1216..f1eb81c 100644 (file)
@@ -18,6 +18,7 @@
 // INTERNAL INCLUDES
 #include <dali/integration-api/native-render-surface.h>
 #include <dali/internal/window-system/common/render-surface-factory.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
 
 namespace Dali
 {
index 4b5512f..6d139d6 100644 (file)
  */
 
 // INTERNAL INCLUDES
-#include <dali/integration-api/render-surface.h>
+
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/render-surface-interface.h>
+#include <dali/internal/graphics/common/graphics-interface.h>
+#else
+#include <dali/integration-api/adaptors/render-surface-interface.h>
+#endif
+
 
 namespace Dali
 {
@@ -34,7 +41,7 @@ namespace Adaptor
 /**
  * Pixmap interface of render surface.
  */
-class PixmapRenderSurface : public Dali::RenderSurface
+class PixmapRenderSurface : public Dali::RenderSurfaceInterface
 {
 public:
 
@@ -62,6 +69,22 @@ public: // API
    */
   virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) = 0;
 
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired()
+   */
+  Integration::DepthBufferAvailable GetDepthBufferRequired() override
+  {
+    return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE;
+  }
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired()
+   */
+  Integration::StencilBufferAvailable GetStencilBufferRequired() override
+  {
+    return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
+  }
+
 private:
 
   /**
index 2d8cc15..fd9d99a 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.
 // EXTERNAL HEADERS
 #include <dali/integration-api/core.h>
 #include <dali/integration-api/render-task-list-integ.h>
+#include <dali/public-api/actors/actor.h>
+#include <dali/public-api/actors/layer.h>
 #include <dali/public-api/actors/camera-actor.h>
 #include <dali/public-api/render-tasks/render-task.h>
 #include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/public-api/rendering/frame-buffer.h>
 #include <dali/devel-api/adaptor-framework/orientation.h>
 
 // INTERNAL HEADERS
@@ -42,6 +45,8 @@ namespace Internal
 namespace Adaptor
 {
 
+uint32_t Window::mWindowCounter = 0;
+
 namespace
 {
 
@@ -60,13 +65,13 @@ Window* Window::New( const PositionSize& positionSize, const std::string& name,
 }
 
 Window::Window()
-: mSurface( NULL ),
+: mId( mWindowCounter++ ),
+  mSurface( nullptr ),
   mWindowBase(),
   mIndicatorVisible( Dali::Window::INVISIBLE ),   // TODO: Enable this after indicator implementation based on tizen 5.
   mIndicatorIsShown( false ),
   mShowRotatedIndicatorOnClose( false ),
   mStarted( false ),
-  mIsTransparent( false ),
   mIsFocusAcceptable( true ),
   mVisible( true ),
   mIconified( false ),
@@ -97,10 +102,11 @@ Window::~Window()
   {
     mAdaptor->RemoveObserver( *this );
     mAdaptor->SetDragAndDropDetector( NULL );
+    mAdaptor->RemoveWindow( this );
     mAdaptor = NULL;
   }
 
-  delete mSurface;
+  mSurface.reset( nullptr );
 }
 
 void Window::Initialize(const PositionSize& positionSize, const std::string& name, const std::string& className)
@@ -108,8 +114,7 @@ void Window::Initialize(const PositionSize& positionSize, const std::string& nam
   // Create a window render surface
   Any surface;
   auto renderSurfaceFactory = Dali::Internal::Adaptor::GetRenderSurfaceFactory();
-  auto windowRenderSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
-  mSurface = windowRenderSurface.release();
+  mSurface = renderSurfaceFactory->CreateWindowRenderSurface( positionSize, surface, mIsTransparent );
 
   // Get a window base
   mWindowBase = mSurface->GetWindowBase();
@@ -140,6 +145,16 @@ void Window::SetAdaptor(Dali::Adaptor& adaptor)
   DALI_ASSERT_ALWAYS( !mStarted && "Adaptor already started" );
   mStarted = true;
 
+  PositionSize positionSize = mSurface->GetPositionSize();
+  mScene = Dali::Integration::Scene::New( Vector2(positionSize.width, positionSize.height) );
+  mScene.SetSurface( *mSurface.get() );
+
+  unsigned int dpiHorizontal, dpiVertical;
+  dpiHorizontal = dpiVertical = 0;
+
+  mSurface->GetDpi( dpiHorizontal, dpiVertical );
+  mScene.SetDpi( Vector2( static_cast<float>( dpiHorizontal ), static_cast<float>( dpiVertical ) ) );
+
   // Create one overlay for the main window only
   Internal::Adaptor::Adaptor& adaptorImpl = Internal::Adaptor::Adaptor::GetImplementation(adaptor);
   mAdaptor = &adaptorImpl;
@@ -158,11 +173,13 @@ void Window::SetAdaptor(Dali::Adaptor& adaptor)
   {
     mIndicator->SetAdaptor(mAdaptor);
   }
+
+  mSurface->SetAdaptor( *mAdaptor );
 }
 
 WindowRenderSurface* Window::GetSurface()
 {
-  return mSurface;
+  return mSurface.get();
 }
 
 void Window::ShowIndicator( Dali::Window::IndicatorVisibleMode visibleMode )
@@ -218,6 +235,44 @@ void Window::Activate()
   mWindowBase->Activate();
 }
 
+void Window::Add( Dali::Actor actor )
+{
+  mScene.Add( actor );
+}
+
+void Window::Remove( Dali::Actor actor )
+{
+  mScene.Remove( actor );
+}
+
+Dali::Layer Window::GetRootLayer() const
+{
+  return mScene.GetRootLayer();
+}
+
+uint32_t Window::GetLayerCount() const
+{
+  return mScene.GetLayerCount();
+}
+
+Dali::Layer Window::GetLayer( uint32_t depth ) const
+{
+  return mScene.GetLayer( depth );
+}
+
+void Window::SetBackgroundColor( Vector4 color )
+{
+  if ( mSurface )
+  {
+    mSurface->SetBackgroundColor( color );
+  }
+}
+
+Vector4 Window::GetBackgroundColor() const
+{
+  return mSurface ? mSurface->GetBackgroundColor() : Vector4();
+}
+
 void Window::AddAvailableOrientation( Dali::Window::WindowOrientation orientation )
 {
   bool found = false;
@@ -478,11 +533,11 @@ void Window::SetSize( Dali::Window::WindowSize size )
   {
     Uint16Pair newSize( newRect.width, newRect.height );
 
-    mAdaptor->SurfaceResizePrepare( newSize );
+    mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
 
     mResizedSignal.Emit( newSize );
 
-    mAdaptor->SurfaceResizeComplete( newSize );
+    mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
   }
 }
 
@@ -532,11 +587,11 @@ void Window::SetPositionSize( PositionSize positionSize )
   {
     Uint16Pair newSize( newRect.width, newRect.height );
 
-    mAdaptor->SurfaceResizePrepare( newSize );
+    mAdaptor->SurfaceResizePrepare( mSurface.get(), newSize );
 
     mResizedSignal.Emit( newSize );
 
-    mAdaptor->SurfaceResizeComplete( newSize );
+    mAdaptor->SurfaceResizeComplete( mSurface.get(), newSize );
   }
 }
 
@@ -569,12 +624,12 @@ void Window::RotationDone( int orientation, int width, int height )
 {
   mSurface->RequestRotation( orientation, width, height );
 
-  mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( width, height ) );
+  mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
 
   // Emit signal
   mResizedSignal.Emit( Dali::Window::WindowSize( width, height ) );
 
-  mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( width, height ) );
+  mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( width, height ) );
 }
 
 void Window::DoShowIndicator( Dali::Window::WindowOrientation lastOrientation )
@@ -710,8 +765,8 @@ void Window::OnFocusChanged( bool focusIn )
 void Window::OnOutputTransformed()
 {
   PositionSize positionSize = mSurface->GetPositionSize();
-  mAdaptor->SurfaceResizePrepare( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
-  mAdaptor->SurfaceResizeComplete( Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+  mAdaptor->SurfaceResizePrepare( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
+  mAdaptor->SurfaceResizeComplete( mSurface.get(), Adaptor::SurfaceSize( positionSize.width, positionSize.height ) );
 }
 
 void Window::OnDeleteRequest()
@@ -789,6 +844,11 @@ void Window::OnDestroy()
   mAdaptor = NULL;
 }
 
+uint32_t Window::GetId() const
+{
+  return mId;
+}
+
 } // Adaptor
 
 } // Internal
index 77979c0..1f10653 100644 (file)
@@ -2,7 +2,7 @@
 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_WINDOW_IMPL_H
 
 /*
- * 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.
@@ -21,6 +21,9 @@
 // EXTERNAL INCLUDES
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/base-object.h>
+#include <dali/public-api/actors/layer.h>
+#include <dali/public-api/render-tasks/render-task-list.h>
+#include <dali/integration-api/scene.h>
 
 // INTERNAL INCLUDES
 #include <dali/internal/adaptor/common/lifecycle-observer.h>
@@ -33,6 +36,7 @@
 namespace Dali
 {
 class Adaptor;
+class Actor;
 
 namespace Internal
 {
@@ -120,6 +124,41 @@ public:
   void Activate();
 
   /**
+   * @copydoc Dali::Window::Add()
+   */
+  void Add( Dali::Actor actor );
+
+  /**
+   * @copydoc Dali::Window::Remove()
+   */
+  void Remove( Dali::Actor remove );
+
+  /**
+   * @copydoc Dali::Window::SetBackgroundColor()
+   */
+  void SetBackgroundColor(Vector4 color);
+
+  /**
+   * @copydoc Dali::Window::GetBackgroundColor()
+   */
+  Vector4 GetBackgroundColor() const;
+
+  /**
+   * @copydoc Dali::Window::GetRootLayer()
+   */
+  Dali::Layer GetRootLayer() const;
+
+  /**
+   * @copydoc Dali::Window::GetLayerCount()
+   */
+  uint32_t GetLayerCount() const;
+
+  /**
+   * @copydoc Dali::Window::GetLayer()
+   */
+  Dali::Layer GetLayer( uint32_t depth ) const;
+
+  /**
    * @copydoc Dali::Window::AddAvailableOrientation()
    */
   void AddAvailableOrientation(Dali::Window::WindowOrientation orientation);
@@ -329,6 +368,12 @@ public:
    */
   void RotationDone( int orientation, int width, int height );
 
+  /**
+   * @brief Retrieves the unique ID of the window.
+   * @return The ID
+   */
+  uint32_t GetId() const;
+
 private:
 
   /**
@@ -462,7 +507,10 @@ public: // Signals
 
 private:
 
-  WindowRenderSurface*                  mSurface;
+  static uint32_t                       mWindowCounter;    ///< A counter to track the window creation
+  uint32_t                              mId;               ///< A unique ID to identify the window starting from 0
+  std::unique_ptr< WindowRenderSurface > mSurface;
+  Dali::Integration::Scene              mScene;
   WindowBase*                           mWindowBase;
   Dali::Window::IndicatorVisibleMode    mIndicatorVisible; ///< public state
   bool                                  mIndicatorIsShown:1; ///< private state
@@ -486,6 +534,8 @@ private:
   std::vector<Dali::Window::WindowOrientation> mAvailableOrientations;
   Dali::Window::WindowOrientation              mPreferredOrientation;
 
+  Vector4                               mBackgroundColor;
+
   // Signals
   IndicatorSignalType mIndicatorVisibilityChangedSignal;
   FocusSignalType     mFocusChangedSignal;
index cac09c5..2ff7944 100644 (file)
@@ -27,6 +27,7 @@
 #include <dali/integration-api/thread-synchronization-interface.h>
 #include <dali/internal/graphics/gles/egl-implementation.h>
 #include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
 #include <dali/internal/window-system/common/window-base.h>
 #include <dali/internal/window-system/common/window-factory.h>
 #include <dali/internal/window-system/common/window-system.h>
@@ -58,6 +59,8 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, Any s
   mRenderNotification( NULL ),
   mRotationTrigger( NULL ),
   mGraphics( nullptr ),
+  mEGLSurface( nullptr ),
+  mEGLContext( nullptr ),
   mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
   mOutputTransformedSignal(),
   mRotationAngle( 0 ),
@@ -177,28 +180,24 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi
   mWindowBase->GetDpi( dpiHorizontal, dpiVertical );
 }
 
-void WindowRenderSurface::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
+void WindowRenderSurface::InitializeGraphics()
 {
-  mGraphics = &graphics;
 
-  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
-
-  EglInterface* mEGL = eglGraphics->Create();
-
-  // Initialize EGL & OpenGL
-  displayConnection.Initialize();
+  mGraphics = &mAdaptor->GetGraphicsInterface();
 
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
-  eglImpl.ChooseConfig(true, mColorDepth);
-
-  // Create the OpenGL context
-  mEGL->CreateContext();
+  auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
+  mEGL = &eglGraphics->GetEglInterface();
 
-  // Create the OpenGL surface
-  CreateSurface();
+  if ( mEGLContext == NULL )
+  {
+    // Create the OpenGL context for this window
+    Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+    eglImpl.ChooseConfig(true, mColorDepth);
+    eglImpl.CreateWindowContext( mEGLContext );
 
-  // Make it current
-  mEGL->MakeContextCurrent();
+    // Create the OpenGL surface
+    CreateSurface();
+  }
 }
 
 void WindowRenderSurface::CreateSurface()
@@ -223,7 +222,7 @@ void WindowRenderSurface::CreateSurface()
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
 
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-  eglImpl.CreateSurfaceWindow( window, mColorDepth );
+  mEGLSurface = eglImpl.CreateSurfaceWindow( window, mColorDepth );
 
   // Check rotation capability
   mRotationSupported = mWindowBase->IsEglWindowRotationSupported();
@@ -238,7 +237,7 @@ void WindowRenderSurface::DestroySurface()
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
 
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-  eglImpl.DestroySurface();
+  eglImpl.DestroySurface( mEGLSurface );
 
   mWindowBase->DestroyEglWindow();
 }
@@ -271,7 +270,7 @@ bool WindowRenderSurface::ReplaceGraphicsSurface()
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
 
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-  return eglImpl.ReplaceSurfaceWindow( window );
+  return eglImpl.ReplaceSurfaceWindow( window, mEGLSurface, mEGLContext );
 }
 
 void WindowRenderSurface::MoveResize( Dali::PositionSize positionSize )
@@ -326,6 +325,8 @@ void WindowRenderSurface::StartRender()
 
 bool WindowRenderSurface::PreRender( bool resizingSurface )
 {
+  MakeContextCurrent();
+
   if( resizingSurface )
   {
 #ifdef OVER_TIZEN_VERSION_4
@@ -404,7 +405,7 @@ void WindowRenderSurface::PostRender( bool renderToFbo, bool replacingSurface, b
     }
 
     Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
-    eglImpl.SwapBuffers();
+    eglImpl.SwapBuffers( mEGLSurface );
 
     if( mRenderNotification )
     {
@@ -429,11 +430,29 @@ void WindowRenderSurface::ReleaseLock()
   // Nothing to do.
 }
 
-RenderSurface::Type WindowRenderSurface::GetSurfaceType()
+Integration::RenderSurface::Type WindowRenderSurface::GetSurfaceType()
 {
   return RenderSurface::WINDOW_RENDER_SURFACE;
 }
 
+void WindowRenderSurface::MakeContextCurrent()
+{
+  if ( mEGL != nullptr )
+  {
+    mEGL->MakeContextCurrent( mEGLSurface, mEGLContext );
+  }
+}
+
+Integration::DepthBufferAvailable WindowRenderSurface::GetDepthBufferRequired()
+{
+  return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE;
+}
+
+Integration::StencilBufferAvailable WindowRenderSurface::GetStencilBufferRequired()
+{
+  return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
+}
+
 void WindowRenderSurface::OutputTransformed()
 {
   int screenRotationAngle = mWindowBase->GetScreenRotationAngle();
index a1ba715..55bc955 100644 (file)
  */
 
 // INTERNAL INCLUDES
-#include <dali/integration-api/render-surface.h>
-#include <dali/integration-api/egl-interface.h>
 #include <dali/internal/graphics/common/graphics-interface.h>
 
+#ifdef DALI_ADAPTOR_COMPILATION
+#include <dali/integration-api/egl-interface.h>
+#include <dali/integration-api/render-surface-interface.h>
+#else
+#include <dali/integration-api/adaptors/egl-interface.h>
+#include <dali/integration-api/adaptors/render-surface-interface.h>
+#endif
+
 // EXTERNAL INCLUDES
 #include <dali/public-api/signals/connection-tracker.h>
 #include <dali/public-api/signals/dali-signal.h>
 
-
 namespace Dali
 {
 
@@ -39,11 +44,12 @@ namespace Adaptor
 {
 
 class WindowBase;
+class AdaptorInternalServices;
 
 /**
  * Window interface of render surface.
  */
-class WindowRenderSurface : public Dali::RenderSurface, public ConnectionTracker
+class WindowRenderSurface : public Dali::RenderSurfaceInterface, public ConnectionTracker
 {
 public:
 
@@ -112,10 +118,10 @@ public: // API
    */
   OutputSignalType& OutputTransformedSignal();
 
-public: // from Dali::RenderSurface
+public: // from Dali::Integration::RenderSurface
 
   /**
-   * @copydoc Dali::RenderSurface::GetPositionSize()
+   * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
    */
   virtual PositionSize GetPositionSize() const override;
 
@@ -124,64 +130,79 @@ public: // from Dali::RenderSurface
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::InitializeGraphics()
+   * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
    */
-  virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
+  virtual void InitializeGraphics() override;
 
   /**
-   * @copydoc Dali::RenderSurface::CreateSurface()
+   * @copydoc Dali::Integration::RenderSurface::CreateSurface()
    */
   virtual void CreateSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::DestroySurface()
+   * @copydoc Dali::Integration::RenderSurface::DestroySurface()
    */
   virtual void DestroySurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
+   * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
    */
   virtual bool ReplaceGraphicsSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::MoveResize()
+   * @copydoc Dali::Integration::RenderSurface::MoveResize()
    */
   virtual void MoveResize( Dali::PositionSize positionSize) override;
 
   /**
-   * @copydoc Dali::RenderSurface::StartRender()
+   * @copydoc Dali::Integration::RenderSurface::StartRender()
    */
   virtual void StartRender() override;
 
   /**
-   * @copydoc Dali::RenderSurface::PreRender()
+   * @copydoc Dali::Integration::RenderSurface::PreRender()
    */
   virtual bool PreRender( bool resizingSurface ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::PostRender()
+   * @copydoc Dali::Integration::RenderSurface::PostRender()
    */
   virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
 
   /**
-   * @copydoc Dali::RenderSurface::StopRender()
+   * @copydoc Dali::Integration::RenderSurface::StopRender()
    */
   virtual void StopRender() override;
 
   /**
-   * @copydoc Dali::RenderSurface::SetThreadSynchronization
+   * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::ReleaseLock()
+   * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
    */
   virtual void ReleaseLock() override;
 
   /**
-   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
+   */
+  virtual Integration::RenderSurface::Type GetSurfaceType() override;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent()
+   */
+  virtual void MakeContextCurrent() override;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired()
+   */
+  virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired()
    */
-  virtual RenderSurface::Type GetSurfaceType() override;
+  virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override;
 
 private:
 
@@ -210,12 +231,16 @@ protected:
 
 private: // Data
 
+  EglInterface*                   mEGL;
+  Dali::DisplayConnection*        mDisplayConnection;
   PositionSize                    mPositionSize;       ///< Position
   std::unique_ptr< WindowBase >   mWindowBase;
   ThreadSynchronizationInterface* mThreadSynchronization;
   TriggerEventInterface*          mRenderNotification; ///< Render notification trigger
   TriggerEventInterface*          mRotationTrigger;
   GraphicsInterface*              mGraphics;           ///< Graphics interface
+  EGLSurface                      mEGLSurface;
+  EGLContext                      mEGLContext;
   ColorDepth                      mColorDepth;         ///< Color depth of surface (32 bit or 24 bit)
   OutputSignalType                mOutputTransformedSignal;
   int                             mRotationAngle;
index 195eda2..f639ed5 100755 (executable)
@@ -46,14 +46,14 @@ DisplayConnection* DisplayConnectionEcoreWl::New()
 
 DisplayConnectionEcoreWl::DisplayConnectionEcoreWl()
 : mDisplay( NULL ),
-  mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE ),
+  mSurfaceType( Integration::RenderSurface::WINDOW_RENDER_SURFACE ),
   mGraphics( nullptr )
 {
 }
 
 DisplayConnectionEcoreWl::~DisplayConnectionEcoreWl()
 {
-  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+  if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE )
   {
     ReleaseNativeDisplay();
   }
@@ -82,11 +82,11 @@ bool DisplayConnectionEcoreWl::InitializeGraphics()
   return true;
 }
 
-void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type )
+void DisplayConnectionEcoreWl::SetSurfaceType( Integration::RenderSurface::Type type )
 {
   mSurfaceType = type;
 
-  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
+  if( mSurfaceType == Integration::RenderSurface::NATIVE_RENDER_SURFACE )
   {
     mDisplay = GetNativeDisplay();
   }
index cc31ef0..6bcf33d 100644 (file)
@@ -72,7 +72,7 @@ public:
    * @brief Sets the surface type
    * @param[in] type The surface type
    */
-  void SetSurfaceType( RenderSurface::Type type );
+  void SetSurfaceType( Integration::RenderSurface::Type type );
 
   /**
    * @brief Sets the graphics interface
@@ -107,7 +107,7 @@ protected:
 
 private:
   EGLNativeDisplayType mDisplay;        ///< Wayland-display for rendering
-  RenderSurface::Type mSurfaceType;     ///< The surface type
+  Integration::RenderSurface::Type mSurfaceType;     ///< The surface type
   GraphicsInterface* mGraphics;         ///< The graphics interface
 };
 
index b77457e..3417ccb 100644 (file)
@@ -444,8 +444,7 @@ IndicatorEcoreWl::IndicatorEcoreWl( Adaptor* adaptor, Dali::Window::WindowOrient
   mIsShowing( true ),
   mIsAnimationPlaying( false ),
   mCurrentSharedFile( 0 ),
-  mBackgroundVisible( false ),
-  mTopMargin( 0 )
+  mBackgroundVisible( false )
 {
   mIndicatorContentActor = Dali::Actor::New();
   mIndicatorContentActor.SetParentOrigin( ParentOrigin::TOP_CENTER );
@@ -592,7 +591,6 @@ void IndicatorEcoreWl::SetOpacityMode( Dali::Window::IndicatorBgOpacity mode )
     mIndicatorContentActor.RemoveRenderer( mBackgroundRenderer );
     mBackgroundVisible = false;
   }
-  UpdateTopMargin();
 }
 
 void IndicatorEcoreWl::SetVisible( Dali::Window::IndicatorVisibleMode visibleMode, bool forceUpdate )
@@ -623,7 +621,6 @@ void IndicatorEcoreWl::SetVisible( Dali::Window::IndicatorVisibleMode visibleMod
     }
 
     mVisible = visibleMode;
-    UpdateTopMargin();
 
     if( mForegroundRenderer && mForegroundRenderer.GetTextures().GetTexture( 0u ) )
     {
@@ -820,7 +817,6 @@ void IndicatorEcoreWl::Resize( int width, int height )
     mIndicatorContentActor.SetSize( mImageWidth, mImageHeight );
     mIndicatorActor.SetSize( mImageWidth, mImageHeight );
     mEventActor.SetSize(mImageWidth, mImageHeight);
-    UpdateTopMargin();
   }
 }
 
@@ -934,16 +930,6 @@ void IndicatorEcoreWl::LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent )
   }
 }
 
-void IndicatorEcoreWl::UpdateTopMargin()
-{
-  int newMargin = (mVisible == Dali::Window::VISIBLE && mOpacityMode == Dali::Window::OPAQUE) ? mImageHeight : 0;
-  if (mTopMargin != newMargin)
-  {
-    mTopMargin = newMargin;
-    mAdaptor->IndicatorSizeChanged( mTopMargin );
-  }
-}
-
 void IndicatorEcoreWl::UpdateVisibility()
 {
   if( CheckVisibleState() )
index 1f33fc1..a6cd9a1 100644 (file)
@@ -275,11 +275,6 @@ private:
   void LoadSharedImage( Ecore_Ipc_Event_Server_Data *epcEvent );
 
   /**
-   * Update top margin of the stage as much as indicator height
-   */
-  void UpdateTopMargin();
-
-  /**
    * Update the visibility and position of the actors
    */
   void UpdateVisibility();
@@ -422,7 +417,6 @@ private:
   SharedFileInfo                   mSharedFileInfo[SHARED_FILE_NUMBER];    ///< Table to store shared file info
 
   bool                             mBackgroundVisible;   ///< Indicate whether background is visible
-  int                              mTopMargin;   ///< Top margin of the stage for indicator
 };
 
 } // Adaptor
index e019b0a..38a44b4 100644 (file)
@@ -38,6 +38,8 @@
 #include <dali/internal/window-system/common/display-connection.h>
 #include <dali/internal/window-system/common/window-system.h>
 #include <dali/integration-api/thread-synchronization-interface.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
 
 namespace Dali
 {
@@ -55,6 +57,9 @@ NativeRenderSurfaceEcoreWl::NativeRenderSurfaceEcoreWl( Dali::PositionSize posit
 : mPosition( positionSize ),
   mRenderNotification( NULL ),
   mGraphics( NULL ),
+  mEGL( nullptr ),
+  mEGLSurface( nullptr ),
+  mEGLContext( nullptr ),
   mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
   mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ),
   mOwnSurface( false ),
@@ -132,31 +137,25 @@ void NativeRenderSurfaceEcoreWl::GetDpi( unsigned int& dpiHorizontal, unsigned i
   dpiVertical   = int( yres + 0.5f );
 }
 
-void NativeRenderSurfaceEcoreWl::InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection )
+void NativeRenderSurfaceEcoreWl::InitializeGraphics()
 {
   DALI_LOG_TRACE_METHOD( gNativeSurfaceLogFilter );
   unsetenv( "EGL_PLATFORM" );
 
-  mGraphics = &graphics;
-
+  mGraphics = &mAdaptor->GetGraphicsInterface();
   auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
 
-  EglInterface* mEGL = eglGraphics->Create();
-
-  // Initialize EGL & OpenGL
-  displayConnection.Initialize();
-
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
-  eglImpl.ChooseConfig(true, mColorDepth);
+  mEGL = &eglGraphics->GetEglInterface();
 
-  // Create the OpenGL context
-  mEGL->CreateContext();
-
-  // Create the OpenGL surface
-  CreateSurface();
+  if ( mEGLContext == NULL )
+  {
+    // Create the OpenGL context for this window
+    Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>(*mEGL);
+    eglImpl.CreateWindowContext( mEGLContext );
 
-  // Make it current
-  mEGL->MakeContextCurrent();
+    // Create the OpenGL surface
+    CreateSurface();
+  }
 }
 
 void NativeRenderSurfaceEcoreWl::CreateSurface()
@@ -166,7 +165,7 @@ void NativeRenderSurfaceEcoreWl::CreateSurface()
   auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
-  eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth );
+  mEGLSurface = eglImpl.CreateSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mColorDepth );
 }
 
 void NativeRenderSurfaceEcoreWl::DestroySurface()
@@ -176,7 +175,7 @@ void NativeRenderSurfaceEcoreWl::DestroySurface()
   auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
-  eglImpl.DestroySurface();
+  eglImpl.DestroySurface( mEGLSurface );
 }
 
 bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface()
@@ -191,7 +190,7 @@ bool NativeRenderSurfaceEcoreWl::ReplaceGraphicsSurface()
   auto eglGraphics = static_cast<Internal::Adaptor::EglGraphics *>(mGraphics);
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
-  return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ) );
+  return eglImpl.ReplaceSurfaceWindow( reinterpret_cast< EGLNativeWindowType >( mTbmQueue ), mEGLSurface, mEGLContext );
 }
 
 void NativeRenderSurfaceEcoreWl::MoveResize( Dali::PositionSize positionSize )
@@ -215,7 +214,7 @@ void NativeRenderSurfaceEcoreWl::PostRender( bool renderToFbo, bool replacingSur
   {
     Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
 
-    eglImpl.SwapBuffers();
+    eglImpl.SwapBuffers( mEGLSurface );
   }
 
   if( mThreadSynchronization )
@@ -269,9 +268,27 @@ void NativeRenderSurfaceEcoreWl::SetThreadSynchronization( ThreadSynchronization
   mThreadSynchronization = &threadSynchronization;
 }
 
-RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType()
+Integration::RenderSurface::Type NativeRenderSurfaceEcoreWl::GetSurfaceType()
+{
+  return Integration::RenderSurface::NATIVE_RENDER_SURFACE;
+}
+
+void NativeRenderSurfaceEcoreWl::MakeContextCurrent()
+{
+  if ( mEGL != nullptr )
+  {
+    mEGL->MakeContextCurrent( mEGLSurface, mEGLContext );
+  }
+}
+
+Integration::DepthBufferAvailable NativeRenderSurfaceEcoreWl::GetDepthBufferRequired()
+{
+  return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE;
+}
+
+Integration::StencilBufferAvailable NativeRenderSurfaceEcoreWl::GetStencilBufferRequired()
 {
-  return RenderSurface::NATIVE_RENDER_SURFACE;
+  return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
 }
 
 void NativeRenderSurfaceEcoreWl::ReleaseLock()
index 1199b3e..8cd5a55 100644 (file)
@@ -32,6 +32,7 @@ namespace Dali
 {
 
 class DisplayConnection;
+class EglInterface;
 
 /**
  * Ecore Wayland Native implementation of render surface.
@@ -69,77 +70,92 @@ public: // from WindowRenderSurface
    */
   virtual void WaitUntilSurfaceReplaced() override;
 
-public: // from Dali::RenderSurface
+public: // from Dali::Integration::RenderSurface
 
   /**
-   * @copydoc Dali::RenderSurface::GetPositionSize()
+   * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
    */
   virtual PositionSize GetPositionSize() const override;
 
   /**
-   * @copydoc Dali::RenderSurface::GetDpi()
+   * @copydoc Dali::Integration::RenderSurface::GetDpi()
    */
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::InitializeGraphics()
+   * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
    */
-  virtual void InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) override;
+  virtual void InitializeGraphics() override;
 
   /**
-   * @copydoc Dali::RenderSurface::CreateSurface()
+   * @copydoc Dali::Integration::RenderSurface::CreateSurface()
    */
   virtual void CreateSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::DestroySurface()
+   * @copydoc Dali::Integration::RenderSurface::DestroySurface()
    */
   virtual void DestroySurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
+   * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
    */
   virtual bool ReplaceGraphicsSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::MoveResize()
+   * @copydoc Dali::Integration::RenderSurface::MoveResize()
    */
   virtual void MoveResize( Dali::PositionSize positionSize) override;
 
   /**
-   * @copydoc Dali::RenderSurface::StartRender()
+   * @copydoc Dali::Integration::RenderSurface::StartRender()
    */
   virtual void StartRender() override;
 
   /**
-   * @copydoc Dali::RenderSurface::PreRender()
+   * @copydoc Dali::Integration::RenderSurface::PreRender()
    */
   virtual bool PreRender( bool resizingSurface ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::PostRender()
+   * @copydoc Dali::Integration::RenderSurface::PostRender()
    */
   virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
 
   /**
-   * @copydoc Dali::RenderSurface::StopRender()
+   * @copydoc Dali::Integration::RenderSurface::StopRender()
    */
   virtual void StopRender() override;
 
   /**
-   * @copydoc Dali::RenderSurface::SetThreadSynchronization
+   * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override;
 
   /**
-   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
    */
-  virtual RenderSurface::Type GetSurfaceType() override;
+  virtual Integration::RenderSurface::Type GetSurfaceType() override;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent()
+   */
+  virtual void MakeContextCurrent() override;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired()
+   */
+  virtual Integration::DepthBufferAvailable GetDepthBufferRequired() override;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired()
+   */
+  virtual Integration::StencilBufferAvailable GetStencilBufferRequired() override;
 
 private:
 
   /**
-   * @copydoc Dali::RenderSurface::ReleaseLock()
+   * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
    */
   virtual void ReleaseLock() override;
 
@@ -158,6 +174,9 @@ private: // Data
   PositionSize                           mPosition;
   TriggerEventInterface*                 mRenderNotification;
   Internal::Adaptor::GraphicsInterface*  mGraphics;                  ///< The graphics interface
+  EglInterface*                          mEGL;
+  EGLSurface                             mEGLSurface;
+  EGLContext                             mEGLContext;
   ColorDepth                             mColorDepth;
   tbm_format                             mTbmFormat;
   bool                                   mOwnSurface;
index e605892..ba1af14 100644 (file)
@@ -97,9 +97,9 @@ bool DisplayConnectionX11::InitializeGraphics()
   return true;
 }
 
-void DisplayConnectionX11::SetSurfaceType( RenderSurface::Type type )
+void DisplayConnectionX11::SetSurfaceType( Integration::RenderSurface::Type type )
 {
-  if( type == RenderSurface::WINDOW_RENDER_SURFACE )
+  if( type == Integration::RenderSurface::WINDOW_RENDER_SURFACE )
   {
     // Because of DDK issue, we need to use separated x display instead of ecore default display
     mDisplay = XOpenDisplay(0);
index ef2ac82..4f6890f 100644 (file)
@@ -81,7 +81,7 @@ public:
   /**
    * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetSurfaceType
    */
-  void SetSurfaceType( RenderSurface::Type type );
+  void SetSurfaceType( Integration::RenderSurface::Type type );
 
   /**
    * @copydoc Dali::Internal::Adaptor::DisplayConnection::SetGraphicsInterface
index 03259eb..c8e049c 100644 (file)
@@ -35,6 +35,8 @@
 #include <dali/internal/system/common/trigger-event.h>
 #include <dali/internal/window-system/common/display-connection.h>
 #include <dali/internal/graphics/gles/egl-graphics.h>
+#include <dali/internal/adaptor/common/adaptor-impl.h>
+#include <dali/internal/adaptor/common/adaptor-internal-services.h>
 
 
 namespace Dali
@@ -146,10 +148,11 @@ void PixmapRenderSurfaceEcoreX::GetDpi( unsigned int& dpiHorizontal, unsigned in
   dpiVertical   = int( yres + 0.5f );
 }
 
-void PixmapRenderSurfaceEcoreX::InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection )
+void PixmapRenderSurfaceEcoreX::InitializeGraphics()
 {
-  mGraphics = &graphics;
-  mDisplayConnection = &displayConnection;
+  mGraphics = &mAdaptor->GetGraphicsInterface();
+  mDisplayConnection = &mAdaptor->GetDisplayConnectionInterface();
+
 
   auto eglGraphics = static_cast<EglGraphics *>(mGraphics);
   Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
@@ -185,7 +188,7 @@ void PixmapRenderSurfaceEcoreX::DestroySurface()
     // need to cast to X handle as in 64bit system ECore handle is 32 bit whereas EGLnative and XWindow are 64 bit
     XPixmap pixmap = static_cast<XPixmap>( mX11Pixmaps[i] );
     eglImpl.MakeCurrent( EGLNativePixmapType( pixmap ), mEglSurfaces[i] );
-    eglImpl.DestroySurface();
+    eglImpl.DestroySurface( mEglSurfaces[i] );
   }
 }
 
@@ -307,9 +310,13 @@ void PixmapRenderSurfaceEcoreX::ReleaseLock()
   }
 }
 
-RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
+Integration::RenderSurface::Type PixmapRenderSurfaceEcoreX::GetSurfaceType()
+{
+  return Integration::RenderSurface::PIXMAP_RENDER_SURFACE;
+}
+
+void PixmapRenderSurfaceEcoreX::MakeContextCurrent()
 {
-  return RenderSurface::PIXMAP_RENDER_SURFACE;
 }
 
 void PixmapRenderSurfaceEcoreX::CreateRenderable()
index 873e7f4..1f4a305 100644 (file)
@@ -70,77 +70,82 @@ public: // from WindowRenderSurface
    */
   virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
 
-public: // from Dali::RenderSurface
+public: // from Dali::Integration::RenderSurface
 
   /**
-   * @copydoc Dali::RenderSurface::GetPositionSize()
+   * @copydoc Dali::Integration::RenderSurface::GetPositionSize()
    */
   virtual PositionSize GetPositionSize() const override;
 
   /**
-   * @copydoc Dali::RenderSurface::GetDpi()
+   * @copydoc Dali::Integration::RenderSurface::GetDpi()
    */
   virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::InitializeGraphics()
+   * @copydoc Dali::Integration::RenderSurface::InitializeGraphics()
    */
-  virtual void InitializeGraphics( GraphicsInterface& graphics, Dali::DisplayConnection& displayConnection ) override;
+  virtual void InitializeGraphics() override;
 
   /**
-   * @copydoc Dali::RenderSurface::CreateSurface()
+   * @copydoc Dali::Integration::RenderSurface::CreateSurface()
    */
   virtual void CreateSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::DestroySurface()
+   * @copydoc Dali::Integration::RenderSurface::DestroySurface()
    */
   virtual void DestroySurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
+   * @copydoc Dali::Integration::RenderSurface::ReplaceGraphicsSurface()
    */
   virtual bool ReplaceGraphicsSurface() override;
 
   /**
-   * @copydoc Dali::RenderSurface::MoveResize()
+   * @copydoc Dali::Integration::RenderSurface::MoveResize()
    */
   virtual void MoveResize( Dali::PositionSize positionSize) override {}
 
   /**
-   * @copydoc Dali::RenderSurface::StartRender()
+   * @copydoc Dali::Integration::RenderSurface::StartRender()
    */
   virtual void StartRender() override;
 
   /**
-   * @copydoc Dali::RenderSurface::PreRender()
+   * @copydoc Dali::Integration::RenderSurface::PreRender()
    */
   virtual bool PreRender( bool resizingSurface ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::PostRender()
+   * @copydoc Dali::Integration::RenderSurface::PostRender()
    */
   virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::StopRender()
+   * @copydoc Dali::Integration::RenderSurface::StopRender()
    */
   virtual void StopRender() override;
 
   /**
-   * @copydoc Dali::RenderSurface::SetThreadSynchronization
+   * @copydoc Dali::Integration::RenderSurface::SetThreadSynchronization
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) override;
 
   /**
-   * @copydoc Dali::RenderSurface::GetSurfaceType()
+   * @copydoc Dali::Integration::RenderSurface::GetSurfaceType()
    */
-  virtual RenderSurface::Type GetSurfaceType() override;
+  virtual Integration::RenderSurface::Type GetSurfaceType() override;
+
+  /**
+   * @copydoc Dali::Integration::RenderSurface::MakeContextCurrent()
+   */
+  virtual void MakeContextCurrent() override;
 
 private: // from PixmapRenderSurface
 
   /**
-   * @copydoc Dali::RenderSurface::ReleaseLock()
+   * @copydoc Dali::Integration::RenderSurface::ReleaseLock()
    */
   virtual void ReleaseLock() override;
 
index f2a8068..9eeb2d9 100644 (file)
@@ -19,6 +19,7 @@
 #include <dali/public-api/adaptor-framework/window.h>
 
 // INTERNAL INCLUDES
+#include <dali/public-api/actors/actor.h>
 #include <dali/internal/window-system/common/window-impl.h>
 #include <dali/internal/window-system/common/orientation-impl.h>
 
index adda302..6ec35a5 100755 (executable)
@@ -23,6 +23,7 @@
 #include <dali/public-api/math/rect.h>
 #include <dali/public-api/math/uint-16-pair.h>
 #include <dali/public-api/math/vector2.h>
+#include <dali/public-api/math/vector4.h>
 #include <dali/public-api/object/base-handle.h>
 #include <dali/public-api/object/any.h>
 #include <dali/public-api/signals/dali-signal.h>
@@ -49,6 +50,8 @@ class Window;
 
 class DragAndDropDetector;
 class Orientation;
+class Actor;
+class Layer;
 
 /**
  * @brief The window class is used internally for drawing.