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.
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
31 DisplayConnection* DisplayConnectionCocoa::New()
33 return new DisplayConnectionCocoa();
36 DisplayConnectionCocoa::DisplayConnectionCocoa()
41 DisplayConnectionCocoa::~DisplayConnectionCocoa()
45 Any DisplayConnectionCocoa::GetDisplay()
47 return EGL_DEFAULT_DISPLAY;
50 void DisplayConnectionCocoa::ConsumeEvents()
54 bool DisplayConnectionCocoa::InitializeEgl(EglInterface& egl)
56 EglImplementation& eglImpl = static_cast<EglImplementation&>( egl );
58 if(!eglImpl.InitializeGles(EGL_DEFAULT_DISPLAY))
60 DALI_LOG_ERROR( "Failed to initialize GLES.\n" );
67 bool DisplayConnectionCocoa::InitializeGraphics()
69 auto eglGraphics = static_cast<EglGraphics *>( mGraphics );
70 EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
72 if(!eglImpl.InitializeGles(EGL_DEFAULT_DISPLAY))
74 DALI_LOG_ERROR( "Failed to initialize GLES.\n" );
81 void DisplayConnectionCocoa::SetSurfaceType( Dali::RenderSurfaceInterface::Type type )
85 void DisplayConnectionCocoa::SetGraphicsInterface( GraphicsInterface& graphics )
87 mGraphics = &graphics;
90 } // namespace Dali::Internal::Adaptor