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