2 * Copyright (c) 2015 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 <Ecore_Wayland.h>
23 #include <dali/integration-api/debug.h>
34 DisplayConnection* DisplayConnectionEcoreWl::New()
36 DisplayConnection* pDisplayConnection(new DisplayConnectionEcoreWl());
38 return pDisplayConnection;
41 DisplayConnectionEcoreWl::DisplayConnectionEcoreWl()
43 mSurfaceType( RenderSurface::WINDOW_RENDER_SURFACE )
47 DisplayConnectionEcoreWl::~DisplayConnectionEcoreWl()
49 if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
51 ReleaseNativeDisplay();
55 Any DisplayConnectionEcoreWl::GetDisplay()
57 return Any( mDisplay );
60 void DisplayConnectionEcoreWl::ConsumeEvents()
64 bool DisplayConnectionEcoreWl::InitializeEgl(EglInterface& egl)
66 EglImplementation& eglImpl = static_cast<EglImplementation&>(egl);
68 if( !eglImpl.InitializeGles( mDisplay ) )
70 DALI_LOG_ERROR("Failed to initialize GLES.\n");
77 void DisplayConnectionEcoreWl::SetSurfaceType( RenderSurface::Type type )
81 if( mSurfaceType == RenderSurface::NATIVE_RENDER_SURFACE )
83 mDisplay = GetNativeDisplay();
87 mDisplay = reinterpret_cast< EGLNativeDisplayType >( ecore_wl_display_get() );
91 EGLNativeDisplayType DisplayConnectionEcoreWl::GetNativeDisplay()
93 return EGLNativeDisplayType();
96 void DisplayConnectionEcoreWl::ReleaseNativeDisplay()
101 } // namespace Adaptor
103 } // namespace Internal