Merge "Add UniformNameCache to keep track of unique uniform ids to avoid calculating...
[platform/core/uifw/dali-core.git] / dali / internal / render / data-providers / material-data-provider.h
1 #ifndef DALI_INTERNAL_SCENE_GRAPH_MATERIAL_DATA_PROVIDER_H
2 #define DALI_INTERNAL_SCENE_GRAPH_MATERIAL_DATA_PROVIDER_H
3 /*
4  * Copyright (c) 2015 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 #include <dali/internal/common/buffer-index.h>
20 #include <dali/public-api/common/dali-vector.h>
21 #include <dali/public-api/actors/blending.h>
22
23 namespace Dali
24 {
25 namespace Internal
26 {
27 namespace SceneGraph
28 {
29
30 /**
31  * Interface to provide data of the material to the renderer.
32  * This interface must not be used to pass object pointers.
33  */
34 class MaterialDataProvider
35 {
36 public:
37   /**
38    * Construtor
39    */
40   MaterialDataProvider()
41   {
42   }
43
44   virtual const Vector4& GetBlendColor( BufferIndex bufferIndex ) const = 0;
45
46   /**
47    * Get the RGB source factor
48    * @return the RGB source factor
49    */
50   virtual BlendingFactor::Type GetBlendSrcFactorRgb( BufferIndex bufferIndex ) const = 0;
51
52   /**
53    * Get the Alpha source factor
54    * @return the Alpha source factor
55    */
56   virtual BlendingFactor::Type GetBlendSrcFactorAlpha( BufferIndex bufferIndex ) const = 0;
57
58   /**
59    * Get the RGB destination factor
60    * @return the RGB destination factor
61    */
62   virtual BlendingFactor::Type GetBlendDestFactorRgb( BufferIndex bufferIndex ) const = 0;
63
64   /**
65    * Get the Alpha destination factor
66    * @return the Alpha destination factor
67    */
68   virtual BlendingFactor::Type GetBlendDestFactorAlpha( BufferIndex bufferIndex ) const = 0;
69
70   /**
71    * Get the RGB blending equation
72    * @return the RGB blending equation
73    */
74   virtual BlendingEquation::Type GetBlendEquationRgb( BufferIndex bufferIndex ) const = 0;
75
76   /**
77    * Get the Alpha blending equation
78    * @return the Alpha blending equation
79    */
80   virtual BlendingEquation::Type GetBlendEquationAlpha( BufferIndex bufferIndex ) const = 0;
81
82 protected:
83   /**
84    * Destructor. No deletion through this interface
85    */
86   virtual ~MaterialDataProvider()
87   {
88   }
89 };
90
91 } // namespace SceneGraph
92 } // namespace Internal
93 } // namespace Dali
94
95 #endif // DALI_INTERNAL_SCENE_GRAPH_MATERIAL_DATA_PROVIDER_H