Flutter Engine
The Flutter Engine
Enumerations | Functions | Variables
SkPicture.cpp File Reference
#include "include/core/SkPicture.h"
#include "include/core/SkData.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkSerialProcs.h"
#include "include/core/SkStream.h"
#include "include/private/base/SkTFitsIn.h"
#include "include/private/base/SkTo.h"
#include "src/base/SkMathPriv.h"
#include "src/core/SkCanvasPriv.h"
#include "src/core/SkPictureData.h"
#include "src/core/SkPicturePlayback.h"
#include "src/core/SkPicturePriv.h"
#include "src/core/SkPictureRecord.h"
#include "src/core/SkReadBuffer.h"
#include "src/core/SkResourceCache.h"
#include "src/core/SkStreamPriv.h"
#include "src/core/SkWriteBuffer.h"
#include <atomic>
#include <cstring>
#include <memory>

Go to the source code of this file.

Enumerations

enum  { kFailure_TrailingStreamByteAfterPictInfo = 0 , kPictureData_TrailingStreamByteAfterPictInfo = 1 , kCustom_TrailingStreamByteAfterPictInfo = 2 }
 

Functions

bool SkPicture_StreamIsSKP (SkStream *stream, SkPictInfo *pInfo)
 
static sk_sp< SkDatacustom_serialize (const SkPicture *picture, const SkSerialProcs &procs)
 
static bool write_pad32 (SkWStream *stream, const void *data, size_t size)
 

Variables

static const char kMagic [] = { 's', 'k', 'i', 'a', 'p', 'i', 'c', 't' }
 
static const int kNestedSKPLimit = 100
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kFailure_TrailingStreamByteAfterPictInfo 
kPictureData_TrailingStreamByteAfterPictInfo 
kCustom_TrailingStreamByteAfterPictInfo 

Definition at line 37 of file SkPicture.cpp.

37 {
38 kFailure_TrailingStreamByteAfterPictInfo = 0, // nothing follows
39 kPictureData_TrailingStreamByteAfterPictInfo = 1, // SkPictureData follows
40 kCustom_TrailingStreamByteAfterPictInfo = 2, // -size32 follows
41};
@ kCustom_TrailingStreamByteAfterPictInfo
Definition: SkPicture.cpp:40
@ kFailure_TrailingStreamByteAfterPictInfo
Definition: SkPicture.cpp:38
@ kPictureData_TrailingStreamByteAfterPictInfo
Definition: SkPicture.cpp:39

Function Documentation

◆ custom_serialize()

static sk_sp< SkData > custom_serialize ( const SkPicture picture,
const SkSerialProcs procs 
)
static

Definition at line 255 of file SkPicture.cpp.

255 {
256 if (procs.fPictureProc) {
257 auto data = procs.fPictureProc(const_cast<SkPicture*>(picture), procs.fPictureCtx);
258 if (data) {
259 size_t size = data->size();
260 if (!SkTFitsIn<int32_t>(size) || size <= 1) {
261 return SkData::MakeEmpty();
262 }
263 return data;
264 }
265 }
266 return nullptr;
267}
static sk_sp< SkData > MakeEmpty()
Definition: SkData.cpp:94
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299
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
void * fPictureCtx
Definition: SkSerialProcs.h:88
SkSerialPictureProc fPictureProc
Definition: SkSerialProcs.h:87
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ SkPicture_StreamIsSKP()

bool SkPicture_StreamIsSKP ( SkStream stream,
SkPictInfo pInfo 
)

Definition at line 109 of file SkPicture.cpp.

109 {
110 return SkPicture::StreamIsSKP(stream, pInfo);
111}

◆ write_pad32()

static bool write_pad32 ( SkWStream stream,
const void *  data,
size_t  size 
)
static

Definition at line 269 of file SkPicture.cpp.

269 {
270 if (!stream->write(data, size)) {
271 return false;
272 }
273 if (size & 3) {
274 uint32_t zero = 0;
275 return stream->write(&zero, 4 - (size & 3));
276 }
277 return true;
278}

Variable Documentation

◆ kMagic

const char kMagic[] = { 's', 'k', 'i', 'a', 'p', 'i', 'c', 't' }
static

Definition at line 58 of file SkPicture.cpp.

◆ kNestedSKPLimit

const int kNestedSKPLimit = 100
static

Definition at line 145 of file SkPicture.cpp.