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.
19 #include <dali/internal/graphics/gles/egl-graphics.h>
20 #include <dali/internal/window-system/android/display-connection-impl-android.h>
23 #include <dali/integration-api/debug.h>
31 DisplayConnection* DisplayConnectionAndroid::New()
33 DisplayConnection* pDisplayConnection(new DisplayConnectionAndroid());
35 return pDisplayConnection;
38 DisplayConnectionAndroid::DisplayConnectionAndroid()
40 mSurfaceType(RenderSurfaceInterface::WINDOW_RENDER_SURFACE),
45 DisplayConnectionAndroid::~DisplayConnectionAndroid() = default;
47 Any DisplayConnectionAndroid::GetDisplay()
52 void DisplayConnectionAndroid::ConsumeEvents()
56 bool DisplayConnectionAndroid::InitializeGraphics()
58 auto eglGraphics = static_cast<EglGraphics*>(mGraphics);
59 EglImplementation& eglImpl = eglGraphics->GetEglImplementation();
61 if(!eglImpl.InitializeGles(mDisplay))
63 DALI_LOG_ERROR("Failed to initialize GLES.\n");
70 void DisplayConnectionAndroid::SetSurfaceType(Dali::RenderSurfaceInterface::Type type)
73 mDisplay = EGL_DEFAULT_DISPLAY;
76 void DisplayConnectionAndroid::SetGraphicsInterface(GraphicsInterface& graphics)
78 mGraphics = &graphics;
81 } // namespace Adaptor
83 } // namespace Internal