Revert "[3.0] Add native render surface for wayland" 78/97678/1
authordongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 00:32:09 +0000 (09:32 +0900)
committerdongsug.song <dongsug.song@samsung.com>
Tue, 15 Nov 2016 00:32:13 +0000 (09:32 +0900)
This reverts commit d362ed8511f2cb5311d0919e2c22bfa5293c25ff.

Change-Id: I4470800911cd1956cb1031639684ccb8b6f48cca

29 files changed:
adaptors/base/display-connection.cpp
adaptors/base/display-connection.h
adaptors/base/render-helper.cpp
adaptors/devel-api/adaptor-framework/render-surface.h
adaptors/ecore/wayland/display-connection-impl-ecore-wl.cpp
adaptors/ecore/wayland/display-connection-impl.h
adaptors/ecore/wayland/render-surface-ecore-wl.cpp
adaptors/integration-api/file.list
adaptors/integration-api/native-render-surface-factory.h [deleted file]
adaptors/integration-api/trigger-event-factory-interface.h
adaptors/integration-api/trigger-event-factory.h
adaptors/integration-api/wayland/ecore-wl-render-surface.h
adaptors/integration-api/wayland/native-render-surface.h [deleted file]
adaptors/integration-api/x11/ecore-x-render-surface.h
adaptors/integration-api/x11/pixmap-render-surface.h
adaptors/mobile/file.list
adaptors/mobile/native-render-surface-factory.cpp [deleted file]
adaptors/tizen/display-connection-impl-tizen.cpp [deleted file]
adaptors/tizen/file.list
adaptors/tizen/native-render-surface-tizen.cpp [deleted file]
adaptors/wayland/display-connection-impl-wl.cpp
adaptors/wayland/display-connection-impl.h
adaptors/wayland/render-surface/render-surface-wl.cpp
adaptors/wayland/render-surface/render-surface-wl.h
adaptors/x11/display-connection-impl-x.cpp
adaptors/x11/display-connection-impl.h
adaptors/x11/ecore-x-render-surface.cpp
adaptors/x11/pixmap-render-surface-x.cpp
build/tizen/adaptor/Makefile.am

index d34a14f..1dc44e9 100644 (file)
@@ -34,14 +34,6 @@ DisplayConnection* DisplayConnection::New()
   return new DisplayConnection(internal);
 }
 
-DisplayConnection* DisplayConnection::New( RenderSurface::Type type )
-{
-  Internal::Adaptor::DisplayConnection* internal(Internal::Adaptor::DisplayConnection::New());
-  internal->SetSurfaceType( type );
-
-  return new DisplayConnection(internal);
-}
-
 DisplayConnection::DisplayConnection()
 : mImpl( NULL )
 {
index e59f74c..e38cc78 100644 (file)
@@ -22,7 +22,6 @@
 #include <dali/public-api/object/any.h>
 
 // INTERNAL INCLUDES
-#include <render-surface.h>
 
 
 namespace Dali
@@ -50,15 +49,6 @@ public:
   static DisplayConnection* New();
 
   /**
-   * @brief Create an initialized DisplayConnection.
-   * Native surface will need this instead of DisplayConnection::New()
-   *
-   * @param[in] type Render surface type
-   * @return A handle to a newly allocated DisplayConnection resource.
-   */
-  static DisplayConnection* New( RenderSurface::Type type );
-
-  /**
    * @brief Create a DisplayConnection handle; this can be initialised with DisplayConnection::New().
    *
    * Calling member functions with an uninitialised handle is not allowed.
index b4ee999..d3a771a 100644 (file)
@@ -43,14 +43,7 @@ RenderHelper::RenderHelper( AdaptorInternalServices& adaptorInterfaces )
   // set the initial values before render thread starts
   mSurface = adaptorInterfaces.GetRenderSurfaceInterface();
 
-  if( mSurface )
-  {
-    mDisplayConnection = Dali::DisplayConnection::New( mSurface->GetSurfaceType() );
-  }
-  else
-  {
-    mDisplayConnection = Dali::DisplayConnection::New();
-  }
+  mDisplayConnection = Dali::DisplayConnection::New();
 }
 
 RenderHelper::~RenderHelper()
index 61fd74d..2844105 100644 (file)
@@ -62,13 +62,6 @@ class RenderSurface
 {
 public:
 
-  enum Type
-  {
-    ECORE_RENDER_SURFACE,
-    WAYLAND_RENDER_SURFACE,
-    NATIVE_RENDER_SURFACE
-  };
-
   /**
    * @brief Constructor
    * Inlined as this is a pure abstract interface
@@ -164,8 +157,6 @@ public:
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization ) = 0;
 
-  virtual RenderSurface::Type GetSurfaceType() = 0;
-
 private:
 
   /**
index eb262c5..49d293c 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL HEADERS
-#include <native-render-surface.h>
+#include <pixmap-render-surface.h>
 
 namespace Dali
 {
@@ -42,20 +42,19 @@ DisplayConnection* DisplayConnection::New()
 }
 
 DisplayConnection::DisplayConnection()
+: mDisplay(NULL)
 {
+  mDisplay = ecore_wl_display_get();
 }
 
 DisplayConnection::~DisplayConnection()
 {
-  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
-  {
-    ReleaseNativeDisplay();
-  }
+  //FIXME
 }
 
 Any DisplayConnection::GetDisplay()
 {
-  return Any( mDisplay );
+  return Any(mDisplay);
 }
 
 void DisplayConnection::ConsumeEvents()
@@ -66,7 +65,7 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
 {
   EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
 
-  if( !eglImpl.InitializeGles( mDisplay ) )
+  if (!eglImpl.InitializeGles(reinterpret_cast<EGLNativeDisplayType>(mDisplay)))
   {
     DALI_LOG_ERROR("Failed to initialize GLES.\n");
     return false;
@@ -75,20 +74,6 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
   return true;
 }
 
-void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
-{
-  mSurfaceType = type;
-
-  if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
-  {
-    mDisplay = GetNativeDisplay();
-  }
-  else
-  {
-    mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl_display_get() );
-  }
-}
-
 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
 {
   // calculate DPI
index fc647cc..b9134d1 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef __DALI_INTERNAL_ECORE_WAYLAND_DIPLAY_CONNECTION_H__
-#define __DALI_INTERNAL_ECORE_WAYLAND_DIPLAY_CONNECTION_H__
+#ifndef __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
+#define __DALI_INTERNAL_ECORE_X_DIPLAY_CONNECTION_H__
 
 /*
  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
@@ -81,11 +81,6 @@ public:
    */
   bool InitializeEgl(EglInterface& egl);
 
-  /**
-   * @brief Sets surface type
-   */
-  void SetSurfaceType( RenderSurface::Type type );
-
 public:
 
   /**
@@ -95,16 +90,6 @@ public:
 
 protected:
 
-  /**
-   * @brief Gets display connection for native surface
-   */
-  EGLNativeDisplayType GetNativeDisplay();
-
-  /**
-   * @brief Release display connection for native surface
-   */
-  void ReleaseNativeDisplay();
-
   // Undefined
   DisplayConnection(const DisplayConnection&);
 
@@ -112,8 +97,7 @@ protected:
   DisplayConnection& operator=(const DisplayConnection& rhs);
 
 private:
-  EGLNativeDisplayType mDisplay;        ///< Wayland-display for rendering
-  RenderSurface::Type mSurfaceType;
+  WlDisplay*   mDisplay;        ///< Wayland-display for rendering
 };
 
 } // namespace Adaptor
index 8ef5cc0..dbb495a 100644 (file)
@@ -126,11 +126,6 @@ unsigned int EcoreWlRenderSurface::GetSurfaceId( Any surface ) const
   return surfaceId;
 }
 
-RenderSurface::Type EcoreWlRenderSurface::GetSurfaceType()
-{
-  return RenderSurface::ECORE_RENDER_SURFACE;
-}
-
 } // namespace ECore
 
 } // namespace Dali
index 16014d2..45fcc77 100644 (file)
@@ -4,17 +4,16 @@ adaptor_integration_api_header_files = \
   $(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 \
-  $(adaptor_integration_api_dir)/trigger-event-factory.h
+  $(adaptor_integration_api_dir)/trigger-event-factory.h \
+  $(adaptor_integration_api_dir)/pixmap-render-surface-factory.h
 
 adaptor_integration_wayland_api_header_files = \
   $(adaptor_integration_api_dir)/wayland/wl-types.h \
   $(adaptor_integration_api_dir)/wayland/ecore-wl-render-surface.h \
-  $(adaptor_integration_api_dir)/wayland/native-render-surface.h \
-  $(adaptor_integration_api_dir)/native-render-surface-factory.h
+  $(adaptor_integration_api_dir)/wayland/pixmap-render-surface.h
 
 adaptor_integration_x11_api_header_files = \
   $(adaptor_integration_api_dir)/x11/ecore-x-types.h \
   $(adaptor_integration_api_dir)/x11/ecore-x-render-surface.h \
   $(adaptor_integration_api_dir)/x11/pixmap-render-surface.h \
-  $(adaptor_integration_api_dir)/x11/imf-manager-impl.h \
-  $(adaptor_integration_api_dir)/pixmap-render-surface-factory.h
+  $(adaptor_integration_api_dir)/x11/imf-manager-impl.h
diff --git a/adaptors/integration-api/native-render-surface-factory.h b/adaptors/integration-api/native-render-surface-factory.h
deleted file mode 100644 (file)
index fdc0469..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-#ifndef __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
-#define __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <string>
-#include <dali/public-api/object/any.h>
-#include <dali/public-api/common/dali-common.h>
-
-// INTERNAL INCLUDES
-
-namespace Dali
-{
-
-class NativeRenderSurface;
-
-/**
- * Factory function for native surface
- * A native surface is created.
- *
- * @param [in] positionSize the position and size of the surface to create
- * @param [in] name Name of surface passed in
- * @param [in] isTransparent Whether the surface has an alpha channel
- */
-NativeRenderSurface* CreateNativeSurface( PositionSize positionSize,
-                                          const std::string& name,
-                                          bool isTransparent );
-
-} // namespace Dali
-
-#endif // __DALI_INTEGRATION_NATIVE_RENDER_SURFACE_FACTORY_H__
index ebf5c0d..947f812 100644 (file)
 #include <dali/public-api/signals/callback.h>
 
 // INTERNAL INCLUDES
-#ifdef DALI_ADAPTOR_COMPILATION
 #include <trigger-event-interface.h>
-#else
-#include <dali/integration-api/adaptors/trigger-event-interface.h>
-#endif
 
 namespace Dali
 {
index a90890a..1633a0d 100644 (file)
  */
 
 // INTERNAL INCLUDES
-#include <dali/public-api/common/dali-common.h>
-#ifdef DALI_ADAPTOR_COMPILATION
 #include <trigger-event-factory-interface.h>
-#else
-#include <dali/integration-api/adaptors/trigger-event-factory-interface.h>
-#endif
+#include <dali/public-api/common/dali-common.h>
 
 namespace Dali
 {
index aa747c4..4a30da7 100644 (file)
@@ -146,11 +146,6 @@ public: // from Dali::RenderSurface
    */
   virtual void ReleaseLock() = 0;
 
-  /**
-   * @copydoc Dali::RenderSurface::GetSurfaceType()
-   */
-  virtual RenderSurface::Type GetSurfaceType();
-
 private:
 
   /**
diff --git a/adaptors/integration-api/wayland/native-render-surface.h b/adaptors/integration-api/wayland/native-render-surface.h
deleted file mode 100644 (file)
index 44caaa2..0000000
+++ /dev/null
@@ -1,176 +0,0 @@
-#ifndef __DALI_NATIVE_RENDER_SURFACE_H__
-#define __DALI_NATIVE_RENDER_SURFACE_H__
-
-/*
- * Copyright (c) 2014 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.
- *
- */
-
-// EXTERNAL INCLUDES
-#include <tbm_surface.h>
-#include <dali/public-api/common/dali-common.h>
-
-// INTERNAL INCLUDES
-#ifdef DALI_ADAPTOR_COMPILATION
-#include <render-surface.h>
-#include <egl-interface.h>
-#else
-#include <dali/devel-api/adaptor-framework/render-surface.h>
-#include <dali/integration-api/adaptors/egl-interface.h>
-#endif
-
-namespace Dali
-{
-
-class TriggerEventInterface;
-
-/**
- * Ecore X11 implementation of render surface.
- */
-class DALI_IMPORT_API NativeRenderSurface : public Dali::RenderSurface
-{
-public:
-
-  /**
-    * Uses an Wayland surface to render to.
-    * @param [in] positionSize the position and size of the surface
-    * @param [in] name optional name of surface passed in
-    * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
-    */
-  NativeRenderSurface( Dali::PositionSize positionSize,
-                             const std::string& name,
-                             bool isTransparent = false );
-
-  /**
-   * @copydoc Dali::RenderSurface::~RenderSurface
-   */
-  virtual ~NativeRenderSurface();
-
-public: // API
-
-  /**
-   * @brief Sets the render notification trigger to call when render thread is completed a frame
-   *
-   * @param renderNotification to use
-   */
-  void SetRenderNotification( TriggerEventInterface* renderNotification );
-
-  /**
-   * @brief Gets the tbm surface for offscreen rendering
-   */
-  virtual tbm_surface_h GetDrawable();
-
-  /**
-   * @brief Get the surface
-   *
-   * @return tbm surface
-   */
-  virtual Any GetSurface();
-
-  /**
-   * @brief Release the surface
-   */
-  virtual void ReleaseSurface();
-
-public: // from Dali::RenderSurface
-
-  /**
-   * @copydoc Dali::RenderSurface::GetPositionSize()
-   */
-  virtual PositionSize GetPositionSize() const;
-
-  /**
-   * @copydoc Dali::RenderSurface::InitializeEgl()
-   */
-  virtual void InitializeEgl( EglInterface& egl );
-
-  /**
-   * @copydoc Dali::RenderSurface::CreateEglSurface()
-   */
-  virtual void CreateEglSurface( EglInterface& egl );
-
-  /**
-   * @copydoc Dali::RenderSurface::DestroyEglSurface()
-   */
-  virtual void DestroyEglSurface( EglInterface& egl );
-
-  /**
-   * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
-   */
-  virtual bool ReplaceEGLSurface( EglInterface& egl );
-
-  /**
-   * @copydoc Dali::RenderSurface::MoveResize()
-   */
-  virtual void MoveResize( Dali::PositionSize positionSize);
-
-  /**
-   * @copydoc Dali::RenderSurface::SetViewMode()
-   */
-  void SetViewMode( ViewMode viewMode );
-
-  /**
-   * @copydoc Dali::RenderSurface::StartRender()
-   */
-  virtual void StartRender();
-
-  /**
-   * @copydoc Dali::RenderSurface::PreRender()
-   */
-  virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
-
-  /**
-   * @copydoc Dali::RenderSurface::PostRender()
-   */
-  virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
-
-  /**
-   * @copydoc Dali::RenderSurface::StopRender()
-   */
-  virtual void StopRender();
-
-  /**
-   * @copydoc Dali::RenderSurface::SetThreadSynchronization
-   */
-  virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
-
-  /**
-   * @copydoc Dali::RenderSurface::GetSurfaceType()
-   */
-  virtual RenderSurface::Type GetSurfaceType();
-
-private:
-
-  /**
-   * Release any locks.
-   */
-  void ReleaseLock();
-
-  /**
-   * Create tbm surface
-   */
-  virtual void CreateNativeRenderable();
-
-private: // Data
-
-  struct Impl;
-
-  Impl* mImpl;
-
-};
-
-} // namespace Dali
-
-#endif // __DALI_NATIVE_RENDER_SURFACE_H__
index 3f9b97c..1eaa823 100644 (file)
@@ -154,11 +154,6 @@ public: // from Dali::RenderSurface
    */
   virtual void ReleaseLock() = 0;
 
-  /**
-   * @copydoc Dali::RenderSurface::GetSurfaceType()
-   */
-  virtual RenderSurface::Type GetSurfaceType();
-
 private:
 
   /**
index f31a0c7..471462f 100644 (file)
@@ -112,8 +112,6 @@ public: // from Dali::RenderSurface
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
 
-  virtual RenderSurface::Type GetSurfaceType();
-
 private:
 
   /**
index 1a294b6..abe484d 100644 (file)
@@ -1,11 +1,6 @@
 # mobile profile internal files
 adaptor_common_internal_mobile_profile_src_files = \
   $(adaptor_mobile_dir)/accessibility-adaptor-impl-mobile.cpp \
+  $(adaptor_mobile_dir)/pixmap-render-surface-factory.cpp \
   $(adaptor_mobile_dir)/mobile-system-settings.cpp \
   $(adaptor_mobile_dir)/mobile-color-controller-impl.cpp
-
-adaptor_common_internal_wayland_mobile_profile_src_files = \
-  $(adaptor_mobile_dir)/native-render-surface-factory.cpp
-
-adaptor_common_internal_x_mobile_profile_src_files = \
-  $(adaptor_mobile_dir)/pixmap-render-surface-factory.cpp
diff --git a/adaptors/mobile/native-render-surface-factory.cpp b/adaptors/mobile/native-render-surface-factory.cpp
deleted file mode 100644 (file)
index ba57dfc..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// INTERNAL INCLUDES
-#include <native-render-surface.h>
-
-namespace Dali
-{
-
-DALI_EXPORT_API NativeRenderSurface* CreateNativeSurface(
-                                     PositionSize       positionSize,
-                                     const std::string& name,
-                                     bool               isTransparent)
-{
-  return new NativeRenderSurface( positionSize, name, isTransparent );
-}
-
-} // namespace Dali
diff --git a/adaptors/tizen/display-connection-impl-tizen.cpp b/adaptors/tizen/display-connection-impl-tizen.cpp
deleted file mode 100644 (file)
index 0516ba2..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <display-connection-impl.h>
-
-// EXTERNAL_HEADERS
-#include <tbm_bufmgr.h>
-#include <dali/integration-api/debug.h>
-
-// INTERNAL HEADERS
-#include <native-render-surface.h>
-#include <gl/egl-implementation.h>
-
-namespace Dali
-{
-
-namespace Internal
-{
-
-namespace Adaptor
-{
-
-EGLNativeDisplayType DisplayConnection::GetNativeDisplay()
-{
-  return (EGLNativeDisplayType)tbm_bufmgr_init( -1 );
-}
-
-void DisplayConnection::ReleaseNativeDisplay()
-{
-  if( mDisplay )
-  {
-    tbm_bufmgr_deinit( (tbm_bufmgr)mDisplay );
-  }
-}
-
-} // namespace Adaptor
-
-} // namespace Internal
-
-} // namespace Dali
index 247a9a3..12cd87e 100644 (file)
@@ -16,8 +16,6 @@ adaptor_tizen_internal_egl_extension_src_files = \
   $(adaptor_tizen_dir)/gl/egl-image-extensions-tizen.cpp
 
 adaptor_tizen_internal_native_image_src_files = \
-  $(adaptor_tizen_dir)/display-connection-impl-tizen.cpp \
-  $(adaptor_tizen_dir)/native-render-surface-tizen.cpp \
   $(adaptor_tizen_dir)/native-image-source-impl-tizen.cpp
 
 public_api_adaptor_tizen_header_files = \
diff --git a/adaptors/tizen/native-render-surface-tizen.cpp b/adaptors/tizen/native-render-surface-tizen.cpp
deleted file mode 100644 (file)
index 7f1b1a7..0000000
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- */
-
-// CLASS HEADER
-#include <native-render-surface.h>
-
-// EXTERNAL INCLUDES
-#include <dali/integration-api/gl-abstraction.h>
-#include <dali/integration-api/debug.h>
-#include <dali/devel-api/threading/conditional-wait.h>
-
-#include <Ecore_Wayland.h>
-#include <tbm_bufmgr.h>
-#include <tbm_surface_queue.h>
-
-// INTERNAL INCLUDES
-#include <trigger-event.h>
-#include <gl/egl-implementation.h>
-#include <base/display-connection.h>
-#include <integration-api/thread-synchronization-interface.h>
-
-namespace Dali
-{
-
-#if defined(DEBUG_ENABLED)
-extern Debug::Filter* gRenderSurfaceLogFilter;
-#endif
-
-struct NativeRenderSurface::Impl
-{
-  Impl( Dali::PositionSize positionSize, const std::string& name, bool isTransparent )
-  : mPosition( positionSize ),
-    mTitle( name ),
-    mRenderNotification( NULL ),
-    mColorDepth( isTransparent ? COLOR_DEPTH_32 : COLOR_DEPTH_24 ),
-    mTbmFormat( isTransparent ? TBM_FORMAT_ARGB8888 : TBM_FORMAT_RGB888 ),
-    mOwnSurface( false ),
-    mConsumeSurface( NULL ),
-    mThreadSynchronization( NULL )
-  {
-  }
-
-  PositionSize mPosition;
-  std::string mTitle;
-  TriggerEventInterface* mRenderNotification;
-  ColorDepth mColorDepth;
-  tbm_format mTbmFormat;
-  bool mOwnSurface;
-
-  tbm_surface_queue_h mTbmQueue;
-  tbm_surface_h mConsumeSurface;
-  ThreadSynchronizationInterface* mThreadSynchronization;     ///< A pointer to the thread-synchronization
-  ConditionalWait mTbmSurfaceCondition;
-};
-
-NativeRenderSurface::NativeRenderSurface(Dali::PositionSize positionSize,
-                                         const std::string& name,
-                                         bool isTransparent)
-: mImpl( new Impl( positionSize, name, isTransparent ) )
-{
-  ecore_wl_init(NULL);
-  CreateNativeRenderable();
-}
-
-NativeRenderSurface::~NativeRenderSurface()
-{
-  // release the surface if we own one
-  if( mImpl->mOwnSurface )
-  {
-
-    if( mImpl->mConsumeSurface )
-    {
-      tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
-      mImpl->mConsumeSurface = NULL;
-    }
-
-    if( mImpl->mTbmQueue )
-    {
-      tbm_surface_queue_destroy( mImpl->mTbmQueue );
-    }
-
-    delete mImpl;
-
-    DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::General, "Own tbm surface queue destroy\n" );
-  }
-}
-
-void NativeRenderSurface::SetRenderNotification( TriggerEventInterface* renderNotification )
-{
-  mImpl->mRenderNotification = renderNotification;
-}
-
-tbm_surface_h NativeRenderSurface::GetDrawable()
-{
-  ConditionalWait::ScopedLock lock( mImpl->mTbmSurfaceCondition );
-
-  return mImpl->mConsumeSurface;
-}
-
-Any NativeRenderSurface::GetSurface()
-{
-  return Any( NULL );
-}
-
-void NativeRenderSurface::InitializeEgl( EglInterface& egl )
-{
-  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
-
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
-
-  eglImpl.ChooseConfig( true, mImpl->mColorDepth );
-}
-
-void NativeRenderSurface::CreateEglSurface( EglInterface& egl )
-{
-  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
-
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
-
-  eglImpl.CreateSurfaceWindow( (EGLNativeWindowType)mImpl->mTbmQueue, mImpl->mColorDepth );
-}
-
-void NativeRenderSurface::DestroyEglSurface( EglInterface& egl )
-{
-  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
-
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
-  eglImpl.DestroySurface();
-}
-
-bool NativeRenderSurface::ReplaceEGLSurface( EglInterface& egl )
-{
-  DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
-
-  if( mImpl->mConsumeSurface )
-  {
-    tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
-    mImpl->mConsumeSurface = NULL;
-  }
-
-  if( mImpl->mTbmQueue )
-  {
-    tbm_surface_queue_destroy( mImpl->mTbmQueue );
-  }
-
-  CreateNativeRenderable();
-
-  if( !mImpl->mTbmQueue )
-  {
-    return false;
-  }
-
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
-
-  return eglImpl.ReplaceSurfaceWindow( (EGLNativeWindowType)mImpl->mTbmQueue ); // reinterpret_cast does not compile
-}
-
-void NativeRenderSurface::StartRender()
-{
-}
-
-bool NativeRenderSurface::PreRender( EglInterface&, Integration::GlAbstraction& )
-{
-  // nothing to do for pixmaps
-  return true;
-}
-
-void NativeRenderSurface::PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface )
-{
-  Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );
-  eglImpl.SwapBuffers();
-
-  // flush gl instruction queue
-  glAbstraction.Flush();
-
-  {
-    if( tbm_surface_queue_can_acquire( mImpl->mTbmQueue, 1 ) )
-    {
-      if( tbm_surface_queue_acquire( mImpl->mTbmQueue, &mImpl->mConsumeSurface ) != TBM_SURFACE_QUEUE_ERROR_NONE )
-      {
-        DALI_LOG_ERROR( "Failed aquire consume tbm_surface\n" );
-        return;
-      }
-    }
-  }
-
- // create damage for client applications which wish to know the update timing
-  if( mImpl->mRenderNotification )
-  {
-    // use notification trigger
-    // Tell the event-thread to render the pixmap
-    mImpl->mRenderNotification->Trigger();
-  }
-  else
-  {
-    // FIXME
-  }
-
-}
-
-void NativeRenderSurface::StopRender()
-{
-  ReleaseLock();
-}
-
-PositionSize NativeRenderSurface::GetPositionSize() const
-{
-  return mImpl->mPosition;
-}
-
-void NativeRenderSurface::MoveResize( Dali::PositionSize positionSize )
-{
-}
-
-void NativeRenderSurface::SetViewMode( ViewMode viewMode )
-{
-}
-
-void NativeRenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )
-{
-  mImpl->mThreadSynchronization = &threadSynchronization;
-}
-
-RenderSurface::Type NativeRenderSurface::GetSurfaceType()
-{
-  return RenderSurface::NATIVE_RENDER_SURFACE;
-}
-
-void NativeRenderSurface::CreateNativeRenderable()
-{
-  // check we're creating one with a valid size
-  DALI_ASSERT_ALWAYS( mImpl->mPosition.width > 0 && mImpl->mPosition.height > 0 && "Pixmap size is invalid" );
-
-  mImpl->mTbmQueue = tbm_surface_queue_create( 3, mImpl->mPosition.width, mImpl->mPosition.height, mImpl->mTbmFormat, TBM_BO_DEFAULT );
-
-  if( mImpl->mTbmQueue )
-  {
-    mImpl->mOwnSurface = true;
-  }
-  else
-  {
-    mImpl->mOwnSurface = false;
-  }
-}
-
-void NativeRenderSurface::ReleaseSurface()
-{
-  if( mImpl->mConsumeSurface )
-  {
-    tbm_surface_queue_release( mImpl->mTbmQueue, mImpl->mConsumeSurface );
-    mImpl->mConsumeSurface = NULL;
-  }
-}
-
-void NativeRenderSurface::ReleaseLock()
-{
-  if( mImpl->mThreadSynchronization )
-  {
-    mImpl->mThreadSynchronization->PostRenderComplete();
-  }
-}
-
-} // namespace Dali
index c08e055..3b87519 100644 (file)
@@ -60,10 +60,6 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
   return true;
 }
 
-void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
-{
-}
-
 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
 {
   CompositorOutput::GetDpi( dpiHorizontal, dpiVertical);
index 2f95739..f531628 100644 (file)
@@ -80,8 +80,6 @@ public:
    */
   bool InitializeEgl(EglInterface& egl);
 
-  void SetSurfaceType( RenderSurface::Type type );
-
 public:
 
   /**
@@ -91,10 +89,6 @@ public:
 
 protected:
 
-  EGLNativeDisplayType GetNativeDisplay();
-
-  void ReleaseNativeDisplay();
-
   // Undefined
   DisplayConnection(const DisplayConnection&);
 
index f8323ea..43750a8 100644 (file)
@@ -149,10 +149,7 @@ void RenderSurface::SetThreadSynchronization( ThreadSynchronizationInterface& th
 {
 }
 
-RenderSurface::Type RenderSurface::GetSurfaceType()
-{
-  return RenderSurface::WAYLAND_RENDER_SURFACE;
-}
+
 
 } // namespace Wayland
 
index bbbf4d2..b54c304 100644 (file)
@@ -161,11 +161,6 @@ public: // from Dali::RenderSurface
    */
   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
 
-  /**
-   * @copydoc Dali::RenderSurface::GetSurfaceType()
-   */
-  virtual RenderSurface::Type GetSurfaceType();
-
 protected: // Data
 
   Window                      mWindow;
index b917458..b0c804b 100644 (file)
@@ -44,6 +44,8 @@ DisplayConnection* DisplayConnection::New()
 DisplayConnection::DisplayConnection()
 : mDisplay(NULL)
 {
+  // Because of DDK issue, we need to use separated x display instead of ecore default display
+  mDisplay = XOpenDisplay(0);
 }
 
 DisplayConnection::~DisplayConnection()
@@ -93,15 +95,6 @@ bool DisplayConnection::InitializeEgl(EglInterface& egl)
   return true;
 }
 
-void DisplayConnection::SetSurfaceType( RenderSurface::Type type )
-{
-  if( type == RenderSurface::ECORE_RENDER_SURFACE )
-  {
-    // Because of DDK issue, we need to use separated x display instead of ecore default display
-    mDisplay = XOpenDisplay(0);
-  }
-}
-
 void DisplayConnection::GetDpi(unsigned int& dpiHorizontal, unsigned int& dpiVertical)
 {
   // calculate DPI
index 2c0eabd..c5b7a70 100644 (file)
@@ -80,8 +80,6 @@ public:
    */
   bool InitializeEgl(EglInterface& egl);
 
-  void SetSurfaceType( RenderSurface::Type type );
-
 public:
 
   /**
index 70b4694..6c0401e 100644 (file)
@@ -139,11 +139,6 @@ unsigned int EcoreXRenderSurface::GetSurfaceId( Any surface ) const
   return surfaceId;
 }
 
-RenderSurface::Type EcoreXRenderSurface::GetSurfaceType()
-{
-  return RenderSurface::ECORE_RENDER_SURFACE;
-}
-
 } // namespace ECore
 
 } // namespace Dali
index 9447e8a..2cfc776 100644 (file)
@@ -314,11 +314,6 @@ void PixmapRenderSurface::ReleaseLock()
   }
 }
 
-RenderSurface::Type PixmapRenderSurface::GetSurfaceType()
-{
-  return RenderSurface::ECORE_RENDER_SURFACE;
-}
-
 } // namespace ECore
 
 } // namespace Dali
index 4d5b9b9..0255cbe 100644 (file)
@@ -185,12 +185,10 @@ adaptor_internal_src_files += $(adaptor_wayland_tizen_internal_src_files)
 endif # USE_ECORE_WAYLAND
 
 adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
-                              $(adaptor_tizen_internal_native_image_src_files) \
-                              $(adaptor_common_internal_wayland_mobile_profile_src_files)
+                              $(adaptor_tizen_internal_native_image_src_files)
 else
 adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
-                              $(adaptor_common_internal_egl_extension_src_files) \
-                              $(adaptor_common_internal_x_mobile_profile_src_files)
+                              $(adaptor_common_internal_egl_extension_src_files)
 endif # WAYLAND
 
 endif # MOBILE_PROFILE
@@ -212,12 +210,10 @@ endif # USE_ECORE_WAYLAND
 
 adaptor_internal_src_files += $(adaptor_tizen_internal_egl_extension_src_files) \
                               $(adaptor_tizen_internal_native_image_src_files) \
-                              $(adaptor_internal_wearable_profile_src_files) \
-                              $(adaptor_common_internal_wayland_mobile_profile_src_files)
+                              $(adaptor_internal_wearable_profile_src_files)
 else
 adaptor_internal_src_files += $(adaptor_x11_tizen_internal_src_files) \
-                              $(adaptor_common_internal_egl_extension_src_files) \
-                              $(adaptor_common_internal_x_mobile_profile_src_files)
+                              $(adaptor_common_internal_egl_extension_src_files)
 endif # WAYLAND
 
 endif # WEARABLE