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