#include <android_surface_software.h>
Definition at line 19 of file android_surface_software.h.
◆ AndroidSurfaceSoftware()
flutter::AndroidSurfaceSoftware::AndroidSurfaceSoftware |
( |
| ) |
|
Definition at line 43 of file android_surface_software.cc.
43 {
44 GetSkColorType(WINDOW_FORMAT_RGBA_8888, &target_color_type_,
45 &target_alpha_type_);
46}
◆ ~AndroidSurfaceSoftware()
flutter::AndroidSurfaceSoftware::~AndroidSurfaceSoftware |
( |
| ) |
|
|
overridedefault |
◆ AcquireBackingStore()
Called when the GPU surface needs a new buffer to render a new frame into.
- Parameters
-
[in] | size | The size of the frame. |
- Returns
- A raster surface returned by the platform.
Implements flutter::GPUSurfaceSoftwareDelegate.
Definition at line 81 of file android_surface_software.cc.
82 {
83 TRACE_EVENT0(
"flutter",
"AndroidSurfaceSoftware::AcquireBackingStore");
85 return nullptr;
86 }
87
88 if (sk_surface_ != nullptr &&
90
91 return sk_surface_;
92 }
93
97
99
100 return sk_surface_;
101}
static sk_sp< SkColorSpace > MakeSRGB()
bool IsValid() const override
SK_API sk_sp< SkSurface > Raster(const SkImageInfo &imageInfo, size_t rowBytes, const SkSurfaceProps *surfaceProps)
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
static constexpr SkISize Make(int32_t w, int32_t h)
static SkImageInfo Make(int width, int height, SkColorType ct, SkAlphaType at)
#define TRACE_EVENT0(category_group, name)
◆ CreateGPUSurface()
◆ IsValid()
bool flutter::AndroidSurfaceSoftware::IsValid |
( |
| ) |
const |
|
overridevirtual |
◆ OnScreenSurfaceResize()
bool flutter::AndroidSurfaceSoftware::OnScreenSurfaceResize |
( |
const SkISize & |
size | ) |
|
|
overridevirtual |
◆ PresentBackingStore()
bool flutter::AndroidSurfaceSoftware::PresentBackingStore |
( |
sk_sp< SkSurface > |
backing_store | ) |
|
|
overridevirtual |
Called by the platform when a frame has been rendered into the backing store and the platform must display it on-screen.
- Parameters
-
[in] | backing_store | The software backing store to present. |
- Returns
- Returns if the platform could present the backing store onto the screen.
Implements flutter::GPUSurfaceSoftwareDelegate.
Definition at line 103 of file android_surface_software.cc.
104 {
105 TRACE_EVENT0(
"flutter",
"AndroidSurfaceSoftware::PresentBackingStore");
106 if (!
IsValid() || backing_store ==
nullptr) {
107 return false;
108 }
109
112 return false;
113 }
114
115 ANativeWindow_Buffer native_buffer;
116 if (ANativeWindow_lock(native_window_->handle(), &native_buffer, nullptr)) {
117 return false;
118 }
119
125
127 native_image_info, native_buffer.bits,
129
130 if (canvas) {
132 if (
bitmap.installPixels(pixmap)) {
133 canvas->drawImageRect(
137 }
138 }
139 }
140
141 ANativeWindow_unlockAndPost(native_window_->handle());
142
143 return true;
144}
SK_API int SkColorTypeBytesPerPixel(SkColorType ct)
static std::unique_ptr< SkCanvas > MakeRasterDirect(const SkImageInfo &info, void *pixels, size_t rowBytes, const SkSurfaceProps *props=nullptr)
bool peekPixels(SkPixmap *pixmap)
static SkRect MakeIWH(int w, int h)
◆ ResourceContextClearCurrent()
bool flutter::AndroidSurfaceSoftware::ResourceContextClearCurrent |
( |
| ) |
|
|
overridevirtual |
◆ ResourceContextMakeCurrent()
bool flutter::AndroidSurfaceSoftware::ResourceContextMakeCurrent |
( |
| ) |
|
|
overridevirtual |
◆ SetNativeWindow()
Implements flutter::AndroidSurface.
Definition at line 152 of file android_surface_software.cc.
153 {
154 native_window_ = std::move(
window);
155 if (!(native_window_ && native_window_->IsValid())) {
156 return false;
157 }
158 int32_t window_format = ANativeWindow_getFormat(native_window_->handle());
159 if (window_format < 0) {
160 return false;
161 }
162 if (!GetSkColorType(window_format, &target_color_type_,
163 &target_alpha_type_)) {
164 return false;
165 }
166 return true;
167}
◆ TeardownOnScreenContext()
void flutter::AndroidSurfaceSoftware::TeardownOnScreenContext |
( |
| ) |
|
|
overridevirtual |
The documentation for this class was generated from the following files: