2 * Copyright (c) 2020 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/public-api/rendering/renderer.h> // Dali::Renderer
22 #include <dali/internal/event/rendering/renderer-impl.h> // Dali::Internal::Renderer
27 Renderer Renderer::New( Geometry& geometry, Shader& shader )
29 Internal::RendererPtr renderer = Internal::Renderer::New( );
30 renderer->SetGeometry( GetImplementation(geometry) );
31 renderer->SetShader( GetImplementation(shader) );
32 return Renderer( renderer.Get() );
43 Renderer::Renderer( const Renderer& handle ) = default;
45 Renderer Renderer::DownCast( BaseHandle handle )
47 return Renderer( dynamic_cast<Dali::Internal::Renderer*>(handle.GetObjectPtr()));
50 Renderer& Renderer::operator=( const Renderer& handle ) = default;
52 Renderer::Renderer( Renderer&& rhs ) = default;
54 Renderer& Renderer::operator=( Renderer&& rhs ) = default;
56 void Renderer::SetGeometry( Geometry& geometry )
58 DALI_ASSERT_ALWAYS( geometry && "Geometry handle not initialized" );
59 GetImplementation(*this).SetGeometry( GetImplementation(geometry) );
62 Geometry Renderer::GetGeometry() const
64 return Dali::Geometry( GetImplementation(*this).GetGeometry().Get() );
67 void Renderer::SetTextures( TextureSet& textureSet )
69 DALI_ASSERT_ALWAYS( textureSet && "TextureSet handle not initialized" );
70 GetImplementation(*this).SetTextures( GetImplementation(textureSet) );
73 TextureSet Renderer::GetTextures() const
75 return Dali::TextureSet( GetImplementation(*this).GetTextures().Get() );
78 void Renderer::SetShader( Shader& shader )
80 DALI_ASSERT_ALWAYS( shader && "Shader handle not initialized" );
81 GetImplementation(*this).SetShader( GetImplementation(shader) );
84 Shader Renderer::GetShader() const
86 return Dali::Shader( GetImplementation(*this).GetShader().Get() );
89 Renderer::Renderer( Internal::Renderer* pointer )