Revert "[Tizen] Revert "Support screen rotation""
[platform/core/uifw/dali-adaptor.git] / adaptors / integration-api / x11 / pixmap-render-surface.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 <ecore-x-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 EcoreXRenderSurface
34 {
35 public:
36
37   /**
38     * Uses an X11 surface to render to.
39     * @param [in] positionSize the position and size of the surface
40     * @param [in] surface can be a X-window or X-pixmap (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::EcoreXRenderSurface::GetDrawable()
58    */
59   virtual Ecore_X_Drawable 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   virtual RenderSurface::Type GetSurfaceType();
116
117 private:
118
119   /**
120    * Release any locks.
121    */
122   void ReleaseLock();
123
124   /**
125    * Create XPixmap
126    */
127   virtual void CreateXRenderable();
128
129   /**
130    * @copydoc Dali::Internal::Adaptor::ECore::RenderSurface::UseExistingRenderable
131    */
132   virtual void UseExistingRenderable( unsigned int surfaceId );
133
134 private: // Data
135
136   struct Impl;
137   Impl* mImpl;
138 };
139
140 } // namespace ECore
141
142 } // namespace Dali
143
144 #endif // __DALI_ECORE_X_PIXMAP_RENDER_SURFACE_H__