2 * Copyright (c) 2021 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-factory.h>
20 #include <dali/internal/window-system/common/display-connection.h>
23 #include <dali/internal/window-system/common/display-connection-factory.h>
24 #include <dali/internal/window-system/common/display-connection-impl.h>
28 DisplayConnection* DisplayConnection::New(Dali::Internal::Adaptor::GraphicsInterface& graphics)
30 auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
31 auto displayConnection = factory->CreateDisplayConnection();
33 Internal::Adaptor::DisplayConnection* internal(displayConnection.release());
34 internal->SetGraphicsInterface(graphics);
36 return new DisplayConnection(internal);
39 DisplayConnection* DisplayConnection::New(Dali::Internal::Adaptor::GraphicsInterface& graphics, Dali::RenderSurfaceInterface::Type type)
41 auto factory = Dali::Internal::Adaptor::GetDisplayConnectionFactory();
42 auto displayConnection = factory->CreateDisplayConnection();
44 Internal::Adaptor::DisplayConnection* internal(displayConnection.release());
46 internal->SetGraphicsInterface(graphics);
47 internal->SetSurfaceType(type);
49 return new DisplayConnection(internal);
52 DisplayConnection::DisplayConnection() = default;
54 DisplayConnection::~DisplayConnection() = default;
56 DisplayConnection::DisplayConnection(Internal::Adaptor::DisplayConnection* impl)
61 Any DisplayConnection::GetDisplay()
63 return mImpl->GetDisplay();
66 void DisplayConnection::ConsumeEvents()
68 mImpl->ConsumeEvents();
71 bool DisplayConnection::Initialize()
73 return mImpl->InitializeGraphics();