1 #ifndef __DALI_RENDER_SURFACE_WL_H__
2 #define __DALI_RENDER_SURFACE_WL_H__
5 * Copyright (c) 2015 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 <dali/public-api/common/dali-common.h>
23 #include <wayland-manager.h>
24 #include <wayland-egl.h>
27 #include <wayland-window.h>
28 #include <render-surface.h>
29 #include <egl-interface.h> // for color depth
34 class TriggerEventInterface;
41 class WindowEventInterface;
50 * Wayland render surface.
52 class RenderSurface : public Dali::RenderSurface
59 * @param [in] positionSize the position and size of the surface
60 * @param [in] surface can be a X-window or X-pixmap (type must be unsigned int).
61 * @param [in] name optional name of surface passed in
62 * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
64 RenderSurface(Dali::PositionSize positionSize,
66 const std::string& name,
67 bool isTransparent = false);
72 virtual ~RenderSurface();
85 * @brief Get window handle
87 * @return the wayland window pointer
92 * Assigns an event interface to the surface for getting
93 * input events / window notifications
95 void AssignWindowEventInterface( Dali::Internal::Adaptor::WindowEventInterface* eventInterface );
97 public: // from Dali::RenderSurface
100 * @copydoc Dali::RenderSurface::GetPositionSize()
102 virtual PositionSize GetPositionSize() const;
105 * @copydoc Dali::RenderSurface::InitializeEgl()
107 virtual void InitializeEgl( EglInterface& egl );
110 * @copydoc Dali::RenderSurface::CreateEglSurface()
112 virtual void CreateEglSurface( EglInterface& egl );
115 * @copydoc Dali::RenderSurface::DestroyEglSurface()
117 virtual void DestroyEglSurface( EglInterface& egl );
120 * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
122 virtual bool ReplaceEGLSurface( EglInterface& egl );
125 * @copydoc Dali::RenderSurface::MoveResize()
127 virtual void MoveResize( Dali::PositionSize positionSize);
130 * @copydoc Dali::RenderSurface::SetViewMode()
132 virtual void SetViewMode( ViewMode viewMode );
135 * @copydoc Dali::RenderSurface::StartRender()
137 virtual void StartRender();
140 * @copydoc Dali::RenderSurface::PreRender()
142 virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction );
145 * @copydoc Dali::RenderSurface::PostRender()
147 virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface );
150 * @copydoc Dali::RenderSurface::StopRender();
152 virtual void StopRender();
155 * @copydoc Dali::RenderSurface::ReleaseLock()
157 virtual void ReleaseLock();
160 * @copydoc Dali::RenderSurface::SetThreadSynchronization()
162 virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
165 * @copydoc Dali::RenderSurface::GetSurfaceType()
167 virtual RenderSurface::Type GetSurfaceType();
172 TriggerEventInterface* mRenderNotification; ///< Render notification trigger
173 Dali::ColorDepth mColorDepth; ///< Color depth
174 Dali::Internal::Adaptor::WaylandManager* mWaylandManager; ///< wayland manager
175 wl_egl_window* mEglWindow;
179 } // namespace Wayland
183 #endif // __DALI_RENDER_SURFACE_WL_H__