3c015b8e00606328e40c150d4b928e03bd70a76c
[platform/core/uifw/dali-core.git] / dali / internal / render / data-providers / render-data-provider.h
1 #ifndef DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H
3
4 /*
5  * Copyright (c) 2022 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 #include <dali/internal/render/data-providers/uniform-map-data-provider.h>
22 #include <dali/public-api/common/dali-vector.h>
23
24 namespace Dali
25 {
26 namespace Internal
27 {
28 struct BlendingOptions;
29
30 namespace Render
31 {
32 class Texture;
33 class Sampler;
34 } // namespace Render
35
36 namespace SceneGraph
37 {
38 class Shader;
39 class Renderer;
40
41 /**
42  * Wraps all the data providers for the renderer. This allows the
43  * individual providers to change connections in the update thread without affecting
44  * the current render. It essentially provides double buffering of the
45  * provider accessor through the message system. It does not take ownership
46  * of any objects.
47  */
48 class RenderDataProvider
49 {
50 protected:
51   /**
52    * Destructor
53    */
54   virtual ~RenderDataProvider() = default;
55
56 public:
57   /**
58    * Get the uniform map data provider
59    */
60   virtual const UniformMapDataProvider& GetUniformMapDataProvider() const = 0;
61
62   /**
63    * Returns the shader
64    * @return The shader
65    */
66   virtual const Shader& GetShader() const = 0;
67
68   /**
69    * Returns the list of samplers
70    * @return The list of samplers
71    */
72   virtual const Dali::Vector<Render::Sampler*>* GetSamplers() const = 0;
73
74   /**
75    * Returns the list of Textures
76    * @return The list of Textures
77    */
78   virtual const Dali::Vector<Render::Texture*>* GetTextures() const = 0;
79
80   /**
81    * Get the opacity
82    * @param[in] bufferIndex The current buffer index.
83    * @return The opacity
84    */
85   virtual float GetOpacity(BufferIndex bufferIndex) const = 0;
86
87   /**
88    * @brief Retrieve if the render data is updated
89    * @return An updated flag
90    */
91   virtual bool IsUpdated() const = 0;
92
93   /**
94    * @brief Get the update area after visual properties applied.
95    * @param[in] bufferIndex The current buffer index.
96    * @param[in] originalUpdateArea The original update area before apply the visual properties.
97    * @return The recalculated size after visual properties applied.
98    */
99   virtual Vector4 GetVisualTransformedUpdateArea(BufferIndex bufferIndex, const Vector4& originalUpdateArea) noexcept = 0;
100 };
101
102 } // namespace SceneGraph
103 } // namespace Internal
104 } // namespace Dali
105
106 #endif // DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H