4728bcbee5545473fae5c6f24ab2183405aa5465
[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) 2019 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/render-surface-interface.h>
26 #else
27 #include <dali/integration-api/adaptors/render-surface-interface.h>
28 #endif
29
30 namespace Dali
31 {
32
33 class TriggerEventInterface;
34
35 /**
36  * Native interface of render surface.
37  */
38 class DALI_ADAPTOR_API NativeRenderSurface : public Dali::RenderSurfaceInterface
39 {
40 public:
41
42   /**
43    * @brief Default constructor
44    */
45   NativeRenderSurface() = default;
46
47   /**
48    * @brief Destructor
49    */
50   virtual ~NativeRenderSurface() = 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 GetDrawable() = 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    * @brief Waits until surface is replaced
68    * After tbm surface is acquired in PostRender, this function is finished.
69    */
70   virtual void WaitUntilSurfaceReplaced() = 0;
71
72 private: // from NativeRenderSurface
73
74   /**
75    * @brief Create a renderable
76    */
77   virtual void CreateNativeRenderable() = 0;
78
79   /**
80    * @brief Release a drawable
81    */
82   virtual void ReleaseDrawable() = 0;
83
84 protected:
85
86   // Undefined
87   NativeRenderSurface(const NativeRenderSurface&) = delete;
88
89   // Undefined
90   NativeRenderSurface& operator=(const NativeRenderSurface& rhs) = delete;
91
92 };
93
94 } // namespace Dali
95
96 #endif // DALI_NATIVE_RENDER_SURFACE_H