Flutter Engine
The Flutter Engine
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)
 
void MakeRasterSnapshot (sk_sp< DisplayList > display_list, SkISize picture_size, std::function< void(const sk_sp< DlImage > &)> callback) override
 
sk_sp< DlImageMakeRasterSnapshotSync (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
 
virtual void MakeRasterSnapshot (sk_sp< DisplayList > display_list, SkISize picture_size, std::function< void(const sk_sp< DlImage > &)> callback)=0
 
virtual sk_sp< DlImageMakeRasterSnapshotSync (sk_sp< DisplayList > display_list, SkISize picture_size)=0
 
virtual sk_sp< SkImageConvertToRasterImage (sk_sp< SkImage > image)=0
 
virtual void CacheRuntimeStage (const std::shared_ptr< impeller::RuntimeStage > &runtime_stage)=0
 

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 172 of file snapshot_controller_skia.cc.

173 {}

◆ ConvertToRasterImage()

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

Implements flutter::SnapshotController.

Definition at line 149 of file snapshot_controller_skia.cc.

150 {
151 // If the rasterizer does not have a surface with a GrContext, then it will
152 // be unable to render a cross-context SkImage. The caller will need to
153 // create the raster image on the IO thread.
154 if (GetDelegate().GetSurface() == nullptr ||
155 GetDelegate().GetSurface()->GetContext() == nullptr) {
156 return nullptr;
157 }
158
159 if (image == nullptr) {
160 return nullptr;
161 }
162
163 SkISize image_size = image->dimensions();
164
165 auto result = DoMakeRasterSnapshot(
166 image_size, [image = std::move(image)](SkCanvas* canvas) {
167 canvas->drawImage(image, 0, 0);
168 });
169 return result->skia_image();
170}
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
SkISize dimensions() const
Definition: SkImage.h:297
GAsyncResult * result
SK_API GrDirectContext * GetContext(const SkImage *src)
sk_sp< const SkImage > image
Definition: SkRecords.h:269
Definition: SkSize.h:16

◆ MakeRasterSnapshot()

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

Implements flutter::SnapshotController.

Definition at line 54 of file snapshot_controller_skia.cc.

57 {
58 callback(MakeRasterSnapshotSync(display_list, picture_size));
59}
sk_sp< DlImage > MakeRasterSnapshotSync(sk_sp< DisplayList > display_list, SkISize size) override
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback

◆ MakeRasterSnapshotSync()

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

Implements flutter::SnapshotController.

Definition at line 141 of file snapshot_controller_skia.cc.

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