Merge "Follow the include-order coding conventions" into tizen
[platform/core/uifw/dali-core.git] / dali / internal / event / actors / renderable-actor-impl.cpp
1 /*
2  * Copyright (c) 2014 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16  */
17
18 // CLASS HEADER
19 #include <dali/internal/event/actors/renderable-actor-impl.h>
20
21 // INTERNAL INCLUDES
22 #include <dali/public-api/object/type-registry.h>
23 #include <dali/internal/event/effects/shader-effect-impl.h>
24 #include <dali/internal/event/actor-attachments/renderable-attachment-impl.h>
25
26 namespace // unnamed namespace
27 {
28
29 using namespace Dali;
30
31 /*
32  * This may look like a no-op but maintains TypeRegistry chain of classes.
33  * ie if a child actor declares its base as RenderableActor, RenderableActor must exist
34  * in TypeRegistry otherwise it doesnt know that child is related to Actor.
35  */
36 BaseHandle Create()
37 {
38   return BaseHandle();
39 }
40
41 TypeRegistration mType( typeid(Dali::RenderableActor), typeid(Dali::Actor), Create );
42
43 } // unnamed namespace
44
45 namespace Dali
46 {
47
48 namespace Internal
49 {
50
51 void RenderableActor::SetSortModifier(float modifier)
52 {
53   GetRenderableAttachment().SetSortModifier(modifier);
54 }
55
56 float RenderableActor::GetSortModifier() const
57 {
58   return GetRenderableAttachment().GetSortModifier();
59 }
60
61 void RenderableActor::SetCullFace(CullFaceMode mode)
62 {
63   GetRenderableAttachment().SetCullFace( mode );
64 }
65
66 CullFaceMode RenderableActor::GetCullFace() const
67 {
68   return GetRenderableAttachment().GetCullFace();
69 }
70
71 void RenderableActor::SetBlendMode( BlendingMode::Type mode )
72 {
73   GetRenderableAttachment().SetBlendMode( mode );
74 }
75
76 BlendingMode::Type RenderableActor::GetBlendMode() const
77 {
78   return GetRenderableAttachment().GetBlendMode();
79 }
80
81 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgba,   BlendingFactor::Type destFactorRgba )
82 {
83   GetRenderableAttachment().SetBlendFunc( srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba );
84 }
85
86 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgb,   BlendingFactor::Type destFactorRgb,
87                                     BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha )
88 {
89   GetRenderableAttachment().SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
90 }
91
92 void RenderableActor::GetBlendFunc( BlendingFactor::Type& srcFactorRgb,   BlendingFactor::Type& destFactorRgb,
93                                     BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const
94 {
95   GetRenderableAttachment().GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
96 }
97
98 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgba )
99 {
100   GetRenderableAttachment().SetBlendEquation( equationRgba, equationRgba );
101 }
102
103 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha )
104 {
105   GetRenderableAttachment().SetBlendEquation( equationRgb, equationAlpha );
106 }
107
108 void RenderableActor::GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const
109 {
110   GetRenderableAttachment().GetBlendEquation( equationRgb, equationAlpha );
111 }
112
113 void RenderableActor::SetBlendColor( const Vector4& color )
114 {
115   GetRenderableAttachment().SetBlendColor( color );
116 }
117
118 const Vector4& RenderableActor::GetBlendColor() const
119 {
120   return GetRenderableAttachment().GetBlendColor();
121 }
122
123 void RenderableActor::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
124 {
125   GetRenderableAttachment().SetFilterMode( minFilter, magFilter );
126 }
127
128 void RenderableActor::GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const
129 {
130   return GetRenderableAttachment().GetFilterMode( minFilter, magFilter );
131 }
132
133 RenderableActor::RenderableActor()
134 : Actor( Actor::RENDERABLE )
135 {
136 }
137
138 RenderableActor::~RenderableActor()
139 {
140 }
141
142 void RenderableActor::SetShaderEffect(ShaderEffect& effect)
143 {
144   GetRenderableAttachment().SetShaderEffect( effect );
145 }
146
147 ShaderEffectPtr RenderableActor::GetShaderEffect() const
148 {
149   return GetRenderableAttachment().GetShaderEffect();
150 }
151
152 void RenderableActor::RemoveShaderEffect()
153 {
154   return GetRenderableAttachment().RemoveShaderEffect();
155 }
156
157 } // namespace Internal
158
159 } // namespace Dali