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.
19 #include <dali/internal/window-system/android/display-connection-impl-android.h>
20 #include <dali/internal/graphics/gles/egl-graphics.h>
23 #include <dali/integration-api/debug.h>
34 DisplayConnection* DisplayConnectionAndroid::New()
36 DisplayConnection* pDisplayConnection(new DisplayConnectionAndroid());
38 return pDisplayConnection;
41 DisplayConnectionAndroid::DisplayConnectionAndroid()
43 mSurfaceType( RenderSurfaceInterface::WINDOW_RENDER_SURFACE ),
48 DisplayConnectionAndroid::~DisplayConnectionAndroid() = default;
50 Any DisplayConnectionAndroid::GetDisplay()
52 return Any( mDisplay );
55 void DisplayConnectionAndroid::ConsumeEvents()
59 bool DisplayConnectionAndroid::InitializeGraphics()
61 auto eglGraphics = static_cast<EglGraphics*>( mGraphics );
62 EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
64 if( !eglImpl.InitializeGles( mDisplay ) )
66 DALI_LOG_ERROR( "Failed to initialize GLES.\n" );
73 void DisplayConnectionAndroid::SetSurfaceType( Dali::RenderSurfaceInterface::Type type )
76 mDisplay = EGL_DEFAULT_DISPLAY;
79 void DisplayConnectionAndroid::SetGraphicsInterface( GraphicsInterface& graphics )
81 mGraphics = &graphics;
84 } // namespace Adaptor
86 } // namespace Internal