Removed GeometryType from ShaderEffect and ShaderSubType
[platform/core/uifw/dali-core.git] / dali / internal / render / shaders / uniform-meta.h
1 #ifndef __DALI_INTERNAL_UNIFORM_META_H__
2 #define __DALI_INTERNAL_UNIFORM_META_H__
3
4 /*
5  * Copyright (c) 2014 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 // EXTERNAL INCLUDES
22 #include <string>
23 #include <cstring> // for memcpy & memset
24
25 // INTERNAL INCLUDES
26 #include <dali/public-api/math/compile-time-math.h>
27 #include <dali/public-api/object/property.h>
28 #include <dali/public-api/shader-effects/shader-effect.h>
29 #include <dali/internal/common/message.h>
30
31 namespace Dali
32 {
33
34 namespace Internal
35 {
36
37 namespace SceneGraph
38 {
39
40 class PropertyBase;
41
42 /**
43  * Holds the metadata associated with a Shader uniform.
44  */
45 class UniformMeta
46 {
47 public:
48
49   /**
50    * Create a UniformMeta.
51    */
52   static UniformMeta* New( const std::string& name, const PropertyBase& property, Dali::ShaderEffect::UniformCoordinateType coordType )
53   {
54     return new UniformMeta( name, property, coordType );
55   }
56
57   /**
58    * Copy constructor
59    * @param [in] meta The UniformMeta to copy.
60    */
61   UniformMeta( const UniformMeta& meta )
62   : name( meta.name ),
63     property( meta.property ),
64     cacheIndex( meta.cacheIndex ),
65     coordinateType( meta.coordinateType )
66   {
67   }
68
69   /**
70    * Set the coordinate type.
71    * @param [in] coordType The new coordinate type.
72    */
73   void SetCoordinateType( Dali::ShaderEffect::UniformCoordinateType coordType )
74   {
75     coordinateType = coordType;
76   }
77
78 private:
79
80   /**
81    * Constructor
82    */
83   UniformMeta( const std::string& uniformName, const PropertyBase& prop, Dali::ShaderEffect::UniformCoordinateType coordType )
84   : name( uniformName ),
85     property( prop ),
86     cacheIndex( 0 ),
87     coordinateType( coordType )
88   {
89   }
90
91   // Undefined
92   UniformMeta& operator=( const UniformMeta& rhs );
93
94 public:
95
96   std::string name; ///< name of uniform to set/animate
97   const PropertyBase& property; ///< reference to the corresponding property
98   unsigned int cacheIndex; ///< internal program cache index
99   Dali::ShaderEffect::UniformCoordinateType coordinateType; ///< The coordinate type of the uniform
100
101
102 };
103
104 } // namespace SceneGraph
105
106 } // namespace Internal
107
108 } // namespace Dali
109
110 #endif // __DALI_INTERNAL_UNIFORM_META_H__