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