Flutter Engine
 
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) override
 
sk_sp< DlImageMakeRasterSnapshotSync (sk_sp< DisplayList > display_list, DlISize size) 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 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 DlISize image_size = ToDlISize(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}
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 
)
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, DlISize size) override
FlutterDesktopBinaryReply callback

References callback, and MakeRasterSnapshotSync().

◆ MakeRasterSnapshotSync()

sk_sp< DlImage > flutter::SnapshotControllerSkia::MakeRasterSnapshotSync ( sk_sp< DisplayList display_list,
DlISize  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 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 175 of file snapshot_controller_skia.cc.

175 {
177 return false;
178}
#define FML_UNREACHABLE()
Definition logging.h:128

References FML_UNREACHABLE.


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