Revert "[Tizen] Revert "Support multiple window rendering""
[platform/core/uifw/dali-adaptor.git] / dali / integration-api / native-render-surface.h
1 #ifndef __DALI_NATIVE_RENDER_SURFACE_H__
2 #define __DALI_NATIVE_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 #include <dali/public-api/dali-adaptor-common.h>
23
24 #ifdef DALI_ADAPTOR_COMPILATION
25 #include <dali/integration-api/egl-interface.h>
26 #include <dali/integration-api/render-surface-interface.h>
27 #else
28 #include <dali/integration-api/adaptors/egl-interface.h>
29 #include <dali/integration-api/adaptors/render-surface-interface.h>
30 #endif
31
32 namespace Dali
33 {
34
35 class TriggerEventInterface;
36
37 /**
38  * Native interface of render surface.
39  */
40 class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurfaceInterface
41 {
42 public:
43
44   /**
45    * @brief Default constructor
46    */
47   NativeRenderSurface() = default;
48
49   /**
50    * @brief Destructor
51    */
52   virtual ~NativeRenderSurface() = default;
53
54 public: // API
55
56   /**
57    * @brief Get the render surface the adaptor is using to render to.
58    * @return reference to current render surface
59    */
60   virtual Any GetDrawable() = 0;
61
62   /**
63    * @brief Sets the render notification trigger to call when render thread is completed a frame
64    * @param renderNotification to use
65    */
66   virtual void SetRenderNotification( TriggerEventInterface* renderNotification ) = 0;
67
68   /**
69    * @brief Waits until surface is replaced
70    * After tbm surface is acquired in PostRender, this function is finished.
71    */
72   virtual void WaitUntilSurfaceReplaced() = 0;
73
74 private: // from NativeRenderSurface
75
76   /**
77    * @brief Create a renderable
78    */
79   virtual void CreateNativeRenderable() = 0;
80
81   /**
82    * @brief Release a drawable
83    */
84   virtual void ReleaseDrawable() = 0;
85
86 protected:
87
88   // Undefined
89   NativeRenderSurface(const NativeRenderSurface&) = delete;
90
91   // Undefined
92   NativeRenderSurface& operator=(const NativeRenderSurface& rhs) = delete;
93
94 };
95
96 } // namespace Dali
97
98 #endif // __DALI_NATIVE_RENDER_SURFACE_H__