Flutter Engine
The Flutter Engine
Public Member Functions | Protected Member Functions | List of all members
MSKPPlayer::CmdRecordCanvas Class Reference
Inheritance diagram for MSKPPlayer::CmdRecordCanvas:
SkCanvasVirtualEnforcer< SkCanvas > SkCanvas

Public Member Functions

 CmdRecordCanvas (LayerCmds *dst, LayerMap *offscreenLayers, const SkIRect *clipRect=nullptr)
 
 ~CmdRecordCanvas () override
 
- 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 onDrawPaint (const SkPaint &paint) override
 
void onDrawBehind (const SkPaint &paint) override
 
void onDrawRect (const SkRect &rect, const SkPaint &paint) override
 
void onDrawRRect (const SkRRect &rrect, const SkPaint &paint) override
 
void onDrawDRRect (const SkRRect &outer, const SkRRect &inner, const SkPaint &paint) override
 
void onDrawOval (const SkRect &rect, const SkPaint &paint) override
 
void onDrawArc (const SkRect &rect, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint) override
 
void onDrawPath (const SkPath &path, const SkPaint &paint) override
 
void onDrawRegion (const SkRegion &region, const SkPaint &paint) override
 
void onDrawTextBlob (const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
 
void onDrawPatch (const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint) override
 
void onDrawPoints (SkCanvas::PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint) override
 
void onDrawImage2 (const SkImage *image, SkScalar dx, SkScalar dy, const SkSamplingOptions &sampling, const SkPaint *paint) override
 
void onDrawImageRect2 (const SkImage *image, const SkRect &src, const SkRect &dst, const SkSamplingOptions &sampling, const SkPaint *paint, SrcRectConstraint constraint) override
 
void onDrawImageLattice2 (const SkImage *image, const Lattice &lattice, const SkRect &dst, SkFilterMode mode, const SkPaint *paint) override
 
void onDrawAtlas2 (const SkImage *image, const SkRSXform rsxForms[], const SkRect src[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cull, const SkPaint *paint) override
 
void onDrawEdgeAAImageSet2 (const ImageSetEntry imageSet[], int count, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &sampling, const SkPaint *paint, SrcRectConstraint constraint) override
 
void onDrawEdgeAAQuad (const SkRect &rect, const SkPoint clip[4], SkCanvas::QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode) override
 
void onDrawAnnotation (const SkRect &rect, const char key[], SkData *value) override
 
void onDrawShadowRec (const SkPath &path, const SkDrawShadowRec &rec) override
 
void onDrawDrawable (SkDrawable *drawable, const SkMatrix *matrix) override
 
void onDrawPicture (const SkPicture *picture, const SkMatrix *matrix, const SkPaint *paint) override
 
- 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)
 

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 123 of file MSKPPlayer.cpp.

Constructor & Destructor Documentation

◆ CmdRecordCanvas()

MSKPPlayer::CmdRecordCanvas::CmdRecordCanvas ( LayerCmds *  dst,
LayerMap *  offscreenLayers,
const SkIRect clipRect = nullptr 
)
inline

Definition at line 125 of file MSKPPlayer.cpp.

126 : fDst(dst), fOffscreenLayers(offscreenLayers) {
127 if (clipRect) {
128 fClipRect = *clipRect;
129 }
130 fRecorder.beginRecording(SkRect::Make(dst->fDimensions));
131 }
void clipRect(const SkRect &rect, SkClipOp op, bool doAntiAlias)
Definition: SkCanvas.cpp:1361
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
dst
Definition: cp.py:12
static SkRect Make(const SkISize &size)
Definition: SkRect.h:669

◆ ~CmdRecordCanvas()

MSKPPlayer::CmdRecordCanvas::~CmdRecordCanvas ( )
inlineoverride

Definition at line 132 of file MSKPPlayer.cpp.

132{ this->recordPicCmd(); }

Member Function Documentation

◆ onDrawAnnotation()

void MSKPPlayer::CmdRecordCanvas::onDrawAnnotation ( const SkRect rect,
const char  key[],
SkData value 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 294 of file MSKPPlayer.cpp.

294 {
295 static constexpr char kOffscreenLayerDraw[] = "OffscreenLayerDraw";
296 static constexpr char kSurfaceID[] = "SurfaceID";
299 if (tokens.size() == 2) {
300 if (tokens[0].equals(kOffscreenLayerDraw)) {
301 // Indicates that the next drawPicture command contains the SkPicture to render
302 // to the layer identified by the ID. 'rect' indicates the dirty area to update
303 // (and indicates the layer size if this command is introducing a new layer id).
304 fNextDrawPictureToLayerID = std::stoi(tokens[1].c_str());
305 fNextDrawPictureToLayerClipRect = rect.roundOut();
306 if (fOffscreenLayers->find(fNextDrawPictureToLayerID) == fOffscreenLayers->end()) {
307 SkASSERT(fNextDrawPictureToLayerClipRect.left() == 0 &&
308 fNextDrawPictureToLayerClipRect.top() == 0);
309 (*fOffscreenLayers)[fNextDrawPictureToLayerID].fDimensions =
310 fNextDrawPictureToLayerClipRect.size();
311 }
312 // The next draw picture will notice that fNextDrawPictureToLayerID is set and
313 // redirect the picture to the offscreen layer.
314 return;
315 } else if (tokens[0].equals(kSurfaceID)) {
316 // Indicates that the following drawImageRect should draw an offscreen layer
317 // to this layer.
318 fNextDrawImageFromLayerID = std::stoi(tokens[1].c_str());
319 return;
320 }
321 }
322 }
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool equals(SkDrawable *a, SkDrawable *b)
void SkStrSplit(const char *str, const char *delimiters, SkStrSplitMode splitMode, TArray< SkString > *out)
@ kStrict_SkStrSplitMode
Definition: SkStringUtils.h:47
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
bool stoi(std::string_view s, SKSL_INT *value)
Definition: SkSLString.cpp:66
constexpr int32_t top() const
Definition: SkRect.h:120
constexpr SkISize size() const
Definition: SkRect.h:172
constexpr int32_t left() const
Definition: SkRect.h:113

◆ onDrawArc()

void MSKPPlayer::CmdRecordCanvas::onDrawArc ( const SkRect rect,
SkScalar  startAngle,
SkScalar  sweepAngle,
bool  useCenter,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 159 of file MSKPPlayer.cpp.

163 {
164 fRecorder.getRecordingCanvas()->drawArc(rect, startAngle, sweepAngle, useCenter, paint);
165 }
void drawArc(const SkRect &oval, SkScalar startAngle, SkScalar sweepAngle, bool useCenter, const SkPaint &paint)
Definition: SkCanvas.cpp:2728
SkCanvas * getRecordingCanvas()
const Paint & paint
Definition: color_source.cc:38
SkScalar startAngle
Definition: SkRecords.h:250
SkScalar sweepAngle
Definition: SkRecords.h:251

◆ onDrawAtlas2()

void MSKPPlayer::CmdRecordCanvas::onDrawAtlas2 ( const SkImage image,
const SkRSXform  rsxForms[],
const SkRect  src[],
const SkColor  colors[],
int  count,
SkBlendMode  mode,
const SkSamplingOptions sampling,
const SkRect cull,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 238 of file MSKPPlayer.cpp.

246 {
248 rsxForms,
249 src,
250 colors,
251 count,
252 mode,
253 sampling,
254 cull,
255 paint);
256 }
int count
Definition: FontMgrTest.cpp:50
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)
Definition: SkCanvas.cpp:1810
sk_sp< const SkImage > image
Definition: SkRecords.h:269
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 MSKPPlayer::CmdRecordCanvas::onDrawBehind ( const SkPaint paint)
inlineoverrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 139 of file MSKPPlayer.cpp.

139 {
141 }
static void DrawBehind(SkCanvas *canvas, const SkPaint &paint)
Definition: SkCanvasPriv.h:56

◆ onDrawDrawable()

void MSKPPlayer::CmdRecordCanvas::onDrawDrawable ( SkDrawable drawable,
const SkMatrix matrix 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 328 of file MSKPPlayer.cpp.

328 {
329 fRecorder.getRecordingCanvas()->drawDrawable(drawable, matrix);
330 }
void drawDrawable(SkDrawable *drawable, const SkMatrix *matrix=nullptr)
Definition: SkCanvas.cpp:2574
unsigned useCenter Optional< SkMatrix > matrix
Definition: SkRecords.h:258

◆ onDrawDRRect()

void MSKPPlayer::CmdRecordCanvas::onDrawDRRect ( const SkRRect outer,
const SkRRect inner,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 151 of file MSKPPlayer.cpp.

151 {
152 fRecorder.getRecordingCanvas()->drawDRRect(outer, inner, paint);
153 }
void drawDRRect(const SkRRect &outer, const SkRRect &inner, const SkPaint &paint)
Definition: SkCanvas.cpp:1645

◆ onDrawEdgeAAImageSet2()

void MSKPPlayer::CmdRecordCanvas::onDrawEdgeAAImageSet2 ( const ImageSetEntry  imageSet[],
int  count,
const SkPoint  dstClips[],
const SkMatrix  preViewMatrices[],
const SkSamplingOptions sampling,
const SkPaint paint,
SrcRectConstraint  constraint 
)
inlineoverrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 258 of file MSKPPlayer.cpp.

264 {
266 count,
267 dstClips,
269 sampling,
270 paint,
271 constraint);
272 }
void experimental_DrawEdgeAAImageSet(const ImageSetEntry imageSet[], int cnt, const SkPoint dstClips[], const SkMatrix preViewMatrices[], const SkSamplingOptions &, const SkPaint *paint=nullptr, SrcRectConstraint constraint=kStrict_SrcRectConstraint)
Definition: SkCanvas.cpp:1853
PODArray< SkPoint > dstClips
Definition: SkRecords.h:364
PODArray< SkMatrix > preViewMatrices
Definition: SkRecords.h:365

◆ onDrawEdgeAAQuad()

void MSKPPlayer::CmdRecordCanvas::onDrawEdgeAAQuad ( const SkRect rect,
const SkPoint  clip[4],
SkCanvas::QuadAAFlags  aaFlags,
const SkColor4f color,
SkBlendMode  mode 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 281 of file MSKPPlayer.cpp.

285 {
287 clip,
288 aaFlags,
289 color,
290 mode);
291 }
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
void experimental_DrawEdgeAAQuad(const SkRect &rect, const SkPoint clip[4], QuadAAFlags aaFlags, const SkColor4f &color, SkBlendMode mode)
Definition: SkCanvas.cpp:1845
DlColor color

◆ onDrawImage2()

void MSKPPlayer::CmdRecordCanvas::onDrawImage2 ( const SkImage image,
SkScalar  dx,
SkScalar  dy,
const SkSamplingOptions sampling,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 197 of file MSKPPlayer.cpp.

201 {
202 fRecorder.getRecordingCanvas()->drawImage(image, dx, dy, sampling, paint);
203 }
void drawImage(const SkImage *image, SkScalar left, SkScalar top)
Definition: SkCanvas.h:1528
skia_private::AutoTArray< sk_sp< SkImageFilter > > filters TypedMatrix matrix TypedMatrix matrix SkScalar dx
Definition: SkRecords.h:208

◆ onDrawImageLattice2()

void MSKPPlayer::CmdRecordCanvas::onDrawImageLattice2 ( const SkImage image,
const Lattice lattice,
const SkRect dst,
SkFilterMode  mode,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 230 of file MSKPPlayer.cpp.

234 {
235 fRecorder.getRecordingCanvas()->drawImageLattice(image, lattice, dst, mode, paint);
236 }
void drawImageLattice(const SkImage *image, const Lattice &lattice, const SkRect &dst, SkFilterMode filter, const SkPaint *paint=nullptr)
Definition: SkCanvas.cpp:1786

◆ onDrawImageRect2()

void MSKPPlayer::CmdRecordCanvas::onDrawImageRect2 ( const SkImage image,
const SkRect src,
const SkRect dst,
const SkSamplingOptions sampling,
const SkPaint paint,
SrcRectConstraint  constraint 
)
inlineoverrideprotectedvirtual

Reimplemented from SkCanvas.

Definition at line 205 of file MSKPPlayer.cpp.

210 {
211 if (fNextDrawImageFromLayerID != -1) {
212 this->recordPicCmd();
213 auto drawLayer = std::make_unique<DrawLayerCmd>();
214 drawLayer->fLayerId = fNextDrawImageFromLayerID;
215 drawLayer->fLayerCmdCnt = fOffscreenLayers->at(fNextDrawImageFromLayerID).fCmds.size();
216 drawLayer->fSrcRect = src;
217 drawLayer->fDstRect = dst;
218 drawLayer->fSampling = sampling;
219 drawLayer->fConstraint = constraint;
220 if (paint) {
221 drawLayer->fPaint.init(*paint);
222 }
223 fDst->fCmds.push_back(std::move(drawLayer));
224 fNextDrawImageFromLayerID = -1;
225 return;
226 }
227 fRecorder.getRecordingCanvas()->drawImageRect(image, src, dst, sampling, paint, constraint);
228 }
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
Definition: SkCanvas.cpp:2333

◆ onDrawOval()

void MSKPPlayer::CmdRecordCanvas::onDrawOval ( const SkRect rect,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 155 of file MSKPPlayer.cpp.

155 {
156 fRecorder.getRecordingCanvas()->drawOval(rect, paint);
157 }
void drawOval(const SkRect &oval, const SkPaint &paint)
Definition: SkCanvas.cpp:1698

◆ onDrawPaint()

void MSKPPlayer::CmdRecordCanvas::onDrawPaint ( const SkPaint paint)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 135 of file MSKPPlayer.cpp.

135 {
136 fRecorder.getRecordingCanvas()->drawPaint(paint);
137 }
void drawPaint(const SkPaint &paint)
Definition: SkCanvas.cpp:1668

◆ onDrawPatch()

void MSKPPlayer::CmdRecordCanvas::onDrawPatch ( const SkPoint  cubics[12],
const SkColor  colors[4],
const SkPoint  texCoords[4],
SkBlendMode  mode,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 182 of file MSKPPlayer.cpp.

186 {
187 fRecorder.getRecordingCanvas()->drawPatch(cubics, colors, texCoords, mode, paint);
188 }
void drawPatch(const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode mode, const SkPaint &paint)
Definition: SkCanvas.cpp:2529

◆ onDrawPath()

void MSKPPlayer::CmdRecordCanvas::onDrawPath ( const SkPath path,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 167 of file MSKPPlayer.cpp.

167 {
168 fRecorder.getRecordingCanvas()->drawPath(path, paint);
169 }
void drawPath(const SkPath &path, const SkPaint &paint)
Definition: SkCanvas.cpp:1747
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

◆ onDrawPicture()

void MSKPPlayer::CmdRecordCanvas::onDrawPicture ( const SkPicture picture,
const SkMatrix matrix,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 332 of file MSKPPlayer.cpp.

334 {
335 if (fNextDrawPictureToLayerID != -1) {
337 SkASSERT(!paint);
338 LayerCmds* layer = &fOffscreenLayers->at(fNextDrawPictureToLayerID);
339 CmdRecordCanvas sc(layer, fOffscreenLayers, &fNextDrawPictureToLayerClipRect);
340 picture->playback(&sc);
341 fNextDrawPictureToLayerID = -1;
342 fNextDrawPictureToLayerClipRect = SkIRect::MakeEmpty();
343 return;
344 }
345 if (paint) {
346 this->saveLayer(nullptr, paint);
347 }
348 if (matrix) {
349 this->save();
350 this->concat(*matrix);
351 }
352
353 picture->playback(this);
354
355 if (matrix) {
356 this->restore();
357 }
358 if (paint) {
359 this->restore();
360 }
361 }
CmdRecordCanvas(LayerCmds *dst, LayerMap *offscreenLayers, const SkIRect *clipRect=nullptr)
Definition: MSKPPlayer.cpp:125
int saveLayer(const SkRect *bounds, const SkPaint *paint)
Definition: SkCanvas.cpp:496
void restore()
Definition: SkCanvas.cpp:461
int save()
Definition: SkCanvas.cpp:447
void concat(const SkMatrix &matrix)
Definition: SkCanvas.cpp:1318
virtual void playback(SkCanvas *canvas, AbortCallback *callback=nullptr) const =0
sk_sp< const SkPicture > picture
Definition: SkRecords.h:299
static constexpr SkIRect MakeEmpty()
Definition: SkRect.h:45

◆ onDrawPoints()

void MSKPPlayer::CmdRecordCanvas::onDrawPoints ( SkCanvas::PointMode  mode,
size_t  count,
const SkPoint  pts[],
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 190 of file MSKPPlayer.cpp.

193 {
194 fRecorder.getRecordingCanvas()->drawPoints(mode, count, pts, paint);
195 }
void drawPoints(PointMode mode, size_t count, const SkPoint pts[], const SkPaint &paint)
Definition: SkCanvas.cpp:1710

◆ onDrawRect()

void MSKPPlayer::CmdRecordCanvas::onDrawRect ( const SkRect rect,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 143 of file MSKPPlayer.cpp.

143 {
144 fRecorder.getRecordingCanvas()->drawRect(rect, paint);
145 }
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673

◆ onDrawRegion()

void MSKPPlayer::CmdRecordCanvas::onDrawRegion ( const SkRegion region,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 171 of file MSKPPlayer.cpp.

171 {
173 }
void drawRegion(const SkRegion &region, const SkPaint &paint)
Definition: SkCanvas.cpp:1685
ClipOpAndAA opAA SkRegion region
Definition: SkRecords.h:238

◆ onDrawRRect()

void MSKPPlayer::CmdRecordCanvas::onDrawRRect ( const SkRRect rrect,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 147 of file MSKPPlayer.cpp.

147 {
149 }
void drawRRect(const SkRRect &rrect, const SkPaint &paint)
Definition: SkCanvas.cpp:1705
SkRRect rrect
Definition: SkRecords.h:232

◆ onDrawShadowRec()

void MSKPPlayer::CmdRecordCanvas::onDrawShadowRec ( const SkPath path,
const SkDrawShadowRec rec 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 324 of file MSKPPlayer.cpp.

324 {
326 }
void private_draw_shadow_rec(const SkPath &, const SkDrawShadowRec &)
Definition: SkCanvas.cpp:1831

◆ onDrawTextBlob()

void MSKPPlayer::CmdRecordCanvas::onDrawTextBlob ( const SkTextBlob blob,
SkScalar  x,
SkScalar  y,
const SkPaint paint 
)
inlineoverrideprotectedvirtual

Implements SkCanvasVirtualEnforcer< SkCanvas >.

Definition at line 175 of file MSKPPlayer.cpp.

178 {
179 fRecorder.getRecordingCanvas()->drawTextBlob(blob, x, y, paint);
180 }
void drawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint)
Definition: SkCanvas.cpp:2484
double y
double x

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