2 * Copyright (c) 2015 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/devel-api/rendering/renderer.h> // Dali::Renderer
22 #include <dali/internal/event/rendering/renderer-impl.h> // Dali::Internal::Renderer
27 Renderer Renderer::New( Geometry& geometry, Material& material )
29 Internal::RendererPtr renderer = Internal::Renderer::New( );
30 renderer->SetGeometry( GetImplementation(geometry) );
31 renderer->SetMaterial( GetImplementation(material) );
32 return Renderer( renderer.Get() );
43 Renderer::Renderer( const Renderer& handle )
48 Renderer Renderer::DownCast( BaseHandle handle )
50 return Renderer( dynamic_cast<Dali::Internal::Renderer*>(handle.GetObjectPtr()));
53 Renderer& Renderer::operator=( const Renderer& handle )
55 BaseHandle::operator=( handle );
59 void Renderer::SetGeometry( Geometry& geometry )
61 DALI_ASSERT_ALWAYS( geometry && "Geometry handle not initialized" );
62 GetImplementation(*this).SetGeometry( GetImplementation(geometry) );
65 Geometry Renderer::GetGeometry() const
67 Internal::Geometry* geometryPtr( GetImplementation(*this).GetGeometry() );
68 return Dali::Geometry( geometryPtr );
71 void Renderer::SetMaterial( Material& material )
73 DALI_ASSERT_ALWAYS( material && "Material handle not initialized" );
74 GetImplementation(*this).SetMaterial( GetImplementation(material) );
77 Material Renderer::GetMaterial() const
79 Internal::Material* materialPtr( GetImplementation(*this).GetMaterial() );
80 return Dali::Material( materialPtr );
83 void Renderer::SetBlendFunc( BlendingFactor::Type srcFactorRgba,
84 BlendingFactor::Type destFactorRgba )
86 GetImplementation(*this).SetBlendFunc( srcFactorRgba, destFactorRgba );
89 void Renderer::SetBlendFunc( BlendingFactor::Type srcFactorRgb,
90 BlendingFactor::Type destFactorRgb,
91 BlendingFactor::Type srcFactorAlpha,
92 BlendingFactor::Type destFactorAlpha )
94 GetImplementation(*this).SetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
97 void Renderer::GetBlendFunc( BlendingFactor::Type& srcFactorRgb,
98 BlendingFactor::Type& destFactorRgb,
99 BlendingFactor::Type& srcFactorAlpha,
100 BlendingFactor::Type& destFactorAlpha ) const
102 GetImplementation(*this).GetBlendFunc( srcFactorRgb, destFactorRgb, srcFactorAlpha, destFactorAlpha );
105 void Renderer::SetBlendEquation( BlendingEquation::Type equationRgba )
107 GetImplementation(*this).SetBlendEquation( equationRgba );
110 void Renderer::SetBlendEquation( BlendingEquation::Type equationRgb,
111 BlendingEquation::Type equationAlpha )
113 GetImplementation(*this).SetBlendEquation( equationRgb, equationAlpha );
116 void Renderer::GetBlendEquation( BlendingEquation::Type& equationRgb,
117 BlendingEquation::Type& equationAlpha ) const
119 GetImplementation(*this).GetBlendEquation( equationRgb, equationAlpha );
122 Renderer::Renderer( Internal::Renderer* pointer )