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/public-api/common/dali-common.h>
25 #include <dali/devel-api/threading/conditional-wait.h>
28 #include <dali/integration-api/native-render-surface.h>
34 * Ecore Wayland Native implementation of render surface.
36 class NativeRenderSurfaceEcoreWl : public Dali::NativeRenderSurface
41 * Uses an Wayland surface to render to.
42 * @param [in] positionSize the position and size of the surface
43 * @param [in] name optional name of surface passed in
44 * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
46 NativeRenderSurfaceEcoreWl( Dali::PositionSize positionSize,
47 const std::string& name,
48 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;
80 * @copydoc Dali::RenderSurface::InitializeEgl()
82 virtual void InitializeEgl( EglInterface& egl );
85 * @copydoc Dali::RenderSurface::CreateEglSurface()
87 virtual void CreateEglSurface( EglInterface& egl );
90 * @copydoc Dali::RenderSurface::DestroyEglSurface()
92 virtual void DestroyEglSurface( EglInterface& egl );
95 * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
97 virtual bool ReplaceEGLSurface( EglInterface& egl );
100 * @copydoc Dali::RenderSurface::MoveResize()
102 virtual void MoveResize( Dali::PositionSize positionSize);
105 * @copydoc Dali::RenderSurface::SetViewMode()
107 void SetViewMode( ViewMode viewMode );
110 * @copydoc Dali::RenderSurface::StartRender()
112 virtual void StartRender();
115 * @copydoc Dali::RenderSurface::PreRender()
117 virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
120 * @copydoc Dali::RenderSurface::PostRender()
122 virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
125 * @copydoc Dali::RenderSurface::StopRender()
127 virtual void StopRender();
130 * @copydoc Dali::RenderSurface::SetThreadSynchronization
132 virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
135 * @copydoc Dali::RenderSurface::GetSurfaceType()
137 virtual RenderSurface::Type GetSurfaceType();
142 * @copydoc Dali::RenderSurface::ReleaseLock()
144 virtual void ReleaseLock() override;
147 * @copydoc Dali::NativeRenderSurface::CreateNativeRenderable()
149 virtual void CreateNativeRenderable() override;
152 * @copydoc Dali::NativeRenderSurface::ReleaseDrawable()
154 virtual void ReleaseDrawable() override;
158 PositionSize mPosition;
160 TriggerEventInterface* mRenderNotification;
161 ColorDepth mColorDepth;
162 tbm_format mTbmFormat;
164 bool mDrawableCompleted;
166 tbm_surface_queue_h mTbmQueue;
167 tbm_surface_h mConsumeSurface;
168 ThreadSynchronizationInterface* mThreadSynchronization; ///< A pointer to the thread-synchronization
169 ConditionalWait mTbmSurfaceCondition;
175 #endif // DALI_INTERNAL_WINDOWSYSTEM_TIZENWAYLAND_NATIVE_SURFACE_ECORE_WL_H