Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
SkPictureRecord Class Reference

#include <SkPictureRecord.h>

Inheritance diagram for SkPictureRecord:
SkCanvasVirtualEnforcer< SkCanvas > SkCanvas

Public Member Functions

 SkPictureRecord (const SkISize &dimensions, uint32_t recordFlags)
 
 SkPictureRecord (const SkIRect &dimensions, uint32_t recordFlags)
 
const skia_private::TArray< sk_sp< const SkPicture > > & getPictures () const
 
const skia_private::TArray< sk_sp< SkDrawable > > & getDrawables () const
 
const skia_private::TArray< sk_sp< const SkTextBlob > > & getTextBlobs () const
 
const skia_private::TArray< sk_sp< const sktext::gpu::Slug > > & getSlugs () const
 
const skia_private::TArray< sk_sp< const SkVertices > > & getVertices () const
 
const skia_private::TArray< sk_sp< const SkImage > > & getImages () const
 
sk_sp< SkDataopData () const
 
void setFlags (uint32_t recordFlags)
 
const SkWriter32writeStream () const
 
void beginRecording ()
 
void endRecording ()
 
- Public Member Functions inherited from SkCanvas
 SkCanvas ()
 
 SkCanvas (int width, int height, const SkSurfaceProps *props=nullptr)
 
 SkCanvas (sk_sp< SkDevice > device)
 
 SkCanvas (const SkBitmap &bitmap)
 
 SkCanvas (const SkBitmap &bitmap, const SkSurfaceProps &props)
 
virtual ~SkCanvas ()
 
SkImageInfo imageInfo () const
 
bool getProps (SkSurfaceProps *props) const
 
SkSurfaceProps getBaseProps () const
 
SkSurfaceProps getTopProps () const
 
virtual SkISize getBaseLayerSize () const
 
sk_sp< SkSurfacemakeSurface (const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
 
virtual GrRecordingContextrecordingContext () const
 
virtual skgpu::graphite::Recorderrecorder () const
 
SkSurfacegetSurface () const
 
void * accessTopLayerPixels (SkImageInfo *info, size_t *rowBytes, SkIPoint *origin=nullptr)
 
SkRasterHandleAllocator::Handle accessTopRasterHandle () const
 
bool peekPixels (SkPixmap *pixmap)
 
bool readPixels (const SkImageInfo &dstInfo, void *dstPixels, size_t dstRowBytes, int srcX, int srcY)
 
bool readPixels (const SkPixmap &pixmap, int srcX, int srcY)
 
bool readPixels (const SkBitmap &bitmap, int srcX, int srcY)
 
bool writePixels (const SkImageInfo &info, const void *pixels, size_t rowBytes, int x, int y)
 
bool writePixels (const SkBitmap &bitmap, int x, int y)
 
int save ()
 
int saveLayer (const SkRect *bounds, const SkPaint *paint)
 
int saveLayer (const SkRect &bounds, const SkPaint *paint)
 
int saveLayerAlphaf (const SkRect *bounds, float alpha)
 
int saveLayerAlpha (const SkRect *bounds, U8CPU alpha)
 
int saveLayer (const SaveLayerRec &layerRec)
 
void restore ()
 
int getSaveCount () const
 
void restoreToCount (int saveCount)
 
void translate (SkScalar dx, SkScalar dy)
 
void scale (SkScalar sx, SkScalar sy)
 
void rotate (SkScalar degrees)
 
void rotate (SkScalar degrees, SkScalar px, SkScalar py)
 
void skew (SkScalar sx, SkScalar sy)
 
void concat (const SkMatrix &matrix)
 
void concat (const SkM44 &)
 
void setMatrix (const SkM44 &matrix)
 
void setMatrix (const SkMatrix &matrix)
 
void resetMatrix ()
 
void clipRect (const SkRect &rect, SkClipOp op, bool doAntiAlias)
 
void clipRect (const SkRect &rect, SkClipOp op)
 
void clipRect (const SkRect &rect, bool doAntiAlias=false)
 
void clipIRect (const SkIRect &irect, SkClipOp op=SkClipOp::kIntersect)
 
void androidFramework_setDeviceClipRestriction (const SkIRect &rect)
 
void clipRRect (const SkRRect &rrect, SkClipOp op, bool doAntiAlias)
 
void clipRRect (const SkRRect &rrect, SkClipOp op)
 
void clipRRect (const SkRRect &rrect, bool doAntiAlias=false)
 
void clipPath (const SkPath &path, SkClipOp op, bool doAntiAlias)
 
void clipPath (const SkPath &path, SkClipOp op)
 
void clipPath (const SkPath &path, bool doAntiAlias=false)
 
void clipShader (sk_sp< SkShader >, SkClipOp=SkClipOp::kIntersect)
 
void clipRegion (const SkRegion &deviceRgn, SkClipOp op=SkClipOp::kIntersect)
 
bool quickReject (const SkRect &rect) const
 
bool quickReject (const SkPath &path) const
 
SkRect getLocalClipBounds () const
 
bool getLocalClipBounds (SkRect *bounds) const
 
SkIRect getDeviceClipBounds () const
 
bool getDeviceClipBounds (SkIRect *bounds) const
 
void drawColor (SkColor color, SkBlendMode mode=SkBlendMode::kSrcOver)
 
void drawColor (const SkColor4f &color, SkBlendMode mode=SkBlendMode::kSrcOver)
 
void clear (SkColor color)
 
void clear (const SkColor4f &color)
 
void discard ()
 
void drawPaint (const SkPaint &paint)
 
void drawPoints (PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
 
void drawPoint (SkScalar x, SkScalar y, const SkPaint &paint)
 
void drawPoint (SkPoint p, const SkPaint &paint)
 
void drawLine (SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
 
void drawLine (SkPoint p0, SkPoint p1, const SkPaint &paint)
 
void drawRect (const SkRect &rect, const SkPaint &paint)
 
void drawIRect (const SkIRect &rect, const SkPaint &paint)
 
void drawRegion (const SkRegion &region, const SkPaint &paint)
 
void drawOval (const SkRect &oval, const SkPaint &paint)
 
void drawRRect (const SkRRect &rrect, const SkPaint &paint)
 
void drawDRRect (const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
 
void drawCircle (SkScalar cx, SkScalar cy, SkScalar radius, const SkPaint &paint)
 
void drawCircle (SkPoint center, SkScalar radius, const SkPaint &paint)
 
void drawArc (const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
 
void drawArc (const SkArc &arc, const SkPaint &paint)
 
void drawRoundRect (const SkRect &rect, SkScalar rx, SkScalar ry, const SkPaint &paint)
 
void drawPath (const SkPath &path, const SkPaint &paint)
 
void drawImage (const SkImage *image, SkScalar left, SkScalar top)
 
void drawImage (const sk_sp< SkImage > &image, SkScalar left, SkScalar top)
 
void drawImage (const SkImage *, SkScalar x, SkScalar y, const SkSamplingOptions &, const SkPaint *=nullptr)
 
void drawImage (const sk_sp< SkImage > &image, SkScalar x, SkScalar y, const SkSamplingOptions &sampling, const SkPaint *paint=nullptr)
 
void drawImageRect (const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
 
void drawImageRect (const SkImage *, const SkRect &dst, const SkSamplingOptions &, const SkPaint *=nullptr)
 
void drawImageRect (const sk_sp< SkImage > &image, const SkRect &src, const SkRect &dst, const SkSamplingOptions &sampling, const SkPaint *paint, SrcRectConstraint constraint)
 
void drawImageRect (const sk_sp< SkImage > &image, const SkRect &dst, const SkSamplingOptions &sampling, const SkPaint *paint=nullptr)
 
void drawImageNine (const SkImage *image, const SkIRect &center, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
 
void drawImageLattice (const SkImage *image, const Lattice &lattice, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
 
void drawImageLattice (const SkImage *image, const Lattice &lattice, const SkRect &dst)
 
void experimental_DrawEdgeAAQuad (const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
 
void experimental_DrawEdgeAAQuad (const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, SkColor color, SkBlendMode mode)
 
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 drawSimpleText (const void *text, size_t byteLength, SkTextEncoding encoding, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
 
void drawString (const char str[], SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
 
void drawString (const SkString &str, SkScalar x, SkScalar y, const SkFont &font, const SkPaint &paint)
 
void drawGlyphs (int count, const SkGlyphID glyphs[], const SkPoint positions[], const uint32_t clusters[], int textByteCount, const char utf8text[], SkPoint origin, const SkFont &font, const SkPaint &paint)
 
void drawGlyphs (int count, const SkGlyphID glyphs[], const SkPoint positions[], SkPoint origin, const SkFont &font, const SkPaint &paint)
 
void drawGlyphs (int count, const SkGlyphID glyphs[], const SkRSXform xforms[], SkPoint origin, const SkFont &font, const SkPaint &paint)
 
void drawTextBlob (const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
 
void drawTextBlob (const sk_sp< SkTextBlob > &blob, SkScalar x, SkScalar y, const SkPaint &paint)
 
void drawPicture (const SkPicture *picture)
 
void drawPicture (const sk_sp< SkPicture > &picture)
 
void drawPicture (const SkPicture *picture, const SkMatrix *matrix, const SkPaint *paint)
 
void drawPicture (const sk_sp< SkPicture > &picture, const SkMatrix *matrix, const SkPaint *paint)
 
void drawVertices (const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
 
void drawVertices (const sk_sp< SkVertices > &vertices, SkBlendMode mode, const SkPaint &paint)
 
void drawMesh (const SkMesh &mesh, sk_sp< SkBlender > blender, const SkPaint &paint)
 
void drawPatch (const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, 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 drawDrawable (SkDrawable *drawable, const SkMatrix *matrix=nullptr)
 
void drawDrawable (SkDrawable *drawable, SkScalar x, SkScalar y)
 
void drawAnnotation (const SkRect &rect, const char key[], SkData *value)
 
void drawAnnotation (const SkRect &rect, const char key[], const sk_sp< SkData > &value)
 
virtual bool isClipEmpty () const
 
virtual bool isClipRect () const
 
SkM44 getLocalToDevice () const
 
SkMatrix getLocalToDeviceAs3x3 () const
 
SkMatrix getTotalMatrix () const
 
void temporary_internal_getRgnClip (SkRegion *region)
 
void private_draw_shadow_rec (const SkPath &, const SkDrawShadowRec &)
 

Protected Member Functions

void addNoOp ()
 
void validate (size_t initialOffset, size_t size) const
 
sk_sp< SkSurfaceonNewSurface (const SkImageInfo &, const SkSurfaceProps &) override
 
bool onPeekPixels (SkPixmap *) override
 
void willSave () override
 
SaveLayerStrategy getSaveLayerStrategy (const SaveLayerRec &) override
 
bool onDoSaveBehind (const SkRect *) override
 
void willRestore () override
 
void didConcat44 (const SkM44 &) override
 
void didSetM44 (const SkM44 &) override
 
void didScale (SkScalar, SkScalar) override
 
void didTranslate (SkScalar, SkScalar) override
 
void onDrawDRRect (const SkRRect &, const SkRRect &, const SkPaint &) override
 
void onDrawTextBlob (const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
 
void onDrawSlug (const sktext::gpu::Slug *slug, const SkPaint &paint) 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 onDrawBehind (const SkPaint &) override
 
void onDrawPoints (PointMode, size_t count, const SkPoint pts[], const SkPaint &) override
 
void onDrawRect (const SkRect &, const SkPaint &) override
 
void onDrawRegion (const SkRegion &, const SkPaint &) override
 
void onDrawOval (const SkRect &, const SkPaint &) override
 
void onDrawArc (const SkRect &, SkScalar, SkScalar, bool, const SkPaint &) override
 
void onDrawRRect (const SkRRect &, const SkPaint &) override
 
void onDrawPath (const SkPath &, const SkPaint &) override
 
void onDrawImage2 (const SkImage *, SkScalar, SkScalar, const SkSamplingOptions &, const SkPaint *) override
 
void onDrawImageRect2 (const SkImage *, const SkRect &, const SkRect &, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
 
void onDrawImageLattice2 (const SkImage *, const Lattice &, const SkRect &, SkFilterMode, const SkPaint *) override
 
void onDrawAtlas2 (const SkImage *, const SkRSXform[], const SkRect[], const SkColor[], int, SkBlendMode, const SkSamplingOptions &, const SkRect *, const SkPaint *) override
 
void onDrawShadowRec (const SkPath &, const SkDrawShadowRec &) override
 
void onDrawVerticesObject (const SkVertices *, SkBlendMode, const SkPaint &) override
 
void onClipRect (const SkRect &, SkClipOp, ClipEdgeStyle) override
 
void onClipRRect (const SkRRect &, SkClipOp, ClipEdgeStyle) override
 
void onClipPath (const SkPath &, SkClipOp, ClipEdgeStyle) override
 
void onClipShader (sk_sp< SkShader >, SkClipOp) override
 
void onClipRegion (const SkRegion &, SkClipOp) override
 
void onResetClip () override
 
void onDrawPicture (const SkPicture *, const SkMatrix *, const SkPaint *) override
 
void onDrawDrawable (SkDrawable *, const SkMatrix *) override
 
void onDrawAnnotation (const SkRect &, const char[], SkData *) override
 
void onDrawEdgeAAQuad (const SkRect &, const SkPoint[4], QuadAAFlags, const SkColor4f &, SkBlendMode) override
 
void onDrawEdgeAAImageSet2 (const ImageSetEntry[], int count, const SkPoint[], const SkMatrix[], const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
 
int addPathToHeap (const SkPath &path)
 
void recordConcat (const SkMatrix &matrix)
 
void recordTranslate (const SkMatrix &matrix)
 
void recordScale (const SkMatrix &matrix)
 
size_t recordClipRect (const SkRect &rect, SkClipOp op, bool doAA)
 
size_t recordClipRRect (const SkRRect &rrect, SkClipOp op, bool doAA)
 
size_t recordClipPath (int pathID, SkClipOp op, bool doAA)
 
size_t recordClipRegion (const SkRegion &region, SkClipOp op)
 
void recordSave ()
 
void recordSaveLayer (const SaveLayerRec &)
 
void recordRestore (bool fillInSkips=true)
 
- Protected Member Functions inherited from SkCanvasVirtualEnforcer< SkCanvas >
void onDrawPaint (const SkPaint &paint) override=0
 
void onDrawBehind (const SkPaint &) override
 
void onDrawRect (const SkRect &rect, const SkPaint &paint) override=0
 
void onDrawRRect (const SkRRect &rrect, const SkPaint &paint) override=0
 
void onDrawDRRect (const SkRRect &outer, const SkRRect &inner, const SkPaint &paint) override=0
 
void onDrawOval (const SkRect &rect, const SkPaint &paint) override=0
 
void onDrawArc (const SkRect &rect, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint) override=0
 
void onDrawPath (const SkPath &path, const SkPaint &paint) override=0
 
void onDrawRegion (const SkRegion &region, const SkPaint &paint) override=0
 
void onDrawTextBlob (const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override=0
 
void onDrawPatch (const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint) override=0
 
void onDrawPoints (SkCanvas::PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint) override=0
 
void onDrawEdgeAAQuad (const SkRect &rect, const SkPoint clip[4], SkCanvas::QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode) override=0
 
void onDrawAnnotation (const SkRect &rect, const char key[], SkData *value) override=0
 
void onDrawShadowRec (const SkPath &, const SkDrawShadowRec &) override=0
 
void onDrawDrawable (SkDrawable *drawable, const SkMatrix *matrix) override=0
 
void onDrawPicture (const SkPicture *picture, const SkMatrix *matrix, const SkPaint *paint) override=0
 
- Protected Member Functions inherited from SkCanvas
virtual sk_sp< SkSurfaceonNewSurface (const SkImageInfo &info, const SkSurfaceProps &props)
 
virtual bool onPeekPixels (SkPixmap *pixmap)
 
virtual bool onAccessTopLayerPixels (SkPixmap *pixmap)
 
virtual SkImageInfo onImageInfo () const
 
virtual bool onGetProps (SkSurfaceProps *props, bool top) const
 
virtual void willSave ()
 
virtual SaveLayerStrategy getSaveLayerStrategy (const SaveLayerRec &)
 
virtual bool onDoSaveBehind (const SkRect *)
 
virtual void willRestore ()
 
virtual void didRestore ()
 
virtual void didConcat44 (const SkM44 &)
 
virtual void didSetM44 (const SkM44 &)
 
virtual void didTranslate (SkScalar, SkScalar)
 
virtual void didScale (SkScalar, SkScalar)
 
virtual void onDrawPaint (const SkPaint &paint)
 
virtual void onDrawBehind (const SkPaint &paint)
 
virtual void onDrawRect (const SkRect &rect, const SkPaint &paint)
 
virtual void onDrawRRect (const SkRRect &rrect, const SkPaint &paint)
 
virtual void onDrawDRRect (const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
 
virtual void onDrawOval (const SkRect &rect, const SkPaint &paint)
 
virtual void onDrawArc (const SkRect &rect, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
 
virtual void onDrawPath (const SkPath &path, const SkPaint &paint)
 
virtual void onDrawRegion (const SkRegion &region, const SkPaint &paint)
 
virtual void onDrawTextBlob (const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
 
virtual void onDrawGlyphRunList (const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
 
virtual void onDrawPatch (const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint)
 
virtual void onDrawPoints (PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
 
virtual void onDrawImage2 (const SkImage *, SkScalar dx, SkScalar dy, const SkSamplingOptions &, const SkPaint *)
 
virtual void onDrawImageRect2 (const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
 
virtual void onDrawImageLattice2 (const SkImage *, const Lattice &, const SkRect &dst, SkFilterMode, const SkPaint *)
 
virtual void onDrawAtlas2 (const SkImage *, const SkRSXform[], const SkRect src[], const SkColor[], int count, SkBlendMode, const SkSamplingOptions &, const SkRect *cull, const SkPaint *)
 
virtual void onDrawEdgeAAImageSet2 (const ImageSetEntry imageSet[], int count, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
 
virtual void onDrawVerticesObject (const SkVertices *vertices, SkBlendMode mode, const SkPaint &paint)
 
virtual void onDrawMesh (const SkMesh &, sk_sp< SkBlender >, const SkPaint &)
 
virtual void onDrawAnnotation (const SkRect &rect, const char key[], SkData *value)
 
virtual void onDrawShadowRec (const SkPath &, const SkDrawShadowRec &)
 
virtual void onDrawDrawable (SkDrawable *drawable, const SkMatrix *matrix)
 
virtual void onDrawPicture (const SkPicture *picture, const SkMatrix *matrix, const SkPaint *paint)
 
virtual void onDrawEdgeAAQuad (const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
 
virtual void onClipRect (const SkRect &rect, SkClipOp op, ClipEdgeStyle edgeStyle)
 
virtual void onClipRRect (const SkRRect &rrect, SkClipOp op, ClipEdgeStyle edgeStyle)
 
virtual void onClipPath (const SkPath &path, SkClipOp op, ClipEdgeStyle edgeStyle)
 
virtual void onClipShader (sk_sp< SkShader >, SkClipOp)
 
virtual void onClipRegion (const SkRegion &deviceRgn, SkClipOp op)
 
virtual void onResetClip ()
 
virtual void onDiscard ()
 
virtual sk_sp< sktext::gpu::SlugonConvertGlyphRunListToSlug (const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
 
virtual void onDrawSlug (const sktext::gpu::Slug *slug, const SkPaint &paint)
 
 SkCanvas (const SkIRect &bounds)
 

Friends

class SkPictureData
 

Additional Inherited Members

- Public Types inherited from SkCanvas
enum  SaveLayerFlagsSet { kPreserveLCDText_SaveLayerFlag = 1 << 1 , kInitWithPrevious_SaveLayerFlag = 1 << 2 , kF16ColorType = 1 << 4 }
 
enum  PointMode { kPoints_PointMode , kLines_PointMode , kPolygon_PointMode }
 
enum  SrcRectConstraint { kStrict_SrcRectConstraint , kFast_SrcRectConstraint }
 
enum  QuadAAFlags : unsigned {
  kLeft_QuadAAFlag = 0b0001 , kTop_QuadAAFlag = 0b0010 , kRight_QuadAAFlag = 0b0100 , kBottom_QuadAAFlag = 0b1000 ,
  kNone_QuadAAFlags = 0b0000 , kAll_QuadAAFlags = 0b1111
}
 
using SaveLayerFlags = uint32_t
 
using FilterSpan = SkSpan< sk_sp< SkImageFilter > >
 
- Static Public Member Functions inherited from SkCanvas
static std::unique_ptr< SkCanvasMakeRasterDirect (const SkImageInfo &info, void *pixels, size_t rowBytes, const SkSurfaceProps *props=nullptr)
 
static std::unique_ptr< SkCanvasMakeRasterDirectN32 (int width, int height, SkPMColor *pixels, size_t rowBytes)
 
- Static Public Attributes inherited from SkCanvas
static constexpr int kMaxFiltersPerLayer = 16
 
- Protected Types inherited from SkCanvas
enum  SaveLayerStrategy { kFullLayer_SaveLayerStrategy , kNoLayer_SaveLayerStrategy }
 
enum  ClipEdgeStyle { kHard_ClipEdgeStyle , kSoft_ClipEdgeStyle }
 

Detailed Description

Definition at line 67 of file SkPictureRecord.h.

Constructor & Destructor Documentation

◆ SkPictureRecord() [1/2]

SkPictureRecord::SkPictureRecord ( const SkISize dimensions,
uint32_t  recordFlags 
)

Definition at line 55 of file SkPictureRecord.cpp.

56 : SkPictureRecord(SkIRect::MakeSize(dimensions), flags) {}
friend class SkPictureRecord
Definition: SkCanvas.h:2493
FlutterSemanticsFlag flags
static constexpr SkIRect MakeSize(const SkISize &size)
Definition: SkRect.h:66

◆ SkPictureRecord() [2/2]

SkPictureRecord::SkPictureRecord ( const SkIRect dimensions,
uint32_t  recordFlags 
)

Definition at line 49 of file SkPictureRecord.cpp.

51 , fRecordFlags(flags)
52 , fInitialSaveCount(kNoInitialSave) {
53}
@ kNoInitialSave

Member Function Documentation

◆ addNoOp()

void SkPictureRecord::addNoOp ( )
protected

Definition at line 910 of file SkPictureRecord.cpp.

910 {
911 size_t size = kUInt32Size; // op
912 this->addDraw(NOOP, &size);
913}
@ NOOP
Definition: SkPictureFlat.h:69
static int const kUInt32Size
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

◆ addPathToHeap()

int SkPictureRecord::addPathToHeap ( const SkPath path)
protected

Definition at line 875 of file SkPictureRecord.cpp.

875 {
876 if (int* n = fPaths.find(path)) {
877 return *n;
878 }
879 int n = fPaths.count() + 1; // 0 is reserved for null / error.
880 fPaths.set(path, n);
881 return n;
882}
int count() const
Definition: SkTHash.h:471
V * find(const K &key) const
Definition: SkTHash.h:494
V * set(K key, V val)
Definition: SkTHash.h:487
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
Definition: switches.h:57

◆ beginRecording()

void SkPictureRecord::beginRecording ( )

Definition at line 296 of file SkPictureRecord.cpp.

296 {
297 // we have to call this *after* our constructor, to ensure that it gets
298 // recorded. This is balanced by restoreToCount() call from endRecording,
299 // which in-turn calls our overridden restore(), so those get recorded too.
300 fInitialSaveCount = this->save();
301}
int save()
Definition: SkCanvas.cpp:447

◆ didConcat44()

void SkPictureRecord::didConcat44 ( const SkM44 m)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 239 of file SkPictureRecord.cpp.

239 {
240 this->validate(fWriter.bytesWritten(), 0);
241 // op + matrix
242 size_t size = kUInt32Size + 16 * sizeof(SkScalar);
243 size_t initialOffset = this->addDraw(CONCAT44, &size);
244 fWriter.write(SkMatrixPriv::M44ColMajor(m), 16 * sizeof(SkScalar));
245 this->validate(initialOffset, size);
246
248}
@ CONCAT44
static const SkScalar * M44ColMajor(const SkM44 &m)
Definition: SkMatrixPriv.h:185
void validate(size_t initialOffset, size_t size) const
void write(const void *values, size_t size)
Definition: SkWriter32.h:170
size_t bytesWritten() const
Definition: SkWriter32.h:48
float SkScalar
Definition: extension.cpp:12

◆ didScale()

void SkPictureRecord::didScale ( SkScalar  x,
SkScalar  y 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 260 of file SkPictureRecord.cpp.

260 {
261 this->didConcat44(SkM44::Scale(x, y));
262}
static SkM44 Scale(SkScalar x, SkScalar y, SkScalar z=1)
Definition: SkM44.h:232
void didConcat44(const SkM44 &) override
double y
double x

◆ didSetM44()

void SkPictureRecord::didSetM44 ( const SkM44 m)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 250 of file SkPictureRecord.cpp.

250 {
251 this->validate(fWriter.bytesWritten(), 0);
252 // op + matrix
253 size_t size = kUInt32Size + 16 * sizeof(SkScalar);
254 size_t initialOffset = this->addDraw(SET_M44, &size);
255 fWriter.write(SkMatrixPriv::M44ColMajor(m), 16 * sizeof(SkScalar));
256 this->validate(initialOffset, size);
258}
@ SET_M44

◆ didTranslate()

void SkPictureRecord::didTranslate ( SkScalar  x,
SkScalar  y 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 264 of file SkPictureRecord.cpp.

264 {
266}
static SkM44 Translate(SkScalar x, SkScalar y, SkScalar z=0)
Definition: SkM44.h:225

◆ endRecording()

void SkPictureRecord::endRecording ( )

Definition at line 303 of file SkPictureRecord.cpp.

303 {
304 SkASSERT(kNoInitialSave != fInitialSaveCount);
305 this->restoreToCount(fInitialSaveCount);
306}
#define SkASSERT(cond)
Definition: SkAssert.h:116
void restoreToCount(int saveCount)
Definition: SkCanvas.cpp:478

◆ getDrawables()

const skia_private::TArray< sk_sp< SkDrawable > > & SkPictureRecord::getDrawables ( ) const
inline

Definition at line 77 of file SkPictureRecord.h.

77 {
78 return fDrawables;
79 }

◆ getImages()

const skia_private::TArray< sk_sp< const SkImage > > & SkPictureRecord::getImages ( ) const
inline

Definition at line 93 of file SkPictureRecord.h.

93 {
94 return fImages;
95 }

◆ getPictures()

const skia_private::TArray< sk_sp< const SkPicture > > & SkPictureRecord::getPictures ( ) const
inline

Definition at line 73 of file SkPictureRecord.h.

73 {
74 return fPictures;
75 }

◆ getSaveLayerStrategy()

SkCanvas::SaveLayerStrategy SkPictureRecord::getSaveLayerStrategy ( const SaveLayerRec rec)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 75 of file SkPictureRecord.cpp.

75 {
76 // record the offset to us, making it non-positive to distinguish a save
77 // from a clip entry.
78 fRestoreOffsetStack.push_back(-(int32_t)fWriter.bytesWritten());
79 this->recordSaveLayer(rec);
80
82 /* No need for a (potentially very big) layer which we don't actually need
83 at this time (and may not be able to afford since during record our
84 clip starts out the size of the picture, which is often much larger
85 than the size of the actual device we'll use during playback).
86 */
88}
@ kNoLayer_SaveLayerStrategy
Definition: SkCanvas.h:2265
void recordSaveLayer(const SaveLayerRec &)
void push_back(const T &v)
Definition: SkTDArray.h:219

◆ getSlugs()

const skia_private::TArray< sk_sp< const sktext::gpu::Slug > > & SkPictureRecord::getSlugs ( ) const
inline

Definition at line 85 of file SkPictureRecord.h.

85 {
86 return fSlugs;
87 }

◆ getTextBlobs()

const skia_private::TArray< sk_sp< const SkTextBlob > > & SkPictureRecord::getTextBlobs ( ) const
inline

Definition at line 81 of file SkPictureRecord.h.

81 {
82 return fTextBlobs;
83 }

◆ getVertices()

const skia_private::TArray< sk_sp< const SkVertices > > & SkPictureRecord::getVertices ( ) const
inline

Definition at line 89 of file SkPictureRecord.h.

89 {
90 return fVertices;
91 }

◆ onClipPath()

void SkPictureRecord::onClipPath ( const SkPath path,
SkClipOp  op,
ClipEdgeStyle  edgeStyle 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 369 of file SkPictureRecord.cpp.

369 {
370 int pathID = this->addPathToHeap(path);
371 this->recordClipPath(pathID, op, kSoft_ClipEdgeStyle == edgeStyle);
373}
@ kSoft_ClipEdgeStyle
Definition: SkCanvas.h:2337
int addPathToHeap(const SkPath &path)
size_t recordClipPath(int pathID, SkClipOp op, bool doAA)

◆ onClipRect()

void SkPictureRecord::onClipRect ( const SkRect rect,
SkClipOp  op,
ClipEdgeStyle  edgeStyle 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 326 of file SkPictureRecord.cpp.

326 {
327 this->recordClipRect(rect, op, kSoft_ClipEdgeStyle == edgeStyle);
329}
size_t recordClipRect(const SkRect &rect, SkClipOp op, bool doAA)
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350

◆ onClipRegion()

void SkPictureRecord::onClipRegion ( const SkRegion region,
SkClipOp  op 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 407 of file SkPictureRecord.cpp.

407 {
408 this->recordClipRegion(region, op);
410}
size_t recordClipRegion(const SkRegion &region, SkClipOp op)
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238

◆ onClipRRect()

void SkPictureRecord::onClipRRect ( const SkRRect rrect,
SkClipOp  op,
ClipEdgeStyle  edgeStyle 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 348 of file SkPictureRecord.cpp.

348 {
349 this->recordClipRRect(rrect, op, kSoft_ClipEdgeStyle == edgeStyle);
351}
size_t recordClipRRect(const SkRRect &rrect, SkClipOp op, bool doAA)
SkRRect rrect
Definition: SkRecords.h:232

◆ onClipShader()

void SkPictureRecord::onClipShader ( sk_sp< SkShader cs,
SkClipOp  op 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 391 of file SkPictureRecord.cpp.

391 {
392 // Overkill to store a whole paint, but we don't have an existing structure to just store
393 // shaders. If size becomes an issue in the future, we can optimize this.
395 paint.setShader(cs);
396
397 // op + paint index + clipop
398 size_t size = 3 * kUInt32Size;
399 size_t initialOffset = this->addDraw(CLIP_SHADER_IN_PAINT, &size);
400 this->addPaint(paint);
401 this->addInt((int)op);
402 this->validate(initialOffset, size);
403
405}
@ CLIP_SHADER_IN_PAINT
const Paint & paint
Definition: color_source.cc:38

◆ onDoSaveBehind()

bool SkPictureRecord::onDoSaveBehind ( const SkRect subset)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 90 of file SkPictureRecord.cpp.

90 {
91 fRestoreOffsetStack.push_back(-(int32_t)fWriter.bytesWritten());
92
93 size_t size = sizeof(kUInt32Size) + sizeof(uint32_t); // op + flags
94 uint32_t flags = 0;
95 if (subset) {
97 size += sizeof(*subset);
98 }
99
100 size_t initialOffset = this->addDraw(SAVE_BEHIND, &size);
101 this->addInt(flags);
102 if (subset) {
103 this->addRect(*subset);
104 }
105
106 this->validate(initialOffset, size);
107 return false;
108}
@ SAVEBEHIND_HAS_SUBSET
@ SAVE_BEHIND

◆ onDrawAnnotation()

void SkPictureRecord::onDrawAnnotation ( const SkRect rect,
const char  key[],
SkData value 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 757 of file SkPictureRecord.cpp.

757 {
758 size_t keyLen = SkWriter32::WriteStringSize(key);
759 size_t valueLen = SkWriter32::WriteDataSize(value);
760 size_t size = 4 + sizeof(SkRect) + keyLen + valueLen;
761
762 size_t initialOffset = this->addDraw(DRAW_ANNOTATION, &size);
763 this->addRect(rect);
764 fWriter.writeString(key);
765 fWriter.writeData(value);
766 this->validate(initialOffset, size);
767}
@ DRAW_ANNOTATION
Definition: SkPictureFlat.h:91
static size_t WriteDataSize(const SkData *data)
Definition: SkWriter32.h:220
void writeData(const SkData *data)
Definition: SkWriter32.h:212
static size_t WriteStringSize(const char *str, size_t len=(size_t) -1)
Definition: SkWriter32.cpp:55
void writeString(const char *str, size_t len=(size_t) -1)
Definition: SkWriter32.cpp:38
uint8_t value

◆ onDrawArc()

void SkPictureRecord::onDrawArc ( const SkRect oval,
SkScalar  startAngle,
SkScalar  sweepAngle,
bool  useCenter,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 481 of file SkPictureRecord.cpp.

482 {
483 // op + paint index + rect + start + sweep + bool (as int)
484 size_t size = 2 * kUInt32Size + sizeof(oval) + sizeof(startAngle) + sizeof(sweepAngle) +
485 sizeof(int);
486 size_t initialOffset = this->addDraw(DRAW_ARC, &size);
487 this->addPaint(paint);
488 this->addRect(oval);
489 this->addScalar(startAngle);
490 this->addScalar(sweepAngle);
491 this->addInt(useCenter);
492 this->validate(initialOffset, size);
493}
@ DRAW_ARC
SkRect oval
Definition: SkRecords.h:249
SkScalar startAngle
Definition: SkRecords.h:250
SkScalar sweepAngle
Definition: SkRecords.h:251

◆ onDrawAtlas2()

void SkPictureRecord::onDrawAtlas2 ( const SkImage atlas,
const SkRSXform  xform[],
const SkRect  tex[],
const SkColor  colors[],
int  count,
SkBlendMode  mode,
const SkSamplingOptions sampling,
const SkRect cull,
const SkPaint paint 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 701 of file SkPictureRecord.cpp.

704 {
705 // [op + paint-index + atlas-index + flags + count] + [xform] + [tex] + [*colors + mode] + cull
706 size_t size = 5 * kUInt32Size + count * sizeof(SkRSXform) + count * sizeof(SkRect);
708 uint32_t flags = 0;
709 if (colors) {
711 size += count * sizeof(SkColor);
712 size += sizeof(uint32_t); // xfermode::mode
713 }
714 if (cull) {
716 size += sizeof(SkRect);
717 }
719
720 size_t initialOffset = this->addDraw(DRAW_ATLAS, &size);
721 this->addPaintPtr(paint);
722 this->addImage(atlas);
723 this->addInt(flags);
724 this->addInt(count);
725 fWriter.write(xform, count * sizeof(SkRSXform));
726 fWriter.write(tex, count * sizeof(SkRect));
727
728 // write optional parameters
729 if (colors) {
730 fWriter.write(colors, count * sizeof(SkColor));
731 this->addInt((int)mode);
732 }
733 if (cull) {
734 fWriter.write(cull, sizeof(SkRect));
735 }
736 this->addSampling(sampling);
737 this->validate(initialOffset, size);
738}
int count
Definition: FontMgrTest.cpp:50
uint32_t SkColor
Definition: SkColor.h:37
@ DRAW_ATLAS
Definition: SkPictureFlat.h:84
@ DRAW_ATLAS_HAS_SAMPLING
@ DRAW_ATLAS_HAS_COLORS
@ DRAW_ATLAS_HAS_CULL
static size_t FlatSize(const SkSamplingOptions &options)
sk_sp< const SkImage > atlas
Definition: SkRecords.h:331
PODArray< SkColor > colors
Definition: SkRecords.h:276
SkSamplingOptions sampling
Definition: SkRecords.h:337
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
Definition: switches.h:228

◆ onDrawBehind()

void SkPictureRecord::onDrawBehind ( const SkPaint paint)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 450 of file SkPictureRecord.cpp.

450 {
451 // logically the same as drawPaint, but with a diff enum
452 // op + paint index
453 size_t size = 2 * kUInt32Size;
454 size_t initialOffset = this->addDraw(DRAW_BEHIND_PAINT, &size);
455 this->addPaint(paint);
456 this->validate(initialOffset, size);
457}
@ DRAW_BEHIND_PAINT

◆ onDrawDrawable()

void SkPictureRecord::onDrawDrawable ( SkDrawable drawable,
const SkMatrix matrix 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 633 of file SkPictureRecord.cpp.

633 {
634 // op + drawable index
635 size_t size = 2 * kUInt32Size;
636 size_t initialOffset;
637
638 if (nullptr == matrix) {
639 initialOffset = this->addDraw(DRAW_DRAWABLE, &size);
640 this->addDrawable(drawable);
641 } else {
642 size += SkMatrixPriv::WriteToMemory(*matrix, nullptr); // matrix
643 initialOffset = this->addDraw(DRAW_DRAWABLE_MATRIX, &size);
644 this->addMatrix(*matrix);
645 this->addDrawable(drawable);
646 }
647 this->validate(initialOffset, size);
648}
@ DRAW_DRAWABLE
Definition: SkPictureFlat.h:92
@ DRAW_DRAWABLE_MATRIX
Definition: SkPictureFlat.h:93
static size_t WriteToMemory(const SkMatrix &matrix, void *buffer)
Definition: SkMatrixPriv.h:30
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ onDrawDRRect()

void SkPictureRecord::onDrawDRRect ( const SkRRect outer,
const SkRRect inner,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 523 of file SkPictureRecord.cpp.

524 {
525 // op + paint index + rrects
526 size_t size = 2 * kUInt32Size + SkRRect::kSizeInMemory * 2;
527 size_t initialOffset = this->addDraw(DRAW_DRRECT, &size);
528 this->addPaint(paint);
529 this->addRRect(outer);
530 this->addRRect(inner);
531 this->validate(initialOffset, size);
532}
@ DRAW_DRRECT
Definition: SkPictureFlat.h:75
static constexpr size_t kSizeInMemory
Definition: SkRRect.h:422

◆ onDrawEdgeAAImageSet2()

void SkPictureRecord::onDrawEdgeAAImageSet2 ( const  ImageSetEntry[],
int  count,
const SkPoint  dstClips[],
const SkMatrix  preViewMatrices[],
const SkSamplingOptions sampling,
const SkPaint paint,
SkCanvas::SrcRectConstraint  constraint 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 788 of file SkPictureRecord.cpp.

793 {
794 static constexpr size_t kMatrixSize = 9 * sizeof(SkScalar); // *not* sizeof(SkMatrix)
795 // op + count + paint + constraint + (image index, src rect, dst rect, alpha, aa flags,
796 // hasClip(int), matrixIndex) * cnt + totalClipCount + dstClips + totalMatrixCount + matrices
797 int totalDstClipCount, totalMatrixCount;
798 SkCanvasPriv::GetDstClipAndMatrixCounts(set, count, &totalDstClipCount, &totalMatrixCount);
799
800 size_t size = 6 * kUInt32Size + sizeof(SkPoint) * totalDstClipCount +
801 kMatrixSize * totalMatrixCount +
802 (4 * kUInt32Size + 2 * sizeof(SkRect) + sizeof(SkScalar)) * count +
804 size_t initialOffset = this->addDraw(DRAW_EDGEAA_IMAGE_SET2, &size);
805 this->addInt(count);
806 this->addPaintPtr(paint);
807 this->addSampling(sampling);
808 this->addInt((int) constraint);
809 for (int i = 0; i < count; ++i) {
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);
817 }
818 this->addInt(totalDstClipCount);
819 this->addPoints(dstClips, totalDstClipCount);
820 this->addInt(totalMatrixCount);
821 for (int i = 0; i < totalMatrixCount; ++i) {
822 this->addMatrix(preViewMatrices[i]);
823 }
824 this->validate(initialOffset, size);
825}
@ DRAW_EDGEAA_IMAGE_SET2
static void GetDstClipAndMatrixCounts(const SkCanvas::ImageSetEntry set[], int count, int *totalDstClipCount, int *totalMatrixCount)
PODArray< SkPoint > dstClips
Definition: SkRecords.h:364
PODArray< SkMatrix > preViewMatrices
Definition: SkRecords.h:365
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
Definition: switches.h:76

◆ onDrawEdgeAAQuad()

void SkPictureRecord::onDrawEdgeAAQuad ( const SkRect rect,
const SkPoint  clip[4],
SkCanvas::QuadAAFlags  aa,
const SkColor4f color,
SkBlendMode  mode 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 769 of file SkPictureRecord.cpp.

771 {
772
773 // op + rect + aa flags + color + mode + hasClip(as int) + clipCount*points
774 size_t size = 4 * kUInt32Size + sizeof(SkColor4f) + sizeof(rect) +
775 (clip ? 4 : 0) * sizeof(SkPoint);
776 size_t initialOffset = this->addDraw(DRAW_EDGEAA_QUAD, &size);
777 this->addRect(rect);
778 this->addInt((int) aa);
779 fWriter.write(&color, sizeof(SkColor4f));
780 this->addInt((int) mode);
781 this->addInt(clip != nullptr);
782 if (clip) {
783 this->addPoints(clip, 4);
784 }
785 this->validate(initialOffset, size);
786}
SkRGBA4f< kUnpremul_SkAlphaType > SkColor4f
Definition: SkColor.h:426
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
@ DRAW_EDGEAA_QUAD
DlColor color

◆ onDrawImage2()

void SkPictureRecord::onDrawImage2 ( const SkImage image,
SkScalar  x,
SkScalar  y,
const SkSamplingOptions sampling,
const SkPaint paint 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 543 of file SkPictureRecord.cpp.

544 {
545 // op + paint_index + image_index + x + y
546 size_t size = 3 * kUInt32Size + 2 * sizeof(SkScalar) + SkSamplingPriv::FlatSize(sampling);
547 size_t initialOffset = this->addDraw(DRAW_IMAGE2, &size);
548 this->addPaintPtr(paint);
549 this->addImage(image);
550 this->addScalar(x);
551 this->addScalar(y);
552 this->addSampling(sampling);
553 this->validate(initialOffset, size);
554}
@ DRAW_IMAGE2
sk_sp< const SkImage > image
Definition: SkRecords.h:269

◆ onDrawImageLattice2()

void SkPictureRecord::onDrawImageLattice2 ( const SkImage image,
const Lattice lattice,
const SkRect dst,
SkFilterMode  filter,
const SkPaint paint 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 573 of file SkPictureRecord.cpp.

575 {
576 size_t latticeSize = SkCanvasPriv::WriteLattice(nullptr, lattice);
577 // op + paint index + image index + lattice + dst rect
578 size_t size = 3 * kUInt32Size + latticeSize + sizeof(dst) + sizeof(uint32_t); // filter
579 size_t initialOffset = this->addDraw(DRAW_IMAGE_LATTICE2, &size);
580 this->addPaintPtr(paint);
581 this->addImage(image);
582 (void)SkCanvasPriv::WriteLattice(fWriter.reservePad(latticeSize), lattice);
583 this->addRect(dst);
584 this->addInt(static_cast<uint32_t>(filter));
585 this->validate(initialOffset, size);
586}
@ DRAW_IMAGE_LATTICE2
static void WriteLattice(SkWriteBuffer &, const SkCanvas::Lattice &)
uint32_t * reservePad(size_t size)
Definition: SkWriter32.h:179
dst
Definition: cp.py:12

◆ onDrawImageRect2()

void SkPictureRecord::onDrawImageRect2 ( const SkImage image,
const SkRect src,
const SkRect dst,
const SkSamplingOptions sampling,
const SkPaint paint,
SrcRectConstraint  constraint 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 556 of file SkPictureRecord.cpp.

558 {
559 // id + paint_index + image_index + constraint
560 size_t size = 3 * kUInt32Size + 2 * sizeof(dst) + SkSamplingPriv::FlatSize(sampling) +
562
563 size_t initialOffset = this->addDraw(DRAW_IMAGE_RECT2, &size);
564 this->addPaintPtr(paint);
565 this->addImage(image);
566 this->addRect(src);
567 this->addRect(dst);
568 this->addSampling(sampling);
569 this->addInt(constraint);
570 this->validate(initialOffset, size);
571}
@ DRAW_IMAGE_RECT2

◆ onDrawOval()

void SkPictureRecord::onDrawOval ( const SkRect oval,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 472 of file SkPictureRecord.cpp.

472 {
473 // op + paint index + rect
474 size_t size = 2 * kUInt32Size + sizeof(oval);
475 size_t initialOffset = this->addDraw(DRAW_OVAL, &size);
476 this->addPaint(paint);
477 this->addRect(oval);
478 this->validate(initialOffset, size);
479}
@ DRAW_OVAL
Definition: SkPictureFlat.h:45

◆ onDrawPaint()

void SkPictureRecord::onDrawPaint ( const SkPaint paint)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 442 of file SkPictureRecord.cpp.

442 {
443 // op + paint index
444 size_t size = 2 * kUInt32Size;
445 size_t initialOffset = this->addDraw(DRAW_PAINT, &size);
446 this->addPaint(paint);
447 this->validate(initialOffset, size);
448}
@ DRAW_PAINT
Definition: SkPictureFlat.h:46

◆ onDrawPatch()

void SkPictureRecord::onDrawPatch ( const SkPoint  cubics[12],
const SkColor  colors[4],
const SkPoint  texCoords[4],
SkBlendMode  bmode,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 664 of file SkPictureRecord.cpp.

666 {
667 // op + paint index + patch 12 control points + flag + patch 4 colors + 4 texture coordinates
669 uint32_t flag = 0;
670 if (colors) {
673 }
674 if (texCoords) {
677 }
678 if (SkBlendMode::kModulate != bmode) {
680 size += kUInt32Size;
681 }
682
683 size_t initialOffset = this->addDraw(DRAW_PATCH, &size);
684 this->addPaint(paint);
685 this->addPatch(cubics);
686 this->addInt(flag);
687
688 // write optional parameters
689 if (colors) {
690 fWriter.write(colors, SkPatchUtils::kNumCorners * sizeof(SkColor));
691 }
692 if (texCoords) {
693 fWriter.write(texCoords, SkPatchUtils::kNumCorners * sizeof(SkPoint));
694 }
696 this->addInt((int)bmode);
697 }
698 this->validate(initialOffset, size);
699}
@ kModulate
r = s*d
@ DRAW_PATCH
Definition: SkPictureFlat.h:79
@ DRAW_VERTICES_HAS_TEXS
@ DRAW_VERTICES_HAS_XFER
@ DRAW_VERTICES_HAS_COLORS
FlutterSemanticsFlag flag

◆ onDrawPath()

void SkPictureRecord::onDrawPath ( const SkPath path,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 534 of file SkPictureRecord.cpp.

534 {
535 // op + paint index + path index
536 size_t size = 3 * kUInt32Size;
537 size_t initialOffset = this->addDraw(DRAW_PATH, &size);
538 this->addPaint(paint);
539 this->addPath(path);
540 this->validate(initialOffset, size);
541}
@ DRAW_PATH
Definition: SkPictureFlat.h:47

◆ onDrawPicture()

void SkPictureRecord::onDrawPicture ( const SkPicture picture,
const SkMatrix matrix,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 613 of file SkPictureRecord.cpp.

614 {
615 // op + picture index
616 size_t size = 2 * kUInt32Size;
617 size_t initialOffset;
618
619 if (nullptr == matrix && nullptr == paint) {
620 initialOffset = this->addDraw(DRAW_PICTURE, &size);
621 this->addPicture(picture);
622 } else {
623 const SkMatrix& m = matrix ? *matrix : SkMatrix::I();
624 size += SkMatrixPriv::WriteToMemory(m, nullptr) + kUInt32Size; // matrix + paint
625 initialOffset = this->addDraw(DRAW_PICTURE_MATRIX_PAINT, &size);
626 this->addPaintPtr(paint);
627 this->addMatrix(m);
628 this->addPicture(picture);
629 }
630 this->validate(initialOffset, size);
631}
@ DRAW_PICTURE_MATRIX_PAINT
Definition: SkPictureFlat.h:80
@ DRAW_PICTURE
Definition: SkPictureFlat.h:48
static const SkMatrix & I()
Definition: SkMatrix.cpp:1544
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299

◆ onDrawPoints()

void SkPictureRecord::onDrawPoints ( PointMode  mode,
size_t  count,
const SkPoint  pts[],
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 459 of file SkPictureRecord.cpp.

460 {
461 // op + paint index + mode + count + point data
462 size_t size = 4 * kUInt32Size + count * sizeof(SkPoint);
463 size_t initialOffset = this->addDraw(DRAW_POINTS, &size);
464 this->addPaint(paint);
465
466 this->addInt(mode);
467 this->addInt(SkToInt(count));
468 fWriter.writeMul4(pts, count * sizeof(SkPoint));
469 this->validate(initialOffset, size);
470}
@ DRAW_POINTS
Definition: SkPictureFlat.h:49
constexpr int SkToInt(S x)
Definition: SkTo.h:29
void writeMul4(const void *values, size_t size)
Definition: SkWriter32.h:162

◆ onDrawRect()

void SkPictureRecord::onDrawRect ( const SkRect rect,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 495 of file SkPictureRecord.cpp.

495 {
496 // op + paint index + rect
497 size_t size = 2 * kUInt32Size + sizeof(rect);
498 size_t initialOffset = this->addDraw(DRAW_RECT, &size);
499 this->addPaint(paint);
500 this->addRect(rect);
501 this->validate(initialOffset, size);
502}
@ DRAW_RECT
Definition: SkPictureFlat.h:54

◆ onDrawRegion()

void SkPictureRecord::onDrawRegion ( const SkRegion region,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 504 of file SkPictureRecord.cpp.

504 {
505 // op + paint index + region
506 size_t regionBytes = region.writeToMemory(nullptr);
507 size_t size = 2 * kUInt32Size + regionBytes;
508 size_t initialOffset = this->addDraw(DRAW_REGION, &size);
509 this->addPaint(paint);
510 fWriter.writeRegion(region);
511 this->validate(initialOffset, size);
512}
@ DRAW_REGION
size_t writeToMemory(void *buffer) const
Definition: SkRegion.cpp:1149
void writeRegion(const SkRegion &rgn)
Definition: SkWriter32.h:153

◆ onDrawRRect()

void SkPictureRecord::onDrawRRect ( const SkRRect rrect,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 514 of file SkPictureRecord.cpp.

514 {
515 // op + paint index + rrect
517 size_t initialOffset = this->addDraw(DRAW_RRECT, &size);
518 this->addPaint(paint);
519 this->addRRect(rrect);
520 this->validate(initialOffset, size);
521}
@ DRAW_RRECT
Definition: SkPictureFlat.h:55

◆ onDrawShadowRec()

void SkPictureRecord::onDrawShadowRec ( const SkPath path,
const SkDrawShadowRec rec 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 740 of file SkPictureRecord.cpp.

740 {
741 // op + path index + zParams + lightPos + lightRadius + spot/ambient alphas + color + flags
742 size_t size = 2 * kUInt32Size + 2 * sizeof(SkPoint3) + 1 * sizeof(SkScalar) + 3 * kUInt32Size;
743 size_t initialOffset = this->addDraw(DRAW_SHADOW_REC, &size);
744
745 this->addPath(path);
746
747 fWriter.writePoint3(rec.fZPlaneParams);
748 fWriter.writePoint3(rec.fLightPos);
749 fWriter.writeScalar(rec.fLightRadius);
750 fWriter.write32(rec.fAmbientColor);
751 fWriter.write32(rec.fSpotColor);
752 fWriter.write32(rec.fFlags);
753
754 this->validate(initialOffset, size);
755}
@ DRAW_SHADOW_REC
Definition: SkPictureFlat.h:98
void write32(int32_t value)
Definition: SkWriter32.h:117
void writeScalar(SkScalar value)
Definition: SkWriter32.h:121
void writePoint3(const SkPoint3 &pt)
Definition: SkWriter32.h:129
SkPoint3 fZPlaneParams

◆ onDrawSlug()

void SkPictureRecord::onDrawSlug ( const sktext::gpu::Slug slug,
const SkPaint paint 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 603 of file SkPictureRecord.cpp.

603 {
604 // op + paint index + slug id
605 size_t size = 3 * kUInt32Size;
606 size_t initialOffset = this->addDraw(DRAW_SLUG, &size);
607
608 this->addPaint(paint);
609 this->addSlug(slug);
610 this->validate(initialOffset, size);
611}
@ DRAW_SLUG

◆ onDrawTextBlob()

void SkPictureRecord::onDrawTextBlob ( const SkTextBlob blob,
SkScalar  x,
SkScalar  y,
const SkPaint paint 
)
overrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 588 of file SkPictureRecord.cpp.

589 {
590
591 // op + paint index + blob index + x/y
592 size_t size = 3 * kUInt32Size + 2 * sizeof(SkScalar);
593 size_t initialOffset = this->addDraw(DRAW_TEXT_BLOB, &size);
594
595 this->addPaint(paint);
596 this->addTextBlob(blob);
597 this->addScalar(x);
598 this->addScalar(y);
599
600 this->validate(initialOffset, size);
601}
@ DRAW_TEXT_BLOB
Definition: SkPictureFlat.h:81

◆ onDrawVerticesObject()

void SkPictureRecord::onDrawVerticesObject ( const SkVertices vertices,
SkBlendMode  mode,
const SkPaint paint 
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 650 of file SkPictureRecord.cpp.

651 {
652 // op + paint index + vertices index + zero_bones + mode
653 size_t size = 5 * kUInt32Size;
654 size_t initialOffset = this->addDraw(DRAW_VERTICES_OBJECT, &size);
655
656 this->addPaint(paint);
657 this->addVertices(vertices);
658 this->addInt(0); // legacy bone count
659 this->addInt(static_cast<uint32_t>(mode));
660
661 this->validate(initialOffset, size);
662}
@ DRAW_VERTICES_OBJECT

◆ onNewSurface()

sk_sp< SkSurface > SkPictureRecord::onNewSurface ( const SkImageInfo info,
const SkSurfaceProps  
)
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 853 of file SkPictureRecord.cpp.

853 {
854 return nullptr;
855}

◆ onPeekPixels()

bool SkPictureRecord::onPeekPixels ( SkPixmap )
inlineoverrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 197 of file SkPictureRecord.h.

197{ return false; }

◆ onResetClip()

void SkPictureRecord::onResetClip ( )
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 429 of file SkPictureRecord.cpp.

429 {
430 if (!fRestoreOffsetStack.empty()) {
431 // Run back through any previous clip ops, and mark their offset to
432 // be 0, disabling their ability to trigger a jump-to-restore, otherwise
433 // they could hide this expansion of the clip.
434 this->fillRestoreOffsetPlaceholdersForCurrentStackLevel(0);
435 }
436 size_t size = sizeof(kUInt32Size);
437 size_t initialOffset = this->addDraw(RESET_CLIP, &size);
438 this->validate(initialOffset, size);
440}
@ RESET_CLIP
bool empty() const
Definition: SkTDArray.h:135

◆ opData()

sk_sp< SkData > SkPictureRecord::opData ( ) const
inline

Definition at line 97 of file SkPictureRecord.h.

97 {
98 this->validate(fWriter.bytesWritten(), 0);
99
100 if (fWriter.bytesWritten() == 0) {
101 return SkData::MakeEmpty();
102 }
103 return fWriter.snapshotAsData();
104 }
static sk_sp< SkData > MakeEmpty()
Definition: SkData.cpp:94
sk_sp< SkData > snapshotAsData() const
Definition: SkWriter32.cpp:78

◆ recordClipPath()

size_t SkPictureRecord::recordClipPath ( int  pathID,
SkClipOp  op,
bool  doAA 
)
protected

Definition at line 375 of file SkPictureRecord.cpp.

375 {
376 // op + path index + clip params
377 size_t size = 3 * kUInt32Size;
378 // recordRestoreOffsetPlaceholder doesn't always write an offset
379 if (!fRestoreOffsetStack.empty()) {
380 // + restore offset
381 size += kUInt32Size;
382 }
383 size_t initialOffset = this->addDraw(CLIP_PATH, &size);
384 this->addInt(pathID);
385 this->addInt(ClipParams_pack(op, doAA));
386 size_t offset = recordRestoreOffsetPlaceholder();
387 this->validate(initialOffset, size);
388 return offset;
389}
@ CLIP_PATH
Definition: SkPictureFlat.h:34
static uint32_t ClipParams_pack(SkClipOp op, bool doAA)
SeparatedVector2 offset

◆ recordClipRect()

size_t SkPictureRecord::recordClipRect ( const SkRect rect,
SkClipOp  op,
bool  doAA 
)
protected

Definition at line 331 of file SkPictureRecord.cpp.

331 {
332 // id + rect + clip params
333 size_t size = 1 * kUInt32Size + sizeof(rect) + 1 * kUInt32Size;
334 // recordRestoreOffsetPlaceholder doesn't always write an offset
335 if (!fRestoreOffsetStack.empty()) {
336 // + restore offset
337 size += kUInt32Size;
338 }
339 size_t initialOffset = this->addDraw(CLIP_RECT, &size);
340 this->addRect(rect);
341 this->addInt(ClipParams_pack(op, doAA));
342 size_t offset = this->recordRestoreOffsetPlaceholder();
343
344 this->validate(initialOffset, size);
345 return offset;
346}
@ CLIP_RECT
Definition: SkPictureFlat.h:36

◆ recordClipRegion()

size_t SkPictureRecord::recordClipRegion ( const SkRegion region,
SkClipOp  op 
)
protected

Definition at line 412 of file SkPictureRecord.cpp.

412 {
413 // op + clip params + region
414 size_t size = 2 * kUInt32Size + region.writeToMemory(nullptr);
415 // recordRestoreOffsetPlaceholder doesn't always write an offset
416 if (!fRestoreOffsetStack.empty()) {
417 // + restore offset
418 size += kUInt32Size;
419 }
420 size_t initialOffset = this->addDraw(CLIP_REGION, &size);
421 this->addRegion(region);
422 this->addInt(ClipParams_pack(op, false));
423 size_t offset = this->recordRestoreOffsetPlaceholder();
424
425 this->validate(initialOffset, size);
426 return offset;
427}
@ CLIP_REGION
Definition: SkPictureFlat.h:35

◆ recordClipRRect()

size_t SkPictureRecord::recordClipRRect ( const SkRRect rrect,
SkClipOp  op,
bool  doAA 
)
protected

Definition at line 353 of file SkPictureRecord.cpp.

353 {
354 // op + rrect + clip params
356 // recordRestoreOffsetPlaceholder doesn't always write an offset
357 if (!fRestoreOffsetStack.empty()) {
358 // + restore offset
359 size += kUInt32Size;
360 }
361 size_t initialOffset = this->addDraw(CLIP_RRECT, &size);
362 this->addRRect(rrect);
363 this->addInt(ClipParams_pack(op, doAA));
364 size_t offset = recordRestoreOffsetPlaceholder();
365 this->validate(initialOffset, size);
366 return offset;
367}
@ CLIP_RRECT
Definition: SkPictureFlat.h:37

◆ recordConcat()

void SkPictureRecord::recordConcat ( const SkMatrix matrix)
protected

Definition at line 268 of file SkPictureRecord.cpp.

268 {
269 this->validate(fWriter.bytesWritten(), 0);
270 // op + matrix
272 size_t initialOffset = this->addDraw(CONCAT, &size);
273 this->addMatrix(matrix);
274 this->validate(initialOffset, size);
275}
@ CONCAT
Definition: SkPictureFlat.h:38

◆ recordRestore()

void SkPictureRecord::recordRestore ( bool  fillInSkips = true)
protected

Definition at line 208 of file SkPictureRecord.cpp.

208 {
209 if (fillInSkips) {
210 this->fillRestoreOffsetPlaceholdersForCurrentStackLevel((uint32_t)fWriter.bytesWritten());
211 }
212 size_t size = 1 * kUInt32Size; // RESTORE consists solely of 1 op code
213 size_t initialOffset = this->addDraw(RESTORE, &size);
214 this->validate(initialOffset, size);
215}
@ RESTORE
Definition: SkPictureFlat.h:61

◆ recordSave()

void SkPictureRecord::recordSave ( )
protected

Definition at line 67 of file SkPictureRecord.cpp.

67 {
68 // op only
69 size_t size = sizeof(kUInt32Size);
70 size_t initialOffset = this->addDraw(SAVE, &size);
71
72 this->validate(initialOffset, size);
73}
@ SAVE
Definition: SkPictureFlat.h:63

◆ recordSaveLayer()

void SkPictureRecord::recordSaveLayer ( const SaveLayerRec rec)
protected

Definition at line 110 of file SkPictureRecord.cpp.

110 {
111 // op + flatflags
112 size_t size = 2 * kUInt32Size;
113 uint32_t flatFlags = 0;
114 uint32_t filterCount = SkToU32(rec.fFilters.size());
115
116 if (rec.fBounds) {
117 flatFlags |= SAVELAYERREC_HAS_BOUNDS;
118 size += sizeof(*rec.fBounds);
119 }
120 if (rec.fPaint) {
121 flatFlags |= SAVELAYERREC_HAS_PAINT;
122 size += sizeof(uint32_t); // index
123 }
124 if (rec.fBackdrop) {
125 flatFlags |= SAVELAYERREC_HAS_BACKDROP;
126 size += sizeof(uint32_t); // (paint) index
127 }
128 if (rec.fSaveLayerFlags) {
129 flatFlags |= SAVELAYERREC_HAS_FLAGS;
130 size += sizeof(uint32_t);
131 }
132 if (SkCanvasPriv::GetBackdropScaleFactor(rec) != 1.f) {
134 size += sizeof(SkScalar);
135 }
136 if (filterCount) {
138 size += sizeof(uint32_t); // count
139 size += sizeof(uint32_t) * filterCount; // N (paint) indices
140 }
141
142 const size_t initialOffset = this->addDraw(SAVE_LAYER_SAVELAYERREC, &size);
143 this->addInt(flatFlags);
144 if (flatFlags & SAVELAYERREC_HAS_BOUNDS) {
145 this->addRect(*rec.fBounds);
146 }
147 if (flatFlags & SAVELAYERREC_HAS_PAINT) {
148 this->addPaintPtr(rec.fPaint);
149 }
150 if (flatFlags & SAVELAYERREC_HAS_BACKDROP) {
151 // overkill, but we didn't already track single flattenables, so using a paint for that
153 paint.setImageFilter(sk_ref_sp(const_cast<SkImageFilter*>(rec.fBackdrop)));
154 this->addPaint(paint);
155 }
156 if (flatFlags & SAVELAYERREC_HAS_FLAGS) {
157 this->addInt(rec.fSaveLayerFlags);
158 }
159 if (flatFlags & SAVELAYERREC_HAS_BACKDROP_SCALE) {
160 this->addScalar(SkCanvasPriv::GetBackdropScaleFactor(rec));
161 }
162 if (flatFlags & SAVELAYERREC_HAS_MULTIPLE_FILTERS) {
163 this->addInt(filterCount);
164 for (uint32_t i = 0; i < filterCount; ++i) {
165 // overkill to store a paint, oh well.
167 paint.setImageFilter(rec.fFilters[i]);
168 this->addPaint(paint);
169 }
170 }
171 this->validate(initialOffset, size);
172}
@ SAVE_LAYER_SAVELAYERREC
Definition: SkPictureFlat.h:89
@ SAVELAYERREC_HAS_FLAGS
@ SAVELAYERREC_HAS_BACKDROP_SCALE
@ SAVELAYERREC_HAS_MULTIPLE_FILTERS
@ SAVELAYERREC_HAS_PAINT
@ SAVELAYERREC_HAS_BACKDROP
@ SAVELAYERREC_HAS_BOUNDS
sk_sp< T > sk_ref_sp(T *obj)
Definition: SkRefCnt.h:381
constexpr uint32_t SkToU32(S x)
Definition: SkTo.h:26
static SkScalar GetBackdropScaleFactor(const SkCanvas::SaveLayerRec &rec)
Definition: SkCanvasPriv.h:85

◆ recordScale()

void SkPictureRecord::recordScale ( const SkMatrix matrix)
protected

Definition at line 228 of file SkPictureRecord.cpp.

228 {
229 SkASSERT(SkMatrix::kScale_Mask == m.getType());
230
231 // op + sx + sy
232 size_t size = 1 * kUInt32Size + 2 * sizeof(SkScalar);
233 size_t initialOffset = this->addDraw(SCALE, &size);
234 this->addScalar(m.getScaleX());
235 this->addScalar(m.getScaleY());
236 this->validate(initialOffset, size);
237}
@ SCALE
Definition: SkPictureFlat.h:65
@ kScale_Mask
scale SkMatrix
Definition: SkMatrix.h:194

◆ recordTranslate()

void SkPictureRecord::recordTranslate ( const SkMatrix matrix)
protected

Definition at line 217 of file SkPictureRecord.cpp.

217 {
219
220 // op + dx + dy
221 size_t size = 1 * kUInt32Size + 2 * sizeof(SkScalar);
222 size_t initialOffset = this->addDraw(TRANSLATE, &size);
223 this->addScalar(m.getTranslateX());
224 this->addScalar(m.getTranslateY());
225 this->validate(initialOffset, size);
226}
@ TRANSLATE
Definition: SkPictureFlat.h:68
@ kTranslate_Mask
translation SkMatrix
Definition: SkMatrix.h:193

◆ setFlags()

void SkPictureRecord::setFlags ( uint32_t  recordFlags)
inline

Definition at line 106 of file SkPictureRecord.h.

106 {
107 fRecordFlags = recordFlags;
108 }

◆ validate()

void SkPictureRecord::validate ( size_t  initialOffset,
size_t  size 
) const
inlineprotected

Definition at line 192 of file SkPictureRecord.h.

192 {
193 SkASSERT(fWriter.bytesWritten() == initialOffset + size);
194 }

◆ willRestore()

void SkPictureRecord::willRestore ( )
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 191 of file SkPictureRecord.cpp.

191 {
192#if 0
193 SkASSERT(fRestoreOffsetStack.count() > 1);
194#endif
195
196 // check for underflow
197 if (fRestoreOffsetStack.empty()) {
198 return;
199 }
200
201 this->recordRestore();
202
203 fRestoreOffsetStack.pop_back();
204
206}
void recordRestore(bool fillInSkips=true)
void pop_back()
Definition: SkTDArray.h:223

◆ willSave()

void SkPictureRecord::willSave ( )
overrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 58 of file SkPictureRecord.cpp.

58 {
59 // record the offset to us, making it non-positive to distinguish a save
60 // from a clip entry.
61 fRestoreOffsetStack.push_back(-(int32_t)fWriter.bytesWritten());
62 this->recordSave();
63
65}

◆ writeStream()

const SkWriter32 & SkPictureRecord::writeStream ( ) const
inline

Definition at line 110 of file SkPictureRecord.h.

110 {
111 return fWriter;
112 }

Friends And Related Function Documentation

◆ SkPictureData

friend class SkPictureData
friend

Definition at line 292 of file SkPictureRecord.h.


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