1 #ifndef __DALI_INTERNAL_ECORE_WL_WINDOW_RENDER_SURFACE_H__
2 #define __DALI_INTERNAL_ECORE_WL_WINDOW_RENDER_SURFACE_H__
5 * Copyright (c) 2014 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 <ecore-wl-render-surface.h>
23 #include <wayland-egl.h>
32 * @copydoc Dali::ECore::EcoreWlRenderSurface.
33 * Window specialization.
35 class WindowRenderSurface : public EcoreWlRenderSurface
40 * Uses an Wayland surface to render to.
41 * @param [in] positionSize the position and size of the surface
42 * @param [in] surface can be a Wayland-window or Wayland-pixmap (type must be unsigned int).
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 WindowRenderSurface( Dali::PositionSize positionSize,
48 const std::string& name,
49 bool isTransparent = false );
52 * @copydoc Dali::ECore::EcoreWlRenderSurface::~EcoreWlRenderSurface
54 virtual ~WindowRenderSurface();
59 * @copydoc Dali::RenderSurface::GetDrawable()
61 virtual Ecore_Wl_Window* GetDrawable();
64 * Request to approve deiconify operation
65 * If it is requested, it will send ECORE_X_ATOM_E_DEICONIFY_APPROVE event to window manager after rendering
67 void RequestToApproveDeiconify();
75 * @copydoc Dali::ECore::EcoreWlRenderSurface::GetSurface()
77 virtual Any GetSurface();
80 * @copydoc Dali::ECore::EcoreWlRenderSurface::GetWlWindow()
82 virtual Ecore_Wl_Window* GetWlWindow();
84 public: // from Dali::RenderSurface
87 * @copydoc Dali::RenderSurface::InitializeEgl()
89 virtual void InitializeEgl( EglInterface& egl );
92 * @copydoc Dali::RenderSurface::CreateEglSurface()
94 virtual void CreateEglSurface( EglInterface& egl );
97 * @copydoc Dali::RenderSurface::DestroyEglSurface()
99 virtual void DestroyEglSurface( EglInterface& egl );
102 * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
104 virtual bool ReplaceEGLSurface( EglInterface& egl );
107 * @copydoc Dali::RenderSurface::MoveResize()
109 virtual void MoveResize( Dali::PositionSize positionSize);
112 * @copydoc Dali::RenderSurface::SetViewMode()
114 void SetViewMode( ViewMode viewMode );
117 * @copydoc Dali::RenderSurface::StartRender()
119 virtual void StartRender();
122 * @copydoc Dali::RenderSurface::PreRender()
124 virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
127 * @copydoc Dali::RenderSurface::PostRender()
129 virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
132 * @copydoc Dali::RenderSurface::StopRender()
134 virtual void StopRender();
137 * @copydoc Dali::RenderSurface::SetThreadSynchronization
139 virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
142 * @copydoc Dali::RenderSurface::ReleaseLock()
144 virtual void ReleaseLock();
151 virtual void CreateWlRenderable();
154 * @copydoc Dali::Internal::Adaptor::ECore::EcoreWlRenderSurface::UseExistingRenderable
156 virtual void UseExistingRenderable( unsigned int surfaceId );
160 Ecore_Wl_Window* mWlWindow; ///< Wayland-Window
161 wl_egl_window* mEglWindow;
162 bool mNeedToApproveDeiconify; ///< Whether need to send ECORE_X_ATOM_E_DEICONIFY_APPROVE event
164 }; // class WindowRenderSurface
170 #endif // __DALI_INTERNAL_ECORE_X_WINDOW_RENDER_SURFACE_H__