Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
flutter::SnapshotControllerSkia Class Reference

#include <snapshot_controller_skia.h>

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

Public Member Functions

 SnapshotControllerSkia (const SnapshotController::Delegate &delegate)
 
sk_sp< DlImageMakeRasterSnapshot (sk_sp< DisplayList > display_list, SkISize size) override
 
virtual sk_sp< SkImageConvertToRasterImage (sk_sp< SkImage > image) override
 
void CacheRuntimeStage (const std::shared_ptr< impeller::RuntimeStage > &runtime_stage) 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 13 of file snapshot_controller_skia.h.

Constructor & Destructor Documentation

◆ SnapshotControllerSkia()

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

Definition at line 15 of file snapshot_controller_skia.h.

16 : 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 163 of file snapshot_controller_skia.cc.

164 {}

◆ ConvertToRasterImage()

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

Implements flutter::SnapshotController.

Definition at line 140 of file snapshot_controller_skia.cc.

141 {
142 // If the rasterizer does not have a surface with a GrContext, then it will
143 // be unable to render a cross-context SkImage. The caller will need to
144 // create the raster image on the IO thread.
145 if (GetDelegate().GetSurface() == nullptr ||
146 GetDelegate().GetSurface()->GetContext() == nullptr) {
147 return nullptr;
148 }
149
150 if (image == nullptr) {
151 return nullptr;
152 }
153
154 SkISize image_size = image->dimensions();
155
156 auto result = DoMakeRasterSnapshot(
157 image_size, [image = std::move(image)](SkCanvas* canvas) {
158 canvas->drawImage(image, 0, 0);
159 });
160 return result->skia_image();
161}
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition SkCanvas.h:1528
SkISize dimensions() const
Definition SkImage.h:297
sk_sp< SkImage > image
Definition examples.cpp:29
GAsyncResult * result
SK_API GrDirectContext * GetContext(const SkImage *src)

◆ MakeRasterSnapshot()

sk_sp< DlImage > flutter::SnapshotControllerSkia::MakeRasterSnapshot ( sk_sp< DisplayList display_list,
SkISize  size 
)
overridevirtual

Implements flutter::SnapshotController.

Definition at line 132 of file snapshot_controller_skia.cc.

134 {
135 return DoMakeRasterSnapshot(size, [display_list](SkCanvas* canvas) {
136 DlSkCanvasAdapter(canvas).DrawDisplayList(display_list);
137 });
138}
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

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