1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_SURFACE_ECORE_WL_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_SURFACE_ECORE_WL_H
5 * Copyright (c) 2018 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
22 #include <tbm_surface.h>
23 #include <tbm_surface_queue.h>
24 #include <dali/devel-api/threading/conditional-wait.h>
27 #include <dali/public-api/dali-adaptor-common.h>
28 #include <dali/integration-api/native-render-surface.h>
29 #include <dali/internal/graphics/common/graphics-interface.h>
34 class DisplayConnection;
37 * Ecore Wayland Native implementation of render surface.
39 class NativeRenderSurfaceEcoreWl : public Dali::NativeRenderSurface
44 * Uses an Wayland surface to render to.
45 * @param [in] positionSize the position and size of the surface
46 * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
48 NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize, bool isTransparent = false );
53 virtual ~NativeRenderSurfaceEcoreWl();
55 public: // from WindowRenderSurface
58 * @copydoc Dali::NativeRenderSurface::GetSurface()
60 virtual Any GetDrawable() override;
63 * @copydoc Dali::NativeRenderSurface::SetRenderNotification()
65 virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) override;
68 * @copydoc Dali::NativeRenderSurface::WaitUntilSurfaceReplaced()
70 virtual void WaitUntilSurfaceReplaced() override;
72 public: // from Dali::RenderSurface
75 * @copydoc Dali::RenderSurface::GetPositionSize()
77 virtual PositionSize GetPositionSize() const override;
80 * @copydoc Dali::RenderSurface::GetDpi()
82 virtual void GetDpi( unsigned int& dpiHorizontal, unsigned int& dpiVertical ) override;
85 * @copydoc Dali::RenderSurface::InitializeGraphics()
87 virtual void InitializeGraphics( Internal::Adaptor::GraphicsInterface& graphics, DisplayConnection& displayConnection ) override;
90 * @copydoc Dali::RenderSurface::CreateSurface()
92 virtual void CreateSurface() override;
95 * @copydoc Dali::RenderSurface::DestroySurface()
97 virtual void DestroySurface() override;
100 * @copydoc Dali::RenderSurface::ReplaceGraphicsSurface()
102 virtual bool ReplaceGraphicsSurface() override;
105 * @copydoc Dali::RenderSurface::MoveResize()
107 virtual void MoveResize( Dali::PositionSize positionSize) override;
110 * @copydoc Dali::RenderSurface::SetViewMode()
112 virtual void SetViewMode( ViewMode viewMode ) override;
115 * @copydoc Dali::RenderSurface::StartRender()
117 virtual void StartRender() override;
120 * @copydoc Dali::RenderSurface::PreRender()
122 virtual bool PreRender( bool resizingSurface ) override;
125 * @copydoc Dali::RenderSurface::PostRender()
127 virtual void PostRender( bool renderToFbo, bool replacingSurface, bool resizingSurface );
130 * @copydoc Dali::RenderSurface::StopRender()
132 virtual void StopRender() override;
135 * @copydoc Dali::RenderSurface::SetThreadSynchronization
137 virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization )override;
140 * @copydoc Dali::RenderSurface::GetSurfaceType()
142 virtual RenderSurface::Type GetSurfaceType() override;
147 * @copydoc Dali::RenderSurface::ReleaseLock()
149 virtual void ReleaseLock() override;
152 * @copydoc Dali::NativeRenderSurface::CreateNativeRenderable()
154 virtual void CreateNativeRenderable() override;
157 * @copydoc Dali::NativeRenderSurface::ReleaseDrawable()
159 virtual void ReleaseDrawable() override;
163 PositionSize mPosition;
164 TriggerEventInterface* mRenderNotification;
165 Internal::Adaptor::GraphicsInterface* mGraphics; ///< The graphics interface
166 ColorDepth mColorDepth;
167 tbm_format mTbmFormat;
169 bool mDrawableCompleted;
171 tbm_surface_queue_h mTbmQueue;
172 tbm_surface_h mConsumeSurface;
173 ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
174 ConditionalWait mTbmSurfaceCondition;
180 #endif // DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_SURFACE_ECORE_WL_H