Flutter Engine
The Flutter Engine
android_surface_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_SURFACE_GL_IMPELLER_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_IMPELLER_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/impeller/renderer/context.h"
10#include "flutter/shell/gpu/gpu_surface_gl_delegate.h"
11#include "flutter/shell/platform/android/android_context_gl_impeller.h"
12#include "flutter/shell/platform/android/surface/android_native_window.h"
13#include "flutter/shell/platform/android/surface/android_surface.h"
14
15namespace flutter {
16
18 public AndroidSurface {
19 public:
21 const std::shared_ptr<AndroidContextGLImpeller>& android_context);
22
23 // |AndroidSurface|
25
26 // |AndroidSurface|
27 bool IsValid() const override;
28
29 // |AndroidSurface|
30 std::unique_ptr<Surface> CreateGPUSurface(
31 GrDirectContext* gr_context) override;
32
33 // |AndroidSurface|
34 void TeardownOnScreenContext() override;
35
36 // |AndroidSurface|
37 bool OnScreenSurfaceResize(const SkISize& size) override;
38
39 // |AndroidSurface|
40 bool ResourceContextMakeCurrent() override;
41
42 // |AndroidSurface|
43 bool ResourceContextClearCurrent() override;
44
45 // |AndroidSurface|
47
48 // |AndroidSurface|
49 std::unique_ptr<Surface> CreateSnapshotSurface() override;
50
51 // |AndroidSurface|
52 std::shared_ptr<impeller::Context> GetImpellerContext() override;
53
54 // |GPUSurfaceGLDelegate|
55 std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
56
57 // |GPUSurfaceGLDelegate|
58 bool GLContextClearCurrent() override;
59
60 // |GPUSurfaceGLDelegate|
62
63 // |GPUSurfaceGLDelegate|
64 void GLContextSetDamageRegion(const std::optional<SkIRect>& region) override;
65
66 // |GPUSurfaceGLDelegate|
67 bool GLContextPresent(const GLPresentInfo& present_info) override;
68
69 // |GPUSurfaceGLDelegate|
70 GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override;
71
72 // |GPUSurfaceGLDelegate|
74
75 private:
76 std::shared_ptr<AndroidContextGLImpeller> android_context_;
77 std::unique_ptr<impeller::egl::Surface> onscreen_surface_;
78 std::unique_ptr<impeller::egl::Surface> offscreen_surface_;
80
81 bool is_valid_ = false;
82
83 bool OnGLContextMakeCurrent();
84
85 bool RecreateOnscreenSurfaceAndMakeOnscreenContextCurrent();
86
87 FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceGLImpeller);
88};
89
90} // namespace flutter
91
92#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_IMPELLER_H_
SurfaceFrame::FramebufferInfo GLContextFramebufferInfo() const override
void GLContextSetDamageRegion(const std::optional< SkIRect > &region) override
bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window) override
sk_sp< const GrGLInterface > GetGLInterface() const override
bool GLContextPresent(const GLPresentInfo &present_info) override
bool OnScreenSurfaceResize(const SkISize &size) override
AndroidSurfaceGLImpeller(const std::shared_ptr< AndroidContextGLImpeller > &android_context)
GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override
std::shared_ptr< impeller::Context > GetImpellerContext() override
std::unique_ptr< GLContextResult > GLContextMakeCurrent() override
std::unique_ptr< Surface > CreateSnapshotSurface() override
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context) override
GLFWwindow * window
Definition: main.cc:45
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238
it will be possible to load the file into Perfetto s trace viewer disable asset Prevents usage of any non test fonts unless they were explicitly Loaded via prefetched default font Indicates whether the embedding started a prefetch of the default font manager before creating the engine run In non interactive keep the shell running after the Dart script has completed enable serial On low power devices with low core running concurrent GC tasks on threads can cause them to contend with the UI thread which could potentially lead to jank This option turns off all concurrent GC activities domain network JSON encoded network policy per domain This overrides the DisallowInsecureConnections switch Embedder can specify whether to allow or disallow insecure connections at a domain level old gen heap size
Definition: switches.h:259
Definition: SkSize.h:16