Flutter Engine
 
Loading...
Searching...
No Matches
android_surface_gl_skia.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_SKIA_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_SKIA_H_
7
8#include <jni.h>
9
10#include <memory>
11
12#include "flutter/fml/macros.h"
18
19namespace flutter {
20
22 public AndroidSurface {
23 public:
24 explicit AndroidSurfaceGLSkia(
25 const std::shared_ptr<AndroidContextGLSkia>& android_context);
26
28
29 // |AndroidSurface|
30 bool IsValid() const override;
31
32 // |AndroidSurface|
33 std::unique_ptr<Surface> CreateGPUSurface(
34 GrDirectContext* gr_context) override;
35
36 // |AndroidSurface|
37 void TeardownOnScreenContext() override;
38
39 // |AndroidSurface|
40 bool OnScreenSurfaceResize(const DlISize& size) override;
41
42 // |AndroidSurface|
43 bool ResourceContextMakeCurrent() override;
44
45 // |AndroidSurface|
46 bool ResourceContextClearCurrent() override;
47
48 // |AndroidSurface|
49 bool SetNativeWindow(
51 const std::shared_ptr<PlatformViewAndroidJNI>& jni_facade) override;
52
53 // |AndroidSurface|
54 virtual std::unique_ptr<Surface> CreateSnapshotSurface() override;
55
56 // |GPUSurfaceGLDelegate|
57 std::unique_ptr<GLContextResult> GLContextMakeCurrent() override;
58
59 // |GPUSurfaceGLDelegate|
60 bool GLContextClearCurrent() override;
61
62 // |GPUSurfaceGLDelegate|
64
65 // |GPUSurfaceGLDelegate|
66 void GLContextSetDamageRegion(const std::optional<DlIRect>& region) override;
67
68 // |GPUSurfaceGLDelegate|
69 bool GLContextPresent(const GLPresentInfo& present_info) override;
70
71 // |GPUSurfaceGLDelegate|
72 GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override;
73
74 // |GPUSurfaceGLDelegate|
75 sk_sp<const GrGLInterface> GetGLInterface() const override;
76
77 // Obtain a raw pointer to the on-screen AndroidEGLSurface.
78 //
79 // This method is intended for use in tests. Callers must not
80 // delete the returned pointer.
82 return onscreen_surface_.get();
83 }
84
85 private:
86 std::shared_ptr<AndroidContextGLSkia> android_context_;
88 std::unique_ptr<AndroidEGLSurface> onscreen_surface_;
89 std::unique_ptr<AndroidEGLSurface> offscreen_surface_;
90
92};
93
94} // namespace flutter
95
96#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_GL_SKIA_H_
AndroidEGLSurface * GetOnscreenSurface() const
bool OnScreenSurfaceResize(const DlISize &size) override
bool GLContextPresent(const GLPresentInfo &present_info) override
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context) override
virtual std::unique_ptr< Surface > CreateSnapshotSurface() override
sk_sp< const GrGLInterface > GetGLInterface() const override
void GLContextSetDamageRegion(const std::optional< DlIRect > &region) override
std::unique_ptr< GLContextResult > GLContextMakeCurrent() override
SurfaceFrame::FramebufferInfo GLContextFramebufferInfo() const override
bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window, const std::shared_ptr< PlatformViewAndroidJNI > &jni_facade) override
GLFBOInfo GLContextFBO(GLFrameInfo frame_info) const override
GLFWwindow * window
Definition main.cc:60
#define FML_DISALLOW_COPY_AND_ASSIGN(TypeName)
Definition macros.h:27
it will be possible to load the file into Perfetto s trace viewer use test Running tests that layout and measure text will not yield consistent results across various platforms Enabling this option will make font resolution default to the Ahem test font on all 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