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