2 * Copyright (c) 2018 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/tizen-wayland/display-connection-impl-ecore-wl.h>
22 #include <dali/integration-api/debug.h>
25 #include <Ecore_Wl2.h>
27 #include <Ecore_Wayland.h>
39 DisplayConnection* DisplayConnectionEcoreWl::New()
41 DisplayConnection* pDisplayConnection(new DisplayConnectionEcoreWl());
43 return pDisplayConnection;
46 DisplayConnectionEcoreWl::DisplayConnectionEcoreWl()
48 mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE )
52 DisplayConnectionEcoreWl::~DisplayConnectionEcoreWl()
54 if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
56 ReleaseNativeDisplay();
60 Any DisplayConnectionEcoreWl::GetDisplay()
62 return Any( mDisplay );
65 void DisplayConnectionEcoreWl::ConsumeEvents()
69 bool DisplayConnectionEcoreWl::InitializeEgl(EglInterface& egl)
71 EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
73 if( !eglImpl.InitializeGles( mDisplay ) )
75 DALI_LOG_ERROR("Failed to initialize GLES.\n");
82 void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type )
86 if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
88 mDisplay = GetNativeDisplay();
93 Ecore_Wl2_Display* display = ecore_wl2_connected_display_get( NULL );
94 mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl2_display_get( display ) );
96 mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl_display_get() );
101 EGLNativeDisplayType DisplayConnectionEcoreWl::GetNativeDisplay()
103 return EGLNativeDisplayType();
106 void DisplayConnectionEcoreWl::ReleaseNativeDisplay()
111 } // namespace Adaptor
113 } // namespace Internal