Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
 
Loading...
Searching...
No Matches
flutter::SnapshotControllerSkia Class Reference

#include <snapshot_controller_skia.h>

Inheritance diagram for flutter::SnapshotControllerSkia:
flutter::SnapshotController

Public Member Functions

 SnapshotControllerSkia (const SnapshotController::Delegate &delegate)
 
void MakeSkiaSnapshot (sk_sp< DisplayList > display_list, DlISize picture_size, std::function< void(const sk_sp< SkImage > &)> callback, SnapshotPixelFormat pixel_format) override
 
sk_sp< SkImage > MakeSkiaSnapshotSync (sk_sp< DisplayList > display_list, DlISize size, SnapshotPixelFormat pixel_format) override
 
void MakeImpellerSnapshot (sk_sp< DisplayList > display_list, DlISize picture_size, std::function< void(const std::shared_ptr< impeller::Texture > &)> callback, SnapshotPixelFormat pixel_format) override
 
std::shared_ptr< impeller::TextureMakeImpellerSnapshotSync (sk_sp< DisplayList > display_list, DlISize size, SnapshotPixelFormat pixel_format) override
 
sk_sp< SkImage > MakeSkiaTextureImage (sk_sp< SkImage > image, SnapshotPixelFormat pixel_format) override
 
std::shared_ptr< impeller::TextureMakeImpellerTextureImage (sk_sp< SkImage > image, SnapshotPixelFormat pixel_format) override
 
virtual sk_sp< SkImage > ConvertToRasterImage (sk_sp< SkImage > image) override
 
void CacheRuntimeStage (const std::shared_ptr< impeller::RuntimeStage > &runtime_stage) override
 
bool MakeRenderContextCurrent () override
 
- Public Member Functions inherited from flutter::SnapshotController
virtual ~SnapshotController ()=default
 

Additional Inherited Members

- Static Public Member Functions inherited from flutter::SnapshotController
static std::unique_ptr< SnapshotControllerMake (const Delegate &delegate, const Settings &settings)
 
- Protected Member Functions inherited from flutter::SnapshotController
 SnapshotController (const Delegate &delegate)
 
const DelegateGetDelegate ()
 

Detailed Description

Definition at line 15 of file snapshot_controller_skia.h.

Constructor & Destructor Documentation

◆ SnapshotControllerSkia()

flutter::SnapshotControllerSkia::SnapshotControllerSkia ( const SnapshotController::Delegate delegate)
inlineexplicit

Definition at line 17 of file snapshot_controller_skia.h.

18 : SnapshotController(delegate) {}
SnapshotController(const Delegate &delegate)

Member Function Documentation

◆ CacheRuntimeStage()

void flutter::SnapshotControllerSkia::CacheRuntimeStage ( const std::shared_ptr< impeller::RuntimeStage > &  runtime_stage)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 205 of file snapshot_controller_skia.cc.

206 {}

◆ ConvertToRasterImage()

sk_sp< SkImage > flutter::SnapshotControllerSkia::ConvertToRasterImage ( sk_sp< SkImage >  image)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 182 of file snapshot_controller_skia.cc.

183 {
184 // If the rasterizer does not have a surface with a GrContext, then it will
185 // be unable to render a cross-context SkImage. The caller will need to
186 // create the raster image on the IO thread.
187 if (GetDelegate().GetSurface() == nullptr ||
188 GetDelegate().GetSurface()->GetContext() == nullptr) {
189 return nullptr;
190 }
191
192 if (image == nullptr) {
193 return nullptr;
194 }
195
196 DlISize image_size = ToDlISize(image->dimensions());
197
198 auto result = DoMakeRasterSnapshot(
199 image_size, [image = std::move(image)](SkCanvas* canvas) {
200 canvas->drawImage(image, 0, 0);
201 });
202 return result;
203}
FlutterVulkanImage * image
const DlISize & ToDlISize(const SkISize &size)
impeller::ISize32 DlISize

References flutter::SnapshotController::GetDelegate(), image, and flutter::ToDlISize().

◆ MakeImpellerSnapshot()

void flutter::SnapshotControllerSkia::MakeImpellerSnapshot ( sk_sp< DisplayList display_list,
DlISize  picture_size,
std::function< void(const std::shared_ptr< impeller::Texture > &)>  callback,
SnapshotPixelFormat  pixel_format 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 73 of file snapshot_controller_skia.cc.

77 {
79}
#define FML_UNREACHABLE()
Definition logging.h:128

References FML_UNREACHABLE.

◆ MakeImpellerSnapshotSync()

std::shared_ptr< impeller::Texture > flutter::SnapshotControllerSkia::MakeImpellerSnapshotSync ( sk_sp< DisplayList display_list,
DlISize  size,
SnapshotPixelFormat  pixel_format 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 82 of file snapshot_controller_skia.cc.

85 {
87}

References FML_UNREACHABLE.

◆ MakeImpellerTextureImage()

std::shared_ptr< impeller::Texture > flutter::SnapshotControllerSkia::MakeImpellerTextureImage ( sk_sp< SkImage >  image,
SnapshotPixelFormat  pixel_format 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 176 of file snapshot_controller_skia.cc.

178 {
179 return nullptr;
180}

◆ MakeRenderContextCurrent()

bool flutter::SnapshotControllerSkia::MakeRenderContextCurrent ( )
overridevirtual

Implements flutter::SnapshotController.

Definition at line 208 of file snapshot_controller_skia.cc.

208 {
210}

References FML_UNREACHABLE.

◆ MakeSkiaSnapshot()

void flutter::SnapshotControllerSkia::MakeSkiaSnapshot ( sk_sp< DisplayList display_list,
DlISize  picture_size,
std::function< void(const sk_sp< SkImage > &)>  callback,
SnapshotPixelFormat  pixel_format 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 54 of file snapshot_controller_skia.cc.

58 {
59 callback(MakeSkiaSnapshotSync(display_list, picture_size, pixel_format));
60}
sk_sp< SkImage > MakeSkiaSnapshotSync(sk_sp< DisplayList > display_list, DlISize size, SnapshotPixelFormat pixel_format) override
FlutterDesktopBinaryReply callback

References callback, and MakeSkiaSnapshotSync().

◆ MakeSkiaSnapshotSync()

sk_sp< SkImage > flutter::SnapshotControllerSkia::MakeSkiaSnapshotSync ( sk_sp< DisplayList display_list,
DlISize  size,
SnapshotPixelFormat  pixel_format 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 62 of file snapshot_controller_skia.cc.

65 {
66 auto draw_callback = [&display_list](SkCanvas* canvas) {
67 DlSkCanvasAdapter adapter(canvas);
68 adapter.DrawDisplayList(display_list);
69 };
70 return DoMakeRasterSnapshot(size, draw_callback);
71}
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

References flutter::DlSkCanvasAdapter::DrawDisplayList(), and flutter::size.

Referenced by MakeSkiaSnapshot().

◆ MakeSkiaTextureImage()

sk_sp< SkImage > flutter::SnapshotControllerSkia::MakeSkiaTextureImage ( sk_sp< SkImage >  image,
SnapshotPixelFormat  pixel_format 
)
overridevirtual

Creates a texture-backed DlImage from the provided SkImage.

This is primarily used by decodeImageFromPixelsSync to upload pixels to the GPU synchronously.

Implements flutter::SnapshotController.

Definition at line 169 of file snapshot_controller_skia.cc.

171 {
172 return image;
173}

References image.


The documentation for this class was generated from the following files: