1 #ifndef __DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H__
2 #define __DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H__
5 * Copyright (c) 2015 Samsung Electronics Co., Ltd.
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
11 * http://www.apache.org/licenses/LICENSE-2.0
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.
21 #include <dali/internal/render/data-providers/geometry-data-provider.h>
22 #include <dali/internal/render/data-providers/material-data-provider.h>
23 #include <dali/internal/render/data-providers/node-data-provider.h>
24 #include <dali/internal/render/data-providers/sampler-data-provider.h>
25 #include <dali/internal/render/data-providers/property-buffer-data-provider.h>
26 #include <dali/internal/render/data-providers/uniform-map-data-provider.h>
38 * Wraps all the data providers for the renderer. This allows the
39 * individual providers to change connections in the update thread without affecting
40 * the current render. It essentially provides double buffering of the
41 * provider accessor through the message system. It does not take ownership
44 * @todo - Add set of bools to state what changed (For improving performance)
46 class RenderDataProvider
49 typedef Dali::Vector< const PropertyBufferDataProvider* > VertexBuffers;
50 typedef Dali::Vector< const SamplerDataProvider* > Samplers;
54 * The RendererAttachment that creates this object will initialize the members
62 ~RenderDataProvider();
66 * Set the geometry data provider
67 * @param[in] geometryDataProvider The geometry data provider
69 void SetGeometry( const GeometryDataProvider& geometryDataProvider );
72 * Get the geometry data provider
73 * @return the geometry data provider
75 const GeometryDataProvider& GetGeometry() const;
78 * Set the material data provider
79 * @param[in] materialDataProvider The material data provider
81 void SetMaterial( const MaterialDataProvider& materialDataProvider );
84 * Get the material data provider
85 * @return the material data provider
87 const MaterialDataProvider& GetMaterial() const;
90 * Set the uniform map data provider
91 * @param[in] uniformMapDataProvider The uniform map data provider
93 void SetUniformMap(const UniformMapDataProvider& uniformMapDataProvider);
96 * Get the uniform map data provider
98 const UniformMapDataProvider& GetUniformMap() const;
101 * Set the shader data provider
102 * @param[in] shader The shader data provider
104 void SetShader( Shader& shader );
110 Shader& GetShader() const;
113 * Set the index buffer
114 * @param[in] indexBuffer the index buffer to set
116 void SetIndexBuffer( const PropertyBufferDataProvider* indexBuffer );
119 * Get the index buffer of the geometry
120 * @return A const reference to the index buffer
122 const PropertyBufferDataProvider* GetIndexBuffer() const;
125 * Set the vertex buffers
126 * @param[in] vertexBuffers The vertex buffers
128 void SetVertexBuffers( const VertexBuffers& vertexBuffers );
131 * Get the vertex buffers of the geometry
132 * @return A const reference to the vertex buffers
134 const VertexBuffers& GetVertexBuffers() const;
137 * Set the sampler data providers
138 * @param[in] samplers The sampler data providers
140 void SetSamplers( const Samplers& samplers );
143 * Returns the list of sampler data providers
144 * @return The list of samplers
146 const Samplers& GetSamplers() const;
149 const GeometryDataProvider* mGeometryDataProvider;
150 const MaterialDataProvider* mMaterialDataProvider;
151 const UniformMapDataProvider* mUniformMapDataProvider;
153 const PropertyBufferDataProvider* mIndexBuffer;
154 VertexBuffers mVertexBuffers;
157 // Give RendererAttachment access to our private data to reduce copying vectors on construction.
158 friend class RendererAttachment;
165 #endif // __DALI_INTERNAL_SCENE_GRAPH_RENDER_DATA_PROVIDER_H__