47namespace sktext {
namespace gpu {
class Slug; } }
63 AutoResetOpID aroi(
this);
80 fCurOffset = reader.
offset();
83 uint32_t op =
bits >> 24,
85 if (
size == 0xffffff) {
93 this->handleOp(&reader, (
DrawType)op,
size, canvas, initialMatrix);
103 if (offsetToRestore) {
114 *clipOpToUse =
static_cast<SkClipOp>(op);
133 const SkM44& initialMatrix) {
134#define BREAK_ON_READ_ERROR(r) if (!r->isValid()) break
145 uint32_t packed = reader->
readInt();
148 size_t offsetToRestore = reader->
readInt();
153 if (
do_clip_op(reader, canvas, rgnOp, &clipOp)) {
157 reader->
skip(offsetToRestore - reader->
offset());
163 uint32_t packed = reader->
readInt();
165 size_t offsetToRestore = reader->
readInt();
170 if (
do_clip_op(reader, canvas, rgnOp, &clipOp)) {
174 reader->
skip(offsetToRestore - reader->
offset());
180 uint32_t packed = reader->
readInt();
183 size_t offsetToRestore = reader->
readInt();
188 if (
do_clip_op(reader, canvas, rgnOp, &clipOp)) {
192 reader->
skip(offsetToRestore - reader->
offset());
198 uint32_t packed = reader->
readInt();
201 size_t offsetToRestore = reader->
readInt();
206 if (
do_clip_op(reader, canvas, rgnOp, &clipOp)) {
210 reader->
skip(offsetToRestore - reader->
offset());
261 int useCenter = reader->
readInt();
280 const SkRect* cull =
nullptr;
336 bool hasClip = reader->
readInt();
346 static const size_t kEntryReadSize =
348 static const size_t kMatrixSize = 9 *
sizeof(
SkScalar);
373 int expectedClipPointCount = 0;
374 int maxMatrixIndex = -1;
376 for (
int i = 0;
i < cnt && reader->
isValid(); ++
i) {
385 expectedClipPointCount +=
set[
i].fHasClip ? 4 : 0;
386 if (
set[
i].fMatrixIndex > maxMatrixIndex) {
387 maxMatrixIndex =
set[
i].fMatrixIndex;
391 int dstClipPointCount = reader->
readInt();
393 if (!reader->
validate(dstClipPointCount >= 0) ||
394 !reader->
validate(expectedClipPointCount == dstClipPointCount)) {
399 }
else if (dstClipPointCount > 0) {
406 int matrixCount = reader->
readInt();
407 if (!reader->
validate(matrixCount >= 0) ||
408 !reader->
validate(maxMatrixIndex == (matrixCount - 1)) ||
416 for (
int i = 0;
i < matrixCount && reader->
isValid(); ++
i) {
541 const SkPoint* texCoords =
nullptr;
565 const auto* pic = fPictureData->
getPicture(reader);
640 canvas->drawSlug(slug,
paint);
645 const int boneCount = reader->
readInt();
666 const SkRect* subset =
nullptr;
676 const uint32_t flatFlags = reader->
readInt();
688 rec.fBackdrop =
paint.getImageFilter();
691 rec.fSaveLayerFlags = reader->
readInt();
694 (void)fPictureData->
getImage(reader);
700 if (!reader->
isVersionLT(SkPicturePriv::Version::kBackdropScaleFactor) &&
704 if (!reader->
isVersionLT(SkPicturePriv::Version::kMultipleFiltersOnSaveLayer) &&
706 int filterCount = reader->
readUInt();
709 filters.
reset(filterCount);
710 for (
int i = 0;
i < filterCount; ++
i) {
712 filters[
i] =
paint.refImageFilter();
714 rec.fFilters = filters;
723 canvas->
scale(sx, sy);
738 canvas->
skew(sx, sy);
750#undef BREAK_ON_READ_ERROR
static constexpr bool SkIsAlign4(T x)
@ kLastMode
last valid value
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
static SkRegion::Op ClipParams_unpackRegionOp(SkReadBuffer *buffer, uint32_t packed)
@ DRAW_PICTURE_MATRIX_PAINT
@ SAVE_LAYER_SAVELAYERREC
static bool ClipParams_unpackDoAA(uint32_t packed)
@ SAVELAYERREC_HAS_BACKDROP_SCALE
@ SAVELAYERREC_HAS_MULTIPLE_FILTERS
@ SAVELAYERREC_HAS_CLIPMASK_OBSOLETE
@ SAVELAYERREC_HAS_CLIPMATRIX_OBSOLETE
@ SAVELAYERREC_HAS_BACKDROP
@ SAVELAYERREC_HAS_BOUNDS
@ DRAW_VERTICES_HAS_COLORS
@ DRAW_ATLAS_HAS_SAMPLING
static void validate_offsetToRestore(SkReadBuffer *reader, size_t offsetToRestore)
#define BREAK_ON_READ_ERROR(r)
static const SkRect * get_rect_ptr(SkReadBuffer *reader, SkRect *storage)
static bool do_clip_op(SkReadBuffer *reader, SkCanvas *canvas, SkRegion::Op op, SkClipOp *clipOpToUse)
sk_sp< T > sk_ref_sp(T *obj)
static constexpr bool SkToBool(const T &x)
static SkScalar center(float pos0, float pos1)
static void ResetClip(SkCanvas *canvas)
static void DrawBehind(SkCanvas *canvas, const SkPaint &paint)
static void SetBackdropScaleFactor(SkCanvas::SaveLayerRec *rec, SkScalar scale)
static bool ReadLattice(SkReadBuffer &, SkCanvas::Lattice *)
static int SaveBehind(SkCanvas *canvas, const SkRect *subset)
int saveLayer(const SkRect *bounds, const SkPaint *paint)
void drawRect(const SkRect &rect, const SkPaint &paint)
void drawOval(const SkRect &oval, const SkPaint &paint)
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
virtual bool isClipEmpty() const
void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint)
void translate(SkScalar dx, SkScalar dy)
void drawImageNine(const SkImage *image, const SkIRect ¢er, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
void drawPaint(const SkPaint &paint)
void private_draw_shadow_rec(const SkPath &, const SkDrawShadowRec &)
void drawDrawable(SkDrawable *drawable, const SkMatrix *matrix=nullptr)
void drawAnnotation(const SkRect &rect, const char key[], SkData *value)
static constexpr int kMaxFiltersPerLayer
@ kStrict_SrcRectConstraint
sample only inside bounds; slower
@ kFast_SrcRectConstraint
sample outside bounds; faster
SkM44 getLocalToDevice() const
void clipRegion(const SkRegion &deviceRgn, SkClipOp op=SkClipOp::kIntersect)
void experimental_DrawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
void clear(SkColor color)
void experimental_DrawEdgeAAImageSet(const ImageSetEntry imageSet[], int cnt, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint *paint=nullptr, SrcRectConstraint constraint=kStrict_SrcRectConstraint)
void rotate(SkScalar degrees)
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
void drawArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
void drawImageLattice(const SkImage *image, const Lattice &lattice, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
void clipPath(const SkPath &path, SkClipOp op, bool doAntiAlias)
void drawRegion(const SkRegion ®ion, const SkPaint &paint)
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
void drawPath(const SkPath &path, const SkPaint &paint)
void drawAtlas(const SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cullRect, const SkPaint *paint)
void setMatrix(const SkM44 &matrix)
void drawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
void scale(SkScalar sx, SkScalar sy)
void concat(const SkMatrix &matrix)
void drawPicture(const SkPicture *picture)
void clipShader(sk_sp< SkShader >, SkClipOp=SkClipOp::kIntersect)
void drawVertices(const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
@ kPolygon_PointMode
draw the array of points as a open polygon
@ kPoints_PointMode
draw each point separately
void skew(SkScalar sx, SkScalar sy)
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
void clipRRect(const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
const uint8_t * bytes() const
static SkM44 ColMajor(const SkScalar c[16])
const sktext::gpu::Slug * getSlug(SkReadBuffer *reader) const
const SkPaint * optionalPaint(SkReadBuffer *reader) const
const SkPath & getPath(SkReadBuffer *reader) const
const SkVertices * getVertices(SkReadBuffer *reader) const
const sk_sp< SkData > & opData() const
const SkTextBlob * getTextBlob(SkReadBuffer *reader) const
const SkPaint & requiredPaint(SkReadBuffer *reader) const
const SkImage * getImage(SkReadBuffer *reader) const
const SkPicture * getPicture(SkReadBuffer *reader) const
SkDrawable * getDrawable(SkReadBuffer *reader) const
const SkPictInfo & info() const
void draw(SkCanvas *canvas, SkPicture::AbortCallback *, SkReadBuffer *buffer)
void readRect(SkRect *rect)
void readColor4f(SkColor4f *color)
void readMatrix(SkMatrix *matrix)
void readPoint(SkPoint *point)
bool validate(bool isValid)
const void * skip(size_t size)
sk_sp< SkData > readByteArrayAsData()
void readIRect(SkIRect *rect)
SkSamplingOptions readSampling()
T checkRange(T min, T max)
void readString(SkString *string)
void setVersion(int version)
void readPoint3(SkPoint3 *point)
void readRRect(SkRRect *rrect)
void readRegion(SkRegion *region)
bool isVersionLT(SkPicturePriv::Version targetVersion) const
@ kReplace_Op
replace target with operand
@ kIntersect_Op
target intersected with operand
@ kDifference_Op
target minus operand
static size_t Mul(size_t x, size_t y)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
FlutterSemanticsFlag flag
FlutterSemanticsFlag flags
FlKeyEvent uint64_t FlKeyResponderAsyncCallback callback
static SkColor blend(SkColor dst, SkColor src, void(*mode)(float, float, float, float *, float *, float *))
sk_sp< const SkImage > atlas
unsigned useCenter Optional< SkMatrix > matrix
Optional< SkRect > bounds
PODArray< SkPoint > dstClips
sk_sp< const SkImage > image
ClipOpAndAA opAA SkRegion region
sk_sp< SkBlender > blender SkRect rect
PODArray< SkColor > colors
SkSamplingOptions sampling
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
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
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
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
SkSamplingOptions(SkFilterMode::kLinear))
uint32_t getVersion() const
std::shared_ptr< const fml::Mapping > data