Revert "[Tizen] ecore-wl2: add zxdg_shell define"
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / wayland / ecore-wl2 / pixmap-render-surface2.h
1 #ifndef __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
2 #define __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__
3
4 /*
5  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
6  *
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
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
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.
18  *
19  */
20
21 // INTERNAL INCLUDES
22 #include <dali/integration-api/wayland/ecore-wl2/ecore-wl2-render-surface.h>
23
24 namespace Dali
25 {
26
27 namespace ECore
28 {
29
30 /**
31  * Ecore X11 implementation of render surface.
32  */
33 class PixmapRenderSurface : public EcoreWlRenderSurface
34 {
35 public:
36
37   /**
38     * Uses an Wayland surface to render to.
39     * @param [in] positionSize the position and size of the surface
40     * @param [in] surface can be a Wayland-window (type must be unsigned int).
41     * @param [in] name optional name of surface passed in
42     * @param [in] isTransparent if it is true, surface has 32 bit color depth, otherwise, 24 bit
43     */
44   PixmapRenderSurface( Dali::PositionSize positionSize,
45                        Any surface,
46                        const std::string& name,
47                        bool isTransparent = false);
48
49   /**
50    * @copydoc Dali::RenderSurface::~RenderSurface
51    */
52   virtual ~PixmapRenderSurface();
53
54 public: // API
55
56   /**
57    * @copydoc Dali::ECore::EcoreWlRenderSurface::GetDrawable()
58    */
59   virtual Ecore_Wl2_Window* GetDrawable();
60
61   /**
62    * @brief GetSurface
63    *
64    * @return pixmap
65    */
66   virtual Any GetSurface();
67
68 public: // from Dali::RenderSurface
69
70   /**
71    * @copydoc Dali::RenderSurface::InitializeEgl()
72    */
73   virtual void InitializeEgl( EglInterface& egl );
74
75   /**
76    * @copydoc Dali::RenderSurface::CreateEglSurface()
77    */
78   virtual void CreateEglSurface( EglInterface& egl );
79
80   /**
81    * @copydoc Dali::RenderSurface::DestroyEglSurface()
82    */
83   virtual void DestroyEglSurface( EglInterface& egl );
84
85   /**
86    * @copydoc Dali::RenderSurface::ReplaceEGLSurface()
87    */
88   virtual bool ReplaceEGLSurface( EglInterface& egl );
89
90   /**
91    * @copydoc Dali::RenderSurface::StartRender()
92    */
93   virtual void StartRender();
94
95   /**
96    * @copydoc Dali::RenderSurface::PreRender()
97    */
98   virtual bool PreRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, bool resizingSurface );
99
100   /**
101    * @copydoc Dali::RenderSurface::PostRender()
102    */
103   virtual void PostRender( EglInterface& egl, Integration::GlAbstraction& glAbstraction, DisplayConnection* displayConnection, bool replacingSurface, bool resizingSurface );
104
105   /**
106    * @copydoc Dali::RenderSurface::StopRender()
107    */
108   virtual void StopRender();
109
110   /**
111    * @copydoc Dali::RenderSurface::SetThreadSynchronization
112    */
113   virtual void SetThreadSynchronization( ThreadSynchronizationInterface& threadSynchronization );
114
115 private:
116   enum SyncMode
117   {
118     SYNC_MODE_NONE,
119     SYNC_MODE_WAIT
120   };
121
122   /**
123    * Set the sync mode.
124    * @param[in] syncMode The sync mode
125    */
126   void SetSyncMode( SyncMode syncMode );
127
128   /**
129    * If sync mode is WAIT, then acquire a lock. This prevents render thread from
130    * continuing until the pixmap has been drawn by the compositor.
131    * It must be released for rendering to continue.
132    */
133   void AcquireLock();
134
135   /**
136    * Release any locks.
137    */
138   void ReleaseLock();
139
140   /**
141    * Create XPixmap
142    */
143   virtual void CreateWlRenderable();
144
145   /**
146    * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::UseExistingRenderable
147    */
148   virtual void UseExistingRenderable( unsigned int surfaceId );
149
150 private: // Data
151
152 };
153
154 } // namespace ECore
155
156 } // namespace Dali
157
158 #endif // __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__