Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | List of all members
sktext::gpu::Slug Class Referenceabstract

#include <Slug.h>

Inheritance diagram for sktext::gpu::Slug:
SkRefCnt SkRefCntBase sktext::gpu::SlugImpl

Public Member Functions

sk_sp< SkDataserialize () const
 
size_t serialize (void *buffer, size_t size) const
 
void draw (SkCanvas *canvas, const SkPaint &paint) const
 
virtual SkRect sourceBounds () const =0
 
virtual SkRect sourceBoundsWithOrigin () const =0
 
virtual void doFlatten (SkWriteBuffer &) const =0
 
uint32_t uniqueID () const
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Static Public Member Functions

static sk_sp< SlugConvertBlob (SkCanvas *canvas, const SkTextBlob &blob, SkPoint origin, const SkPaint &paint)
 
static sk_sp< SlugDeserialize (const void *data, size_t size, const SkStrikeClient *client=nullptr)
 
static sk_sp< SlugMakeFromBuffer (SkReadBuffer &buffer)
 
static void AddDeserialProcs (SkDeserialProcs *procs, const SkStrikeClient *client=nullptr)
 

Detailed Description

Definition at line 33 of file Slug.h.

Member Function Documentation

◆ AddDeserialProcs()

void sktext::gpu::Slug::AddDeserialProcs ( SkDeserialProcs procs,
const SkStrikeClient client = nullptr 
)
static

Definition at line 106 of file SlugImpl.cpp.

106 {
107 SkASSERT(procs);
108 procs->fSlugCtx = const_cast<SkStrikeClient*>(client);
109 procs->fSlugProc = [](SkReadBuffer& buffer, void* ctx) -> sk_sp<Slug> {
110 auto client = static_cast<const SkStrikeClient*>(ctx);
111 return SlugImpl::MakeFromBuffer(buffer, client);
112 };
113}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static sk_sp< Slug > MakeFromBuffer(SkReadBuffer &buffer, const SkStrikeClient *client)
Definition: SlugImpl.cpp:46
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace buffer
Definition: switches.h:126
SkSlugProc fSlugProc

◆ ConvertBlob()

sk_sp< Slug > sktext::gpu::Slug::ConvertBlob ( SkCanvas canvas,
const SkTextBlob blob,
SkPoint  origin,
const SkPaint paint 
)
static

Definition at line 20 of file Slug.cpp.

21 {
22 return canvas->convertBlobToSlug(blob, origin, paint);
23}
const Paint & paint
Definition: color_source.cc:38

◆ Deserialize()

sk_sp< Slug > sktext::gpu::Slug::Deserialize ( const void *  data,
size_t  size,
const SkStrikeClient client = nullptr 
)
static

Definition at line 42 of file Slug.cpp.

42 {
44 SkDeserialProcs procs;
45 Slug::AddDeserialProcs(&procs, client);
46 buffer.setDeserialProcs(procs);
47 return MakeFromBuffer(buffer);
48}
static void AddDeserialProcs(SkDeserialProcs *procs, const SkStrikeClient *client=nullptr)
Definition: SlugImpl.cpp:106
static sk_sp< Slug > MakeFromBuffer(SkReadBuffer &buffer)
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
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ doFlatten()

virtual void sktext::gpu::Slug::doFlatten ( SkWriteBuffer ) const
pure virtual

Implemented in sktext::gpu::SlugImpl.

◆ draw()

void sktext::gpu::Slug::draw ( SkCanvas canvas,
const SkPaint paint 
) const

Definition at line 50 of file Slug.cpp.

50 {
51 canvas->drawSlug(this, paint);
52}

◆ MakeFromBuffer()

sk_sp< Slug > sktext::gpu::Slug::MakeFromBuffer ( SkReadBuffer buffer)
static

Definition at line 22 of file SlugFromBuffer.cpp.

22 {
23 auto procs = buffer.getDeserialProcs();
24 if (procs.fSlugProc) {
25 return procs.fSlugProc(buffer, procs.fSlugCtx);
26 }
27 SkDEBUGFAIL("Should have set serial procs");
28 return nullptr;
29}
#define SkDEBUGFAIL(message)
Definition: SkAssert.h:118

◆ serialize() [1/2]

sk_sp< SkData > sktext::gpu::Slug::serialize ( ) const

Definition at line 25 of file Slug.cpp.

25 {
27 this->doFlatten(buffer);
28 return buffer.snapshotAsData();
29}
virtual void doFlatten(SkWriteBuffer &) const =0

◆ serialize() [2/2]

size_t sktext::gpu::Slug::serialize ( void *  buffer,
size_t  size 
) const

Definition at line 31 of file Slug.cpp.

31 {
32 SkBinaryWriteBuffer writeBuffer{buffer, size, {}};
33 this->doFlatten(writeBuffer);
34
35 // If we overflow the given buffer, then SkWriteBuffer allocates a new larger buffer. Check
36 // to see if an additional buffer was allocated, if it wasn't then everything fit, else
37 // return 0 signaling the buffer overflowed.
38 // N.B. This is the idiom from SkTextBlob.
39 return writeBuffer.usingInitialStorage() ? writeBuffer.bytesWritten() : 0u;
40}

◆ sourceBounds()

virtual SkRect sktext::gpu::Slug::sourceBounds ( ) const
pure virtual

Implemented in sktext::gpu::SlugImpl.

◆ sourceBoundsWithOrigin()

virtual SkRect sktext::gpu::Slug::sourceBoundsWithOrigin ( ) const
pure virtual

Implemented in sktext::gpu::SlugImpl.

◆ uniqueID()

uint32_t sktext::gpu::Slug::uniqueID ( ) const
inline

Definition at line 62 of file Slug.h.

62{ return fUniqueID; }

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