Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
shell
platform
android
android_environment_gl.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "flutter/shell/platform/android/android_environment_gl.h"
6
7
namespace
flutter
{
8
9
AndroidEnvironmentGL::AndroidEnvironmentGL() :
display_
(EGL_NO_DISPLAY) {
10
// Get the display.
11
display_
= eglGetDisplay(EGL_DEFAULT_DISPLAY);
12
13
if
(
display_
== EGL_NO_DISPLAY) {
14
return
;
15
}
16
17
// Initialize the display connection.
18
if
(eglInitialize(
display_
,
nullptr
,
nullptr
) != EGL_TRUE) {
19
return
;
20
}
21
22
valid_ =
true
;
23
}
24
25
AndroidEnvironmentGL::~AndroidEnvironmentGL() {
26
// Disconnect the display if valid.
27
if
(
display_
!= EGL_NO_DISPLAY) {
28
eglTerminate(
display_
);
29
}
30
}
31
32
bool
AndroidEnvironmentGL::IsValid()
const
{
33
return
valid_;
34
}
35
36
EGLDisplay AndroidEnvironmentGL::Display()
const
{
37
return
display_
;
38
}
39
40
}
// namespace flutter
display_
EGLDisplay display_
Definition
FlutterEmbedderGLFW.cc:38
flutter
Definition
asset_manager.cc:10
Generated on Fri Apr 26 2024 06:14:19 for Flutter Engine by
1.9.8