Flutter Engine
The Flutter Engine
android_surface.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_SURFACE_ANDROID_SURFACE_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_ANDROID_SURFACE_H_
7
8#include <memory>
9#include "flutter/flow/embedded_views.h"
10#include "flutter/flow/surface.h"
11#include "flutter/fml/macros.h"
12#include "flutter/shell/platform/android/context/android_context.h"
13#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
14#include "flutter/shell/platform/android/surface/android_native_window.h"
16
17namespace impeller {
18class Context;
19} // namespace impeller
20
21namespace flutter {
22
23class AndroidExternalViewEmbedder;
24
26 public:
27 virtual ~AndroidSurface();
28
29 virtual bool IsValid() const = 0;
30
31 virtual void TeardownOnScreenContext() = 0;
32
33 virtual std::unique_ptr<Surface> CreateGPUSurface(
34 GrDirectContext* gr_context = nullptr) = 0;
35
36 virtual bool OnScreenSurfaceResize(const SkISize& size) = 0;
37
38 virtual bool ResourceContextMakeCurrent() = 0;
39
40 virtual bool ResourceContextClearCurrent() = 0;
41
43
44 virtual std::unique_ptr<Surface> CreateSnapshotSurface();
45
46 virtual std::shared_ptr<impeller::Context> GetImpellerContext();
47
48 protected:
50};
51
53 public:
55
56 virtual ~AndroidSurfaceFactory() = default;
57
58 virtual std::unique_ptr<AndroidSurface> CreateSurface() = 0;
59};
60
61} // namespace flutter
62
63#endif // FLUTTER_SHELL_PLATFORM_ANDROID_SURFACE_ANDROID_SURFACE_H_
virtual std::unique_ptr< AndroidSurface > CreateSurface()=0
virtual ~AndroidSurfaceFactory()=default
virtual bool IsValid() const =0
virtual std::unique_ptr< Surface > CreateSnapshotSurface()
virtual std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context=nullptr)=0
virtual void TeardownOnScreenContext()=0
virtual std::shared_ptr< impeller::Context > GetImpellerContext()
virtual bool OnScreenSurfaceResize(const SkISize &size)=0
virtual bool ResourceContextClearCurrent()=0
virtual bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window)=0
virtual bool ResourceContextMakeCurrent()=0
GLFWwindow * window
Definition: main.cc:45
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