Revert "[Tizen] Revert "Support multiple window rendering""
[platform/core/uifw/dali-adaptor.git] / dali / internal / window-system / common / pixmap-render-surface.h
1 #ifndef DALI_INTERNAL_WINDOWSYSTEM_COMMON_PIXMAP_RENDER_SURFACE_H
2 #define DALI_INTERNAL_WINDOWSYSTEM_COMMON_PIXMAP_RENDER_SURFACE_H
3
4 /*
5  * Copyright (c) 2018 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
23 #ifdef DALI_ADAPTOR_COMPILATION
24 #include <dali/integration-api/render-surface-interface.h>
25 #include <dali/internal/graphics/common/graphics-interface.h>
26 #else
27 #include <dali/integration-api/adaptors/render-surface-interface.h>
28 #endif
29
30
31 namespace Dali
32 {
33
34 class TriggerEventInterface;
35
36 namespace Internal
37 {
38 namespace Adaptor
39 {
40
41 /**
42  * Pixmap interface of render surface.
43  */
44 class PixmapRenderSurface : public Dali::RenderSurfaceInterface
45 {
46 public:
47
48   /**
49    * @brief Default constructor
50    */
51   PixmapRenderSurface() = default;
52
53   /**
54    * @brief Destructor
55    */
56   virtual ~PixmapRenderSurface() = default;
57
58 public: // API
59
60   /**
61    * @brief Get the render surface the adaptor is using to render to.
62    * @return reference to current render surface
63    */
64   virtual Any GetSurface() = 0;
65
66   /**
67    * @brief Sets the render notification trigger to call when render thread is completed a frame
68    * @param renderNotification to use
69    */
70   virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) = 0;
71
72   /**
73    * @copydoc Dali::Integration::RenderSurface::GetDepthBufferRequired()
74    */
75   Integration::DepthBufferAvailable GetDepthBufferRequired() override
76   {
77     return mGraphics ? mGraphics->GetDepthBufferRequired() : Integration::DepthBufferAvailable::FALSE;
78   }
79
80   /**
81    * @copydoc Dali::Integration::RenderSurface::GetStencilBufferRequired()
82    */
83   Integration::StencilBufferAvailable GetStencilBufferRequired() override
84   {
85     return mGraphics ? mGraphics->GetStencilBufferRequired() : Integration::StencilBufferAvailable::FALSE;
86   }
87
88 private:
89
90   /**
91    * Second stage construction
92    */
93   virtual void Initialize( Any surface ) = 0;
94
95   /**
96    * @brief Create a renderable
97    */
98   virtual void CreateRenderable() = 0;
99
100   /**
101    * @brief Use an existing render surface
102    * @param surfaceId the id of the surface
103    */
104   virtual void UseExistingRenderable( unsigned int surfaceId ) = 0;
105
106 protected:
107
108   // Undefined
109   PixmapRenderSurface(const PixmapRenderSurface&) = delete;
110
111   // Undefined
112   PixmapRenderSurface& operator=(const PixmapRenderSurface& rhs) = delete;
113
114 };
115
116 } // namespace Adaptor
117
118 } // namespace internal
119
120 } // namespace Dali
121
122 #endif // DALI_INTERNAL_WINDOWSYSTEM_COMMON_PIXMAP_RENDER_SURFACE_H