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/internal/window-system/common/display-connection.h>
20 #include <dali/internal/window-system/common/display-connection-factory.h>
23 #include <dali/internal/window-system/common/display-connection-impl.h>
24 #include <dali/internal/window-system/common/display-connection-factory.h>
30 DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics )
32 auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
33 auto displayConnection = factory->CreateDisplayConnection();
35 Internal::Adaptor::DisplayConnection* internal( displayConnection.release() );
36 internal->SetGraphicsInterface( graphics );
38 return new DisplayConnection(internal);
41 DisplayConnection* DisplayConnection::New( Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::RenderSurfaceInterface::Type type )
43 auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
44 auto displayConnection = factory->CreateDisplayConnection();
46 Internal::Adaptor::DisplayConnection* internal( displayConnection.release() );
48 internal->SetGraphicsInterface( graphics );
49 internal->SetSurfaceType( type );
51 return new DisplayConnection(internal);
54 DisplayConnection::DisplayConnection() = default;
56 DisplayConnection::~DisplayConnection() = default;
58 DisplayConnection::DisplayConnection(Internal::Adaptor::DisplayConnection* impl)
63 Any DisplayConnection::GetDisplay()
65 return mImpl->GetDisplay();
68 void DisplayConnection::ConsumeEvents()
70 mImpl->ConsumeEvents();
73 bool DisplayConnection::Initialize()
75 return mImpl->InitializeGraphics();