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/actors/layer.h>
22 #include <dali/internal/offscreen/common/offscreen-application-impl.h>
23 #include <dali/internal/offscreen/common/offscreen-window-impl.h>
24 #include <dali/internal/offscreen/common/offscreen-window-factory.h>
27 #include <dali/devel-api/adaptor-framework/offscreen-window.h>
31 OffscreenWindow OffscreenWindow::New( uint16_t width, uint16_t height, bool isTranslucent )
33 auto windowFactory = Dali::Internal::GetOffscreenWindowFactory();
35 IntrusivePtr < Internal::OffscreenWindow > impl = windowFactory->CreateOffscreenWindow( width, height, surface, isTranslucent ).release();
36 OffscreenWindow window = OffscreenWindow( impl.Get() );
37 impl->Initialize( false );
42 OffscreenWindow OffscreenWindow::New( Any surface, bool isTranslucent )
44 auto windowFactory = Dali::Internal::GetOffscreenWindowFactory();
45 IntrusivePtr < Internal::OffscreenWindow > impl = windowFactory->CreateOffscreenWindow( 0, 0, surface, isTranslucent ).release();
46 OffscreenWindow window = OffscreenWindow( impl.Get() );
47 impl->Initialize( false );
52 OffscreenWindow::OffscreenWindow()
56 OffscreenWindow::OffscreenWindow( const OffscreenWindow& window )
57 : BaseHandle( window )
61 OffscreenWindow& OffscreenWindow::operator=( const OffscreenWindow& window )
65 BaseHandle::operator=( window );
70 OffscreenWindow::~OffscreenWindow()
74 void OffscreenWindow::Add( Actor actor )
76 Internal::GetImplementation( *this ).Add( actor );
79 void OffscreenWindow::Remove( Actor actor )
81 Internal::GetImplementation( *this ).Remove( actor );
84 void OffscreenWindow::SetBackgroundColor( const Vector4& color )
86 Internal::GetImplementation( *this ).SetBackgroundColor( color );
89 Vector4 OffscreenWindow::GetBackgroundColor() const
91 return Internal::GetImplementation( *this ).GetBackgroundColor();
94 Layer OffscreenWindow::GetRootLayer() const
96 return Internal::GetImplementation( *this ).GetRootLayer();
99 uint32_t OffscreenWindow::GetLayerCount() const
101 return Internal::GetImplementation( *this ).GetLayerCount();
104 Layer OffscreenWindow::GetLayer( uint32_t depth ) const
106 return Internal::GetImplementation( *this ).GetLayer( depth );
109 OffscreenWindow::WindowSize OffscreenWindow::GetSize() const
111 return Internal::GetImplementation( *this ).GetSize();
114 Any OffscreenWindow::GetNativeHandle() const
116 return Internal::GetImplementation( *this ).GetNativeHandle();
119 OffscreenWindow::PostRenderSignalType& OffscreenWindow::PostRenderSignal()
121 return Internal::GetImplementation( *this ).PostRenderSignal();
125 OffscreenWindow::OffscreenWindow( Internal::OffscreenWindow* window )
126 : BaseHandle( window )