2 * Copyright (c) 2014 Samsung Electronics Co., Ltd.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
19 #include <dali/internal/event/actors/renderable-actor-impl.h>
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>
26 namespace // unnamed namespace
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.
41 TypeRegistration mType( typeid(Dali::RenderableActor), typeid(Dali::Actor), Create );
43 } // unnamed namespace
51 void RenderableActor::SetSortModifier(float modifier)
53 GetRenderableAttachment().SetSortModifier(modifier);
56 float RenderableActor::GetSortModifier() const
58 return GetRenderableAttachment().GetSortModifier();
61 void RenderableActor::SetCullFace(CullFaceMode mode)
63 GetRenderableAttachment().SetCullFace( mode );
66 CullFaceMode RenderableActor::GetCullFace() const
68 return GetRenderableAttachment().GetCullFace();
71 void RenderableActor::SetBlendMode( BlendingMode::Type mode )
73 GetRenderableAttachment().SetBlendMode( mode );
76 BlendingMode::Type RenderableActor::GetBlendMode() const
78 return GetRenderableAttachment().GetBlendMode();
81 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgba, BlendingFactor::Type destFactorRgba )
83 GetRenderableAttachment().SetBlendFunc( srcFactorRgba, destFactorRgba, srcFactorRgba, destFactorRgba );
86 void RenderableActor::SetBlendFunc( BlendingFactor::Type srcFactorRgb, BlendingFactor::Type destFactorRgb,
87 BlendingFactor::Type srcFactorAlpha, BlendingFactor::Type destFactorAlpha )
89 GetRenderableAttachment().SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
92 void RenderableActor::GetBlendFunc( BlendingFactor::Type& srcFactorRgb, BlendingFactor::Type& destFactorRgb,
93 BlendingFactor::Type& srcFactorAlpha, BlendingFactor::Type& destFactorAlpha ) const
95 GetRenderableAttachment().GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
98 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgba )
100 GetRenderableAttachment().SetBlendEquation( equationRgba, equationRgba );
103 void RenderableActor::SetBlendEquation( BlendingEquation::Type equationRgb, BlendingEquation::Type equationAlpha )
105 GetRenderableAttachment().SetBlendEquation( equationRgb, equationAlpha );
108 void RenderableActor::GetBlendEquation( BlendingEquation::Type& equationRgb, BlendingEquation::Type& equationAlpha ) const
110 GetRenderableAttachment().GetBlendEquation( equationRgb, equationAlpha );
113 void RenderableActor::SetBlendColor( const Vector4& color )
115 GetRenderableAttachment().SetBlendColor( color );
118 const Vector4& RenderableActor::GetBlendColor() const
120 return GetRenderableAttachment().GetBlendColor();
123 void RenderableActor::SetFilterMode( FilterMode::Type minFilter, FilterMode::Type magFilter )
125 GetRenderableAttachment().SetFilterMode( minFilter, magFilter );
128 void RenderableActor::GetFilterMode( FilterMode::Type& minFilter, FilterMode::Type& magFilter ) const
130 return GetRenderableAttachment().GetFilterMode( minFilter, magFilter );
133 RenderableActor::RenderableActor()
134 : Actor( Actor::RENDERABLE )
138 RenderableActor::~RenderableActor()
142 void RenderableActor::SetShaderEffect(ShaderEffect& effect)
144 GetRenderableAttachment().SetShaderEffect( effect );
147 ShaderEffectPtr RenderableActor::GetShaderEffect() const
149 return GetRenderableAttachment().GetShaderEffect();
152 void RenderableActor::RemoveShaderEffect()
154 return GetRenderableAttachment().RemoveShaderEffect();
157 } // namespace Internal