39#define HEAP_BLOCK_SIZE 4096
70 size_t initialOffset = this->addDraw(
SAVE, &
size);
97 size +=
sizeof(*subset);
103 this->addRect(*subset);
113 uint32_t flatFlags = 0;
122 size +=
sizeof(uint32_t);
126 size +=
sizeof(uint32_t);
130 size +=
sizeof(uint32_t);
138 size +=
sizeof(uint32_t);
139 size +=
sizeof(uint32_t) * filterCount;
143 this->addInt(flatFlags);
148 this->addPaintPtr(rec.
fPaint);
154 this->addPaint(
paint);
163 this->addInt(filterCount);
164 for (uint32_t
i = 0;
i < filterCount; ++
i) {
168 this->addPaint(
paint);
193 SkASSERT(fRestoreOffsetStack.count() > 1);
197 if (fRestoreOffsetStack.
empty()) {
210 this->fillRestoreOffsetPlaceholdersForCurrentStackLevel((uint32_t)fWriter.
bytesWritten());
213 size_t initialOffset = this->addDraw(
RESTORE, &
size);
223 this->addScalar(
m.getTranslateX());
224 this->addScalar(
m.getTranslateY());
233 size_t initialOffset = this->addDraw(
SCALE, &
size);
234 this->addScalar(
m.getScaleX());
235 this->addScalar(
m.getScaleY());
254 size_t initialOffset = this->addDraw(
SET_M44, &
size);
272 size_t initialOffset = this->addDraw(
CONCAT, &
size);
277void SkPictureRecord::fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffset) {
300 fInitialSaveCount = this->
save();
308size_t SkPictureRecord::recordRestoreOffsetPlaceholder() {
309 if (fRestoreOffsetStack.
empty()) {
318 int32_t prevOffset = fRestoreOffsetStack.
back();
321 this->addInt(prevOffset);
335 if (!fRestoreOffsetStack.
empty()) {
342 size_t offset = this->recordRestoreOffsetPlaceholder();
357 if (!fRestoreOffsetStack.
empty()) {
362 this->addRRect(
rrect);
364 size_t offset = recordRestoreOffsetPlaceholder();
379 if (!fRestoreOffsetStack.
empty()) {
384 this->addInt(pathID);
386 size_t offset = recordRestoreOffsetPlaceholder();
400 this->addPaint(
paint);
401 this->addInt((
int)op);
416 if (!fRestoreOffsetStack.
empty()) {
423 size_t offset = this->recordRestoreOffsetPlaceholder();
430 if (!fRestoreOffsetStack.
empty()) {
434 this->fillRestoreOffsetPlaceholdersForCurrentStackLevel(0);
446 this->addPaint(
paint);
455 this->addPaint(
paint);
464 this->addPaint(
paint);
476 this->addPaint(
paint);
487 this->addPaint(
paint);
491 this->addInt(useCenter);
499 this->addPaint(
paint);
509 this->addPaint(
paint);
518 this->addPaint(
paint);
519 this->addRRect(
rrect);
528 this->addPaint(
paint);
529 this->addRRect(outer);
530 this->addRRect(inner);
538 this->addPaint(
paint);
548 this->addPaintPtr(
paint);
549 this->addImage(
image);
564 this->addPaintPtr(
paint);
565 this->addImage(
image);
569 this->addInt(constraint);
580 this->addPaintPtr(
paint);
581 this->addImage(
image);
584 this->addInt(
static_cast<uint32_t
>(filter));
595 this->addPaint(
paint);
596 this->addTextBlob(blob);
608 this->addPaint(
paint);
617 size_t initialOffset;
626 this->addPaintPtr(
paint);
636 size_t initialOffset;
640 this->addDrawable(drawable);
645 this->addDrawable(drawable);
656 this->addPaint(
paint);
657 this->addVertices(vertices);
659 this->addInt(
static_cast<uint32_t
>(
mode));
684 this->addPaint(
paint);
685 this->addPatch(cubics);
696 this->addInt((
int)bmode);
712 size +=
sizeof(uint32_t);
721 this->addPaintPtr(
paint);
722 this->addImage(
atlas);
731 this->addInt((
int)
mode);
760 size_t size = 4 +
sizeof(
SkRect) + keyLen + valueLen;
778 this->addInt((
int) aa);
780 this->addInt((
int)
mode);
781 this->addInt(
clip !=
nullptr);
783 this->addPoints(
clip, 4);
794 static constexpr size_t kMatrixSize = 9 *
sizeof(
SkScalar);
797 int totalDstClipCount, totalMatrixCount;
801 kMatrixSize * totalMatrixCount +
806 this->addPaintPtr(
paint);
808 this->addInt((
int) constraint);
810 this->addImage(
set[
i].fImage.get());
811 this->addRect(
set[
i].fSrcRect);
812 this->addRect(
set[
i].fDstRect);
813 this->addInt(
set[
i].fMatrixIndex);
814 this->addScalar(
set[
i].fAlpha);
815 this->addInt((
int)
set[
i].fAAFlags);
816 this->addInt(
set[
i].fHasClip);
818 this->addInt(totalDstClipCount);
819 this->addPoints(
dstClips, totalDstClipCount);
820 this->addInt(totalMatrixCount);
821 for (
int i = 0;
i < totalMatrixCount; ++
i) {
832static bool equals(
T*
a,
T*
b) {
return a->uniqueID() ==
b->uniqueID(); }
842 for (
int i = 0;
i < array.size();
i++) {
850 return array.size() - 1;
866void SkPictureRecord::addPaintPtr(
const SkPaint*
paint) {
869 this->addInt(fPaints.
size());
879 int n = fPaths.
count() + 1;
884void SkPictureRecord::addPath(
const SkPath&
path) {
888void SkPictureRecord::addPatch(
const SkPoint cubics[12]) {
897void SkPictureRecord::addDrawable(
SkDrawable* drawable) {
902void SkPictureRecord::addPoint(
const SkPoint& point) {
906void SkPictureRecord::addPoints(
const SkPoint pts[],
int count) {
915void SkPictureRecord::addRect(
const SkRect&
rect) {
919void SkPictureRecord::addRectPtr(
const SkRect*
rect) {
925void SkPictureRecord::addIRect(
const SkIRect&
rect) {
929void SkPictureRecord::addIRectPtr(
const SkIRect*
rect) {
947void SkPictureRecord::addText(
const void*
text,
size_t byteLength) {
952void SkPictureRecord::addTextBlob(
const SkTextBlob* blob) {
962void SkPictureRecord::addVertices(
const SkVertices* vertices) {
static void info(const char *fmt,...) SK_PRINTF_LIKE(1
SkRGBA4f< kUnpremul_SkAlphaType > SkColor4f
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
@ DRAW_PICTURE_MATRIX_PAINT
@ SAVE_LAYER_SAVELAYERREC
static uint32_t ClipParams_pack(SkClipOp op, bool doAA)
@ SAVELAYERREC_HAS_BACKDROP_SCALE
@ SAVELAYERREC_HAS_MULTIPLE_FILTERS
@ SAVELAYERREC_HAS_BACKDROP
@ SAVELAYERREC_HAS_BOUNDS
@ DRAW_VERTICES_HAS_COLORS
@ DRAW_ATLAS_HAS_SAMPLING
static int find_or_append(TArray< sk_sp< T > > &array, T *obj)
static int const kUInt32Size
static bool equals(T *a, T *b)
#define UNPACK_8_24(combined, small, large)
sk_sp< T > sk_ref_sp(T *obj)
constexpr int SkToInt(S x)
constexpr uint32_t SkToU32(S x)
static void WriteLattice(SkWriteBuffer &, const SkCanvas::Lattice &)
static SkScalar GetBackdropScaleFactor(const SkCanvas::SaveLayerRec &rec)
static void GetDstClipAndMatrixCounts(const SkCanvas::ImageSetEntry set[], int count, int *totalDstClipCount, int *totalMatrixCount)
@ kNoLayer_SaveLayerStrategy
void restoreToCount(int saveCount)
friend class SkPictureRecord
static SkM44 Translate(SkScalar x, SkScalar y, SkScalar z=0)
static SkM44 Scale(SkScalar x, SkScalar y, SkScalar z=1)
static size_t WriteToMemory(const SkMatrix &matrix, void *buffer)
static const SkScalar * M44ColMajor(const SkM44 &m)
static const SkMatrix & I()
@ kTranslate_Mask
translation SkMatrix
@ kScale_Mask
scale SkMatrix
void onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
void onDrawImage2(const SkImage *, SkScalar, SkScalar, const SkSamplingOptions &, const SkPaint *) override
void onDrawSlug(const sktext::gpu::Slug *slug, const SkPaint &paint) override
void onDrawDrawable(SkDrawable *, const SkMatrix *) override
void onDrawRect(const SkRect &, const SkPaint &) override
void onDrawArc(const SkRect &, SkScalar, SkScalar, bool, const SkPaint &) override
void onDrawBehind(const SkPaint &) override
void onClipRect(const SkRect &, SkClipOp, ClipEdgeStyle) override
void validate(size_t initialOffset, size_t size) const
void onClipRRect(const SkRRect &, SkClipOp, ClipEdgeStyle) override
void recordSaveLayer(const SaveLayerRec &)
void recordScale(const SkMatrix &matrix)
size_t recordClipRRect(const SkRRect &rrect, SkClipOp op, bool doAA)
int addPathToHeap(const SkPath &path)
void onDrawPaint(const SkPaint &) override
void onDrawPicture(const SkPicture *, const SkMatrix *, const SkPaint *) override
void recordRestore(bool fillInSkips=true)
void willRestore() override
void onDrawOval(const SkRect &, const SkPaint &) override
void onDrawAnnotation(const SkRect &, const char[], SkData *) override
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint &) override
void onDrawEdgeAAQuad(const SkRect &, const SkPoint[4], QuadAAFlags, const SkColor4f &, SkBlendMode) override
SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec &) override
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode, const SkPaint &paint) override
void didScale(SkScalar, SkScalar) override
void onDrawAtlas2(const SkImage *, const SkRSXform[], const SkRect[], const SkColor[], int, SkBlendMode, const SkSamplingOptions &, const SkRect *, const SkPaint *) override
bool onDoSaveBehind(const SkRect *) override
void onDrawVerticesObject(const SkVertices *, SkBlendMode, const SkPaint &) override
void onDrawRegion(const SkRegion &, const SkPaint &) override
void recordTranslate(const SkMatrix &matrix)
void onClipRegion(const SkRegion &, SkClipOp) override
void recordConcat(const SkMatrix &matrix)
void onDrawShadowRec(const SkPath &, const SkDrawShadowRec &) override
size_t recordClipPath(int pathID, SkClipOp op, bool doAA)
void onDrawPath(const SkPath &, const SkPaint &) override
void didConcat44(const SkM44 &) override
size_t recordClipRect(const SkRect &rect, SkClipOp op, bool doAA)
void onDrawRRect(const SkRRect &, const SkPaint &) override
void onResetClip() override
void onClipPath(const SkPath &, SkClipOp, ClipEdgeStyle) override
size_t recordClipRegion(const SkRegion ®ion, SkClipOp op)
void onDrawEdgeAAImageSet2(const ImageSetEntry[], int count, const SkPoint[], const SkMatrix[], const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
void onDrawDRRect(const SkRRect &, const SkRRect &, const SkPaint &) override
void onDrawImageRect2(const SkImage *, const SkRect &, const SkRect &, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
void onClipShader(sk_sp< SkShader >, SkClipOp) override
void didTranslate(SkScalar, SkScalar) override
sk_sp< SkSurface > onNewSurface(const SkImageInfo &, const SkSurfaceProps &) override
void didSetM44(const SkM44 &) override
void onDrawImageLattice2(const SkImage *, const Lattice &, const SkRect &, SkFilterMode, const SkPaint *) override
static constexpr size_t kSizeInMemory
size_t writeToMemory(void *buffer) const
static size_t FlatSize(const SkSamplingOptions &options)
constexpr size_t size() const
void push_back(const T &v)
void overwriteTAt(size_t offset, const T &value)
static size_t WriteDataSize(const SkData *data)
void write32(int32_t value)
void write(const void *values, size_t size)
void writeRRect(const SkRRect &rrect)
void writeSampling(const SkSamplingOptions &sampling)
uint32_t * reservePad(size_t size)
void writeRect(const SkRect &rect)
void writeScalar(SkScalar value)
void writeMatrix(const SkMatrix &matrix)
uint32_t * reserve(size_t size)
void writePoint(const SkPoint &pt)
void writeMul4(const void *values, size_t size)
void writePad(const void *src, size_t size)
void writeData(const SkData *data)
void writePoint3(const SkPoint3 &pt)
static size_t WriteStringSize(const char *str, size_t len=(size_t) -1)
bool writeBool(bool value)
const T & readTAt(size_t offset) const
void writeRegion(const SkRegion &rgn)
void writeString(const char *str, size_t len=(size_t) -1)
size_t bytesWritten() const
V * find(const K &key) const
FlutterSemanticsFlag flag
FlutterSemanticsFlag flags
sk_sp< const SkImage > atlas
unsigned useCenter Optional< SkMatrix > matrix
PODArray< SkPoint > dstClips
sk_sp< const SkImage > image
ClipOpAndAA opAA SkRegion region
sk_sp< const SkPicture > picture
sk_sp< SkBlender > blender SkRect rect
PODArray< SkMatrix > preViewMatrices
PODArray< SkColor > colors
SkSamplingOptions sampling
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
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 mode
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
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 set
const myers::Point & get(const myers::Segment &)
const SkImageFilter * fBackdrop
SaveLayerFlags fSaveLayerFlags
SkISize dimensions() const