1 #ifndef __DALI_INTERNAL_UNIFORM_META_H__
2 #define __DALI_INTERNAL_UNIFORM_META_H__
5 * Copyright (c) 2014 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.
25 #include <dali/public-api/math/compile-time-math.h>
26 #include <dali/public-api/object/property.h>
27 #include <dali/public-api/shader-effects/shader-effect.h>
28 #include <dali/internal/common/message.h>
29 #include <dali/internal/common/event-to-update.h>
43 * Holds the metadata associated with a Shader uniform.
50 * Create a UniformMeta.
52 static UniformMeta* New( const std::string& name, const PropertyBase& property, Dali::ShaderEffect::UniformCoordinateType coordType )
54 return new UniformMeta( name, property, coordType );
59 * @param [in] meta The UniformMeta to copy.
61 UniformMeta( const UniformMeta& meta )
63 property( meta.property ),
64 coordinateType( meta.coordinateType )
66 memcpy( cacheIndeces, meta.cacheIndeces, sizeof(cacheIndeces) );
70 * Set the coordinate type.
71 * @param [in] coordType The new coordinate type.
73 void SetCoordinateType( Dali::ShaderEffect::UniformCoordinateType coordType )
75 coordinateType = coordType;
83 UniformMeta( const std::string& uniformName, const PropertyBase& prop, Dali::ShaderEffect::UniformCoordinateType coordType )
84 : name( uniformName ),
86 coordinateType( coordType )
88 memset( cacheIndeces, 0, sizeof(cacheIndeces) );
92 UniformMeta& operator=( const UniformMeta& rhs );
96 std::string name; ///< name of uniform to set/animate
97 const PropertyBase& property; ///< reference to the corresponding property
98 unsigned int cacheIndeces[ Log<GEOMETRY_TYPE_LAST>::value ][ SHADER_SUBTYPE_LAST ]; ///< internal program cache index, per program
99 Dali::ShaderEffect::UniformCoordinateType coordinateType; ///< The coordinate type of the uniform
103 } // namespace SceneGraph
105 } // namespace Internal
109 #endif // __DALI_INTERNAL_UNIFORM_META_H__