Flutter Engine
 
Loading...
Searching...
No Matches
flutter::OffscreenSurface Class Reference

#include <offscreen_surface.h>

Public Member Functions

 OffscreenSurface (GrDirectContext *surface_context, const DlISize &size)
 
 ~OffscreenSurface ()=default
 
sk_sp< SkData > GetRasterData (bool compressed) const
 
DlCanvasGetCanvas ()
 
bool IsValid () const
 

Detailed Description

Definition at line 22 of file offscreen_surface.h.

Constructor & Destructor Documentation

◆ OffscreenSurface()

flutter::OffscreenSurface::OffscreenSurface ( GrDirectContext *  surface_context,
const DlISize size 
)
explicit

Definition at line 71 of file offscreen_surface.cc.

72 {
73 offscreen_surface_ = CreateSnapshotSurface(surface_context, size);
74 if (offscreen_surface_) {
75 adapter_.set_canvas(offscreen_surface_->getCanvas());
76 }
77}
void set_canvas(SkCanvas *canvas)
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
static sk_sp< SkSurface > CreateSnapshotSurface(GrDirectContext *surface_context, const DlISize &size)

References flutter::CreateSnapshotSurface(), flutter::DlSkCanvasAdapter::set_canvas(), and flutter::size.

◆ ~OffscreenSurface()

flutter::OffscreenSurface::~OffscreenSurface ( )
default

Member Function Documentation

◆ GetCanvas()

DlCanvas * flutter::OffscreenSurface::GetCanvas ( )

Definition at line 83 of file offscreen_surface.cc.

83 {
84 return &adapter_;
85}

◆ GetRasterData()

sk_sp< SkData > flutter::OffscreenSurface::GetRasterData ( bool  compressed) const

Definition at line 79 of file offscreen_surface.cc.

79 {
80 return flutter::GetRasterData(offscreen_surface_, compressed);
81}
static sk_sp< SkData > GetRasterData(const sk_sp< SkSurface > &offscreen_surface, bool compressed)

References flutter::GetRasterData().

◆ IsValid()

bool flutter::OffscreenSurface::IsValid ( ) const

Definition at line 87 of file offscreen_surface.cc.

87 {
88 return offscreen_surface_ != nullptr;
89}

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