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 MakeRasterSnapshot (sk_sp< DisplayList > display_list, DlISize picture_size, std::function< void(const sk_sp< DlImage > &)> callback, SnapshotPixelFormat pixel_format) override
 
sk_sp< DlImageMakeRasterSnapshotSync (sk_sp< DisplayList > display_list, DlISize size, SnapshotPixelFormat pixel_format) override
 
sk_sp< DlImageMakeTextureImage (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 180 of file snapshot_controller_skia.cc.

181 {}

◆ ConvertToRasterImage()

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

Implements flutter::SnapshotController.

Definition at line 157 of file snapshot_controller_skia.cc.

158 {
159 // If the rasterizer does not have a surface with a GrContext, then it will
160 // be unable to render a cross-context SkImage. The caller will need to
161 // create the raster image on the IO thread.
162 if (GetDelegate().GetSurface() == nullptr ||
163 GetDelegate().GetSurface()->GetContext() == nullptr) {
164 return nullptr;
165 }
166
167 if (image == nullptr) {
168 return nullptr;
169 }
170
171 DlISize image_size = ToDlISize(image->dimensions());
172
173 auto result = DoMakeRasterSnapshot(
174 image_size, [image = std::move(image)](SkCanvas* canvas) {
175 canvas->drawImage(image, 0, 0);
176 });
177 return result->skia_image();
178}
FlutterVulkanImage * image
const DlISize & ToDlISize(const SkISize &size)
impeller::ISize32 DlISize

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

◆ MakeRasterSnapshot()

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

Implements flutter::SnapshotController.

Definition at line 54 of file snapshot_controller_skia.cc.

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

References callback, and MakeRasterSnapshotSync().

◆ MakeRasterSnapshotSync()

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

Implements flutter::SnapshotController.

Definition at line 142 of file snapshot_controller_skia.cc.

145 {
146 return DoMakeRasterSnapshot(size, [display_list](SkCanvas* canvas) {
147 DlSkCanvasAdapter(canvas).DrawDisplayList(display_list);
148 });
149}
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 MakeRasterSnapshot().

◆ MakeRenderContextCurrent()

bool flutter::SnapshotControllerSkia::MakeRenderContextCurrent ( )
overridevirtual

Implements flutter::SnapshotController.

Definition at line 183 of file snapshot_controller_skia.cc.

183 {
185 return false;
186}
#define FML_UNREACHABLE()
Definition logging.h:128

References FML_UNREACHABLE.

◆ MakeTextureImage()

sk_sp< DlImage > flutter::SnapshotControllerSkia::MakeTextureImage ( 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 151 of file snapshot_controller_skia.cc.

153 {
154 return DlImage::Make(image);
155}
static sk_sp< DlImage > Make(const SkImage *image)
Definition dl_image.cc:11

References image, and flutter::DlImage::Make().


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