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