Flutter Engine
The Flutter Engine
android_surface_software.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_SOFTWARE_H_
6#define FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_SOFTWARE_H_
7
8#include "flutter/fml/macros.h"
9#include "flutter/fml/platform/android/jni_weak_ref.h"
10#include "flutter/fml/platform/android/scoped_java_ref.h"
11#include "flutter/shell/gpu/gpu_surface_software.h"
12#include "flutter/shell/platform/android/jni/platform_view_android_jni.h"
13#include "flutter/shell/platform/android/surface/android_surface.h"
14
16
17namespace flutter {
18
21 public:
23
25
26 // |AndroidSurface|
27 bool IsValid() const override;
28
29 // |AndroidSurface|
30 bool ResourceContextMakeCurrent() override;
31
32 // |AndroidSurface|
33 bool ResourceContextClearCurrent() override;
34
35 // |AndroidSurface|
36 std::unique_ptr<Surface> CreateGPUSurface(
37 GrDirectContext* gr_context) override;
38
39 // |AndroidSurface|
40 void TeardownOnScreenContext() override;
41
42 // |AndroidSurface|
43 bool OnScreenSurfaceResize(const SkISize& size) override;
44
45 // |AndroidSurface|
47
48 // |GPUSurfaceSoftwareDelegate|
50
51 // |GPUSurfaceSoftwareDelegate|
52 bool PresentBackingStore(sk_sp<SkSurface> backing_store) override;
53
54 private:
55 sk_sp<SkSurface> sk_surface_;
57 SkColorType target_color_type_;
58 SkAlphaType target_alpha_type_;
59
60 FML_DISALLOW_COPY_AND_ASSIGN(AndroidSurfaceSoftware);
61};
62
63} // namespace flutter
64
65#endif // FLUTTER_SHELL_PLATFORM_ANDROID_ANDROID_SURFACE_SOFTWARE_H_
SkAlphaType
Definition: SkAlphaType.h:26
SkColorType
Definition: SkColorType.h:19
bool PresentBackingStore(sk_sp< SkSurface > backing_store) override
Called by the platform when a frame has been rendered into the backing store and the platform must di...
sk_sp< SkSurface > AcquireBackingStore(const SkISize &size) override
Called when the GPU surface needs a new buffer to render a new frame into.
bool OnScreenSurfaceResize(const SkISize &size) override
bool SetNativeWindow(fml::RefPtr< AndroidNativeWindow > window) override
std::unique_ptr< Surface > CreateGPUSurface(GrDirectContext *gr_context) override
Interface implemented by all platform surfaces that can present a software backing store to the "scre...
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