Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
android_context_gl_impeller.h
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#ifndef FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/impeller/toolkit/egl/display.h"
10#include "flutter/shell/platform/android/context/android_context.h"
11
12namespace flutter {
13
15 public:
16 AndroidContextGLImpeller(std::unique_ptr<impeller::egl::Display> display,
17 bool enable_gpu_tracing);
18
20
21 // |AndroidContext|
22 bool IsValid() const override;
23
26 std::unique_ptr<impeller::egl::Surface> CreateOffscreenSurface();
29 std::unique_ptr<impeller::egl::Surface> CreateOnscreenSurface(
30 EGLNativeWindowType window);
31
32 private:
33 class ReactorWorker;
34
35 std::shared_ptr<ReactorWorker> reactor_worker_;
36 std::unique_ptr<impeller::egl::Display> display_;
37 std::unique_ptr<impeller::egl::Config> onscreen_config_;
38 std::unique_ptr<impeller::egl::Config> offscreen_config_;
39 std::unique_ptr<impeller::egl::Context> onscreen_context_;
40 std::unique_ptr<impeller::egl::Context> offscreen_context_;
41 bool is_valid_ = false;
42
44};
45
46} // namespace flutter
47
48#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_CONTEXT_GL_IMPELLER_H_
std::unique_ptr< impeller::egl::Surface > CreateOnscreenSurface(EGLNativeWindowType window)
bool OnscreenContextMakeCurrent(impeller::egl::Surface *onscreen_surface)
bool ResourceContextMakeCurrent(impeller::egl::Surface *offscreen_surface)
std::unique_ptr< impeller::egl::Surface > CreateOffscreenSurface()
Holds state that is shared across Android surfaces.
GLFWwindow * window
Definition main.cc:45
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
EGLDisplay display_