69 pics[
i] = fArray[
i]->makePictureSnapshot().release();
85 static constexpr SkIRect kSafeBounds = {-kSafeEdge, -kSafeEdge, kSafeEdge, kSafeEdge};
86 static_assert((kSafeBounds.
fRight - kSafeBounds.
fLeft) >= 0 &&
96 , fApproxBytesUsedBySubPictures(0)
103 , fApproxBytesUsedBySubPictures(0)
116 fDrawableList.reset(
nullptr);
117 fApproxBytesUsedBySubPictures = 0;
122template<
typename T,
typename... Args>
123void SkRecorder::append(Args&&...
args) {
124 new (fRecord->
append<
T>())
T{std::forward<Args>(
args)...};
128#define INHERITED(method, ...) this->SkNoDrawCanvas::method(__VA_ARGS__)
133T* SkRecorder::copy(
const T*
src) {
134 if (
nullptr ==
src) {
143T* SkRecorder::copy(
const T src[],
size_t count) {
144 if (
nullptr ==
src) {
148 for (
size_t i = 0;
i <
count;
i++) {
158char* SkRecorder::copy(
const char src[],
size_t count) {
159 if (
nullptr ==
src) {
169char* SkRecorder::copy(
const char*
src) {
170 return this->
copy(src, strlen(
src)+1);
174 this->append<SkRecords::DrawPaint>(
paint);
178 this->append<SkRecords::DrawBehind>(
paint);
189 this->append<SkRecords::DrawRect>(
paint,
rect);
193 this->append<SkRecords::DrawRegion>(
paint,
region);
197 this->append<SkRecords::DrawOval>(
paint,
oval);
206 this->append<SkRecords::DrawRRect>(
paint,
rrect);
210 this->append<SkRecords::DrawDRRect>(
paint, outer, inner);
214 if (!fDrawableList) {
215 fDrawableList = std::make_unique<SkDrawableList>();
217 fDrawableList->append(drawable);
218 this->append<SkRecords::DrawDrawable>(this->
copy(matrix), drawable->
getBounds(), fDrawableList->count() - 1);
222 this->append<SkRecords::DrawPath>(
paint,
path);
260 if (glyphRunList.
blob() ==
nullptr) {
274 this->append<SkRecords::DrawVertices>(
paint,
280 this->append<SkRecords::DrawMesh>(
paint,
mesh, std::move(blender));
286 this->append<SkRecords::DrawPatch>(
paint,
297 this->append<SkRecords::DrawAtlas>(this->
copy(paint),
309 this->append<SkRecords::DrawShadowRec>(
path, rec);
318 this->append<SkRecords::DrawEdgeAAQuad>(
326 int totalDstClipCount, totalMatrixCount;
334 this->append<SkRecords::DrawEdgeAAImageSet>(this->
copy(paint), std::move(setCopy),
count,
335 this->
copy(dstClips, totalDstClipCount),
336 this->
copy(preViewMatrices, totalMatrixCount),
sampling, constraint);
340 this->append<SkRecords::Save>();
349 this->append<SkRecords::SaveLayer>(this->
copy(rec.
fBounds),
359 this->append<SkRecords::SaveBehind>(this->
copy(subset));
368 this->append<SkRecords::Concat44>(
m);
372 this->append<SkRecords::SetM44>(
m);
376 this->append<SkRecords::Scale>(sx, sy);
380 this->append<SkRecords::Translate>(
dx, dy);
386 this->append<SkRecords::ClipRect>(
rect, opAA);
392 this->append<SkRecords::ClipRRect>(
rrect, opAA);
398 this->append<SkRecords::ClipPath>(
path, opAA);
403 this->append<SkRecords::ClipShader>(std::move(cs), op);
408 this->append<SkRecords::ClipRegion>(deviceRgn, op);
413 this->append<SkRecords::ResetClip>();
constexpr int SK_MaxS32FitsInFloat
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
#define INHERITED(method,...)
static SkIRect safe_picture_bounds(const SkRect &bounds)
sk_sp< T > sk_ref_sp(T *obj)
static void copy(void *dst, const uint8_t *src, int width, int bpp, int deltaSrc, int offset, const SkPMColor ctable[])
constexpr unsigned SkToUInt(S x)
static SkScalar GetBackdropScaleFactor(const SkCanvas::SaveLayerRec &rec)
static void GetDstClipAndMatrixCounts(const SkCanvas::ImageSetEntry set[], int count, int *totalDstClipCount, int *totalMatrixCount)
@ kNoLayer_SaveLayerStrategy
SkMatrix getTotalMatrix() const
SkImageInfo imageInfo() const
SkBigPicture::SnapshotArray * newDrawableSnapshot()
void append(SkDrawable *drawable)
static const SkMatrix & I()
void resetCanvas(int w, int h)
virtual size_t approximateBytesUsed() const =0
T * alloc(size_t count=1)
void didScale(SkScalar, SkScalar) override
void onDrawShadowRec(const SkPath &, const SkDrawShadowRec &) override
void didTranslate(SkScalar, SkScalar) override
void didConcat44(const SkM44 &) override
void onDrawDRRect(const SkRRect &, const SkRRect &, const SkPaint &) override
void onDrawPicture(const SkPicture *, const SkMatrix *, const SkPaint *) override
void onClipShader(sk_sp< SkShader >, SkClipOp) override
void onDrawDrawable(SkDrawable *, const SkMatrix *) override
void onDrawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode, const SkPaint &paint) override
void onDrawPaint(const SkPaint &) override
void onClipRRect(const SkRRect &rrect, SkClipOp, ClipEdgeStyle) override
void onClipRegion(const SkRegion &deviceRgn, SkClipOp) override
void onDrawSlug(const sktext::gpu::Slug *slug, const SkPaint &paint) override
void onDrawPath(const SkPath &, const SkPaint &) override
void onDrawMesh(const SkMesh &, sk_sp< SkBlender >, const SkPaint &) override
void onDrawBehind(const SkPaint &) override
void onDrawImage2(const SkImage *, SkScalar, SkScalar, const SkSamplingOptions &, const SkPaint *) override
void onDrawEdgeAAQuad(const SkRect &, const SkPoint[4], QuadAAFlags, const SkColor4f &, SkBlendMode) override
void didSetM44(const SkM44 &) override
void onDrawRegion(const SkRegion &, const SkPaint &) override
void onDrawVerticesObject(const SkVertices *, SkBlendMode, const SkPaint &) override
void onDrawRect(const SkRect &, const SkPaint &) override
void onResetClip() override
void onDrawImageLattice2(const SkImage *, const Lattice &, const SkRect &, SkFilterMode, const SkPaint *) override
void onClipRect(const SkRect &rect, SkClipOp, ClipEdgeStyle) override
sk_sp< SkSurface > onNewSurface(const SkImageInfo &, const SkSurfaceProps &) override
bool onDoSaveBehind(const SkRect *) override
void onDrawGlyphRunList(const sktext::GlyphRunList &glyphRunList, const SkPaint &paint) override
void onDrawArc(const SkRect &, SkScalar, SkScalar, bool, const SkPaint &) override
void onDrawPoints(PointMode, size_t count, const SkPoint pts[], const SkPaint &) override
void onDrawAtlas2(const SkImage *, const SkRSXform[], const SkRect[], const SkColor[], int, SkBlendMode, const SkSamplingOptions &, const SkRect *, const SkPaint *) override
void didRestore() override
void onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
void reset(SkRecord *, const SkRect &bounds)
void onDrawImageRect2(const SkImage *, const SkRect &, const SkRect &, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
void onDrawEdgeAAImageSet2(const ImageSetEntry[], int count, const SkPoint[], const SkMatrix[], const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
SkRecorder(SkRecord *, int width, int height)
void onDrawAnnotation(const SkRect &, const char[], SkData *) override
void onClipPath(const SkPath &path, SkClipOp, ClipEdgeStyle) override
void onDrawOval(const SkRect &, const SkPaint &) override
SaveLayerStrategy getSaveLayerStrategy(const SaveLayerRec &) override
void onDrawRRect(const SkRRect &, const SkPaint &) override
constexpr size_t size() const
const SkTextBlob * blob() const
sk_sp< SkTextBlob > makeBlob() const
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
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< SkMatrix > preViewMatrices
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
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
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
int fYCount
number of y-coordinates
const SkIRect * fBounds
source bounds to draw from
const int * fYDivs
y-axis values dividing bitmap
int fXCount
number of x-coordinates
const RectType * fRectTypes
array of fill types
const SkColor * fColors
array of colors
const int * fXDivs
x-axis values dividing bitmap
const SkImageFilter * fBackdrop
SaveLayerFlags fSaveLayerFlags
bool intersect(const SkIRect &r)
int32_t fBottom
larger y-axis bounds
int32_t fTop
smaller y-axis bounds
int32_t fLeft
smaller x-axis bounds
int32_t fRight
larger x-axis bounds
constexpr float y() const
constexpr float x() const