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.
20 #include <dali/internal/window-system/macos/display-connection-impl-mac.h>
23 #include <dali/integration-api/debug.h>
26 #include <dali/internal/graphics/gles/egl-graphics.h>
28 namespace Dali::Internal::Adaptor
30 DisplayConnection* DisplayConnectionCocoa::New()
32 return new DisplayConnectionCocoa();
35 DisplayConnectionCocoa::DisplayConnectionCocoa()
40 DisplayConnectionCocoa::~DisplayConnectionCocoa()
44 Any DisplayConnectionCocoa::GetDisplay()
46 return EGL_DEFAULT_DISPLAY;
49 void DisplayConnectionCocoa::ConsumeEvents()
53 bool DisplayConnectionCocoa::InitializeEgl(EglInterface& egl)
55 EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
57 if(!eglImpl.InitializeGles(EGL_DEFAULT_DISPLAY))
59 DALI_LOG_ERROR("Failed to initialize GLES.\n");
66 bool DisplayConnectionCocoa::InitializeGraphics()
68 auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
69 EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
71 if(!eglImpl.InitializeGles(EGL_DEFAULT_DISPLAY))
73 DALI_LOG_ERROR("Failed to initialize GLES.\n");
80 void DisplayConnectionCocoa::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
84 void DisplayConnectionCocoa::SetGraphicsInterface(GraphicsInterface& graphics)
86 mGraphics = &graphics;
89 } // namespace Dali::Internal::Adaptor