Flutter Engine
The Flutter Engine
Public Member Functions | Public Attributes | List of all members
OveridePaintFilterCanvas Class Reference
Inheritance diagram for OveridePaintFilterCanvas:
SkPaintFilterCanvas SkCanvasVirtualEnforcer< SkNWayCanvas > SkNWayCanvas SkCanvasVirtualEnforcer< SkNoDrawCanvas > SkNoDrawCanvas SkCanvasVirtualEnforcer< SkCanvas > SkCanvas

Public Member Functions

 OveridePaintFilterCanvas (SkCanvas *canvas, SkPaint *paint, Viewer::SkPaintFields *pfields, SkFont *font, Viewer::SkFontFields *ffields)
 
const SkTextBlobfilterTextBlob (const SkPaint &paint, const SkTextBlob *blob, sk_sp< SkTextBlob > *cache)
 
void onDrawTextBlob (const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
 
void onDrawGlyphRunList (const sktext::GlyphRunList &glyphRunList, const SkPaint &paint) override
 
bool filterFont (SkTCopyOnFirstWrite< SkFont > *font) const
 
bool onFilter (SkPaint &paint) const override
 
- Public Member Functions inherited from SkPaintFilterCanvas
 SkPaintFilterCanvas (SkCanvas *canvas)
 
SkISize getBaseLayerSize () const override
 
GrRecordingContextrecordingContext () const override
 
- Public Member Functions inherited from SkNWayCanvas
 SkNWayCanvas (int width, int height)
 
 ~SkNWayCanvas () override
 
virtual void addCanvas (SkCanvas *)
 
virtual void removeCanvas (SkCanvas *)
 
virtual void removeAll ()
 
- Public Member Functions inherited from SkNoDrawCanvas
 SkNoDrawCanvas (int width, int height)
 
 SkNoDrawCanvas (const SkIRect &)
 
void resetCanvas (int w, int h)
 
void resetCanvas (const SkIRect &rect)
 
- 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 &)
 

Public Attributes

SkPaintfPaint
 
Viewer::SkPaintFieldsfPaintOverrides
 
SkFontfFont
 
Viewer::SkFontFieldsfFontOverrides
 

Additional Inherited Members

- Public Types inherited from SkPaintFilterCanvas
enum  Type { kPicture_Type }
 
- 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 }
 
- Protected Member Functions inherited from SkPaintFilterCanvas
virtual bool onFilter (SkPaint &paint) const =0
 
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 onDrawRRect (const SkRRect &, const SkPaint &) override
 
void onDrawDRRect (const SkRRect &, const SkRRect &, 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 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 onDrawVerticesObject (const SkVertices *, SkBlendMode, const SkPaint &) override
 
void onDrawPatch (const SkPoint cubics[12], const SkColor colors[4], const SkPoint texCoords[4], SkBlendMode, const SkPaint &paint) override
 
void onDrawPicture (const SkPicture *, const SkMatrix *, const SkPaint *) override
 
void onDrawDrawable (SkDrawable *, const SkMatrix *) override
 
void onDrawGlyphRunList (const sktext::GlyphRunList &, const SkPaint &) override
 
void onDrawTextBlob (const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
 
void onDrawAnnotation (const SkRect &rect, const char key[], SkData *value) override
 
void onDrawShadowRec (const SkPath &path, const SkDrawShadowRec &rec) 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
 
sk_sp< SkSurfaceonNewSurface (const SkImageInfo &, const SkSurfaceProps &) override
 
bool onPeekPixels (SkPixmap *pixmap) override
 
bool onAccessTopLayerPixels (SkPixmap *pixmap) override
 
SkImageInfo onImageInfo () const override
 
bool onGetProps (SkSurfaceProps *props, bool top) const override
 
- Protected Member Functions inherited from SkCanvasVirtualEnforcer< SkNWayCanvas >
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 SkNWayCanvas
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 onDrawGlyphRunList (const sktext::GlyphRunList &, 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 onDrawVerticesObject (const SkVertices *, SkBlendMode, const SkPaint &) override
 
void onDrawShadowRec (const SkPath &, const SkDrawShadowRec &) 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
 
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
 
SaveLayerStrategy getSaveLayerStrategy (const SaveLayerRec &rec) override
 
bool onDoSaveBehind (const SkRect *) override
 
void onDrawAnnotation (const SkRect &, const char[], SkData *) override
 
void onDrawDRRect (const SkRRect &, const SkRRect &, const SkPaint &) override
 
void onDrawDrawable (SkDrawable *, const SkMatrix *) override
 
void onDrawTextBlob (const SkTextBlob *, SkScalar, SkScalar, const SkPaint &) override
 
void onDrawPatch (const SkPoint[12], const SkColor[4], const SkPoint[4], SkBlendMode, const SkPaint &) override
 
void onDrawPaint (const SkPaint &) override
 
void onDrawBehind (const SkPaint &) override
 
void onDrawPoints (PointMode, size_t, const SkPoint[], 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 onDrawVerticesObject (const SkVertices *, SkBlendMode, const SkPaint &) override
 
void onDrawShadowRec (const SkPath &, const SkDrawShadowRec &) override
 
void onDrawPicture (const SkPicture *, const SkMatrix *, const SkPaint *) override
 
void onDrawEdgeAAQuad (const SkRect &, const SkPoint[4], QuadAAFlags, const SkColor4f &, SkBlendMode) override
 
void onDrawEdgeAAImageSet2 (const ImageSetEntry[], int, const SkPoint[], const SkMatrix[], const SkSamplingOptions &, const SkPaint *, SrcRectConstraint) override
 
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)
 
- Protected Attributes inherited from SkNWayCanvas
SkTDArray< SkCanvas * > fList
 

Detailed Description

Definition at line 1496 of file Viewer.cpp.

Constructor & Destructor Documentation

◆ OveridePaintFilterCanvas()

OveridePaintFilterCanvas::OveridePaintFilterCanvas ( SkCanvas canvas,
SkPaint paint,
Viewer::SkPaintFields pfields,
SkFont font,
Viewer::SkFontFields ffields 
)
inline

Definition at line 1498 of file Viewer.cpp.

1501 : SkPaintFilterCanvas(canvas)
1502 , fPaint(paint)
1503 , fPaintOverrides(pfields)
1504 , fFont(font)
1505 , fFontOverrides(ffields) {
1506 }
Viewer::SkFontFields * fFontOverrides
Definition: Viewer.cpp:1685
Viewer::SkPaintFields * fPaintOverrides
Definition: Viewer.cpp:1683
SkPaintFilterCanvas(SkCanvas *canvas)
const Paint & paint
Definition: color_source.cc:38
font
Font Metadata and Metrics.

Member Function Documentation

◆ filterFont()

bool OveridePaintFilterCanvas::filterFont ( SkTCopyOnFirstWrite< SkFont > *  font) const
inline

Definition at line 1591 of file Viewer.cpp.

1591 {
1593 font->writable()->setTypeface(fFont->refTypeface());
1594 }
1595 if (fFontOverrides->fSize) {
1596 font->writable()->setSize(fFont->getSize());
1597 }
1598 if (fFontOverrides->fScaleX) {
1599 font->writable()->setScaleX(fFont->getScaleX());
1600 }
1601 if (fFontOverrides->fSkewX) {
1602 font->writable()->setSkewX(fFont->getSkewX());
1603 }
1604 if (fFontOverrides->fHinting) {
1605 font->writable()->setHinting(fFont->getHinting());
1606 }
1607 if (fFontOverrides->fEdging) {
1608 font->writable()->setEdging(fFont->getEdging());
1609 }
1611 font->writable()->setSubpixel(fFont->isSubpixel());
1612 }
1614 font->writable()->setForceAutoHinting(fFont->isForceAutoHinting());
1615 }
1617 font->writable()->setEmbeddedBitmaps(fFont->isEmbeddedBitmaps());
1618 }
1620 font->writable()->setLinearMetrics(fFont->isLinearMetrics());
1621 }
1623 font->writable()->setEmbolden(fFont->isEmbolden());
1624 }
1626 font->writable()->setBaselineSnap(fFont->isBaselineSnap());
1627 }
1628
1629 return true; // we, currently, never elide a draw
1630 }
bool isBaselineSnap() const
Definition: SkFont.h:133
bool isEmbolden() const
Definition: SkFont.h:126
Edging getEdging() const
Definition: SkFont.h:180
SkScalar getSize() const
Definition: SkFont.h:217
SkFontHinting getHinting() const
Definition: SkFont.h:194
bool isForceAutoHinting() const
Definition: SkFont.h:101
bool isLinearMetrics() const
Definition: SkFont.h:119
bool isEmbeddedBitmaps() const
Definition: SkFont.h:107
SkScalar getScaleX() const
Definition: SkFont.h:224
SkScalar getSkewX() const
Definition: SkFont.h:231
bool isSubpixel() const
Definition: SkFont.h:113
sk_sp< SkTypeface > refTypeface() const
Definition: SkFont.h:237
bool fForceAutoHinting
Definition: Viewer.h:88
bool fEmbeddedBitmaps
Definition: Viewer.h:89

◆ filterTextBlob()

const SkTextBlob * OveridePaintFilterCanvas::filterTextBlob ( const SkPaint paint,
const SkTextBlob blob,
sk_sp< SkTextBlob > *  cache 
)
inline

Definition at line 1508 of file Viewer.cpp.

1510 {
1511 bool blobWillChange = false;
1512 for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) {
1513 SkTCopyOnFirstWrite<SkFont> filteredFont(it.font());
1514 bool shouldDraw = this->filterFont(&filteredFont);
1515 if (it.font() != *filteredFont || !shouldDraw) {
1516 blobWillChange = true;
1517 break;
1518 }
1519 }
1520 if (!blobWillChange) {
1521 return blob;
1522 }
1523
1525 for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) {
1526 SkTCopyOnFirstWrite<SkFont> filteredFont(it.font());
1527 bool shouldDraw = this->filterFont(&filteredFont);
1528 if (!shouldDraw) {
1529 continue;
1530 }
1531
1532 SkFont font = *filteredFont;
1533
1534 const SkTextBlobBuilder::RunBuffer& runBuffer
1536 ? builder.allocRunText(font, it.glyphCount(), it.offset().x(),it.offset().y(),
1537 it.textSize())
1539 ? builder.allocRunTextPosH(font, it.glyphCount(), it.offset().y(),
1540 it.textSize())
1541 : it.positioning() == SkTextBlobRunIterator::kFull_Positioning
1542 ? builder.allocRunTextPos(font, it.glyphCount(), it.textSize())
1544 ? builder.allocRunTextRSXform(font, it.glyphCount(), it.textSize())
1546 uint32_t glyphCount = it.glyphCount();
1547 if (it.glyphs()) {
1548 size_t glyphSize = sizeof(decltype(*it.glyphs()));
1549 memcpy(runBuffer.glyphs, it.glyphs(), glyphCount * glyphSize);
1550 }
1551 if (it.pos()) {
1552 size_t posSize = sizeof(decltype(*it.pos()));
1553 unsigned posPerGlyph = it.scalarsPerGlyph();
1554 memcpy(runBuffer.pos, it.pos(), glyphCount * posPerGlyph * posSize);
1555 }
1556 if (it.text()) {
1557 size_t textSize = sizeof(decltype(*it.text()));
1558 uint32_t textCount = it.textSize();
1559 memcpy(runBuffer.utf8text, it.text(), textCount * textSize);
1560 }
1561 if (it.clusters()) {
1562 size_t clusterSize = sizeof(decltype(*it.clusters()));
1563 memcpy(runBuffer.clusters, it.clusters(), glyphCount * clusterSize);
1564 }
1565 }
1566 *cache = builder.make();
1567 return cache->get();
1568 }
#define SkASSERT_RELEASE(cond)
Definition: SkAssert.h:100
bool filterFont(SkTCopyOnFirstWrite< SkFont > *font) const
Definition: Viewer.cpp:1591
Definition: SkFont.h:35
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir Path to the cache directory This is different from the persistent_cache_path in embedder which is used for Skia shader cache icu native lib Path to the library file that exports the ICU data vm service The hostname IP address on which the Dart VM Service should be served If not defaults to or::depending on whether ipv6 is specified vm service A custom Dart VM Service port The default is to pick a randomly available open port disable vm Disable the Dart VM Service The Dart VM Service is never available in release mode disable vm service Disable mDNS Dart VM Service publication Bind to the IPv6 localhost address for the Dart VM Service Ignored if vm service host is set endless trace Enable an endless trace buffer The default is a ring buffer This is useful when very old events need to viewed For during application launch Memory usage will continue to grow indefinitely however Start app with an specific route defined on the framework flutter assets Path to the Flutter assets directory enable service port Allow the VM service to fallback to automatic port selection if binding to a specified port fails trace Trace early application lifecycle Automatically switches to an endless trace buffer trace skia Filters out all Skia trace event categories except those that are specified in this comma separated list dump skp on shader Automatically dump the skp that triggers new shader compilations This is useful for writing custom ShaderWarmUp to reduce jank By this is not enabled to reduce the overhead purge persistent cache
Definition: switches.h:191
SkScalar * pos
storage for glyph positions in run
Definition: SkTextBlob.h:330
char * utf8text
storage for text UTF-8 code units in run
Definition: SkTextBlob.h:331
SkGlyphID * glyphs
storage for glyph indexes in run
Definition: SkTextBlob.h:329
uint32_t * clusters
storage for glyph clusters (index of UTF-8 code unit)
Definition: SkTextBlob.h:332

◆ onDrawGlyphRunList()

void OveridePaintFilterCanvas::onDrawGlyphRunList ( const sktext::GlyphRunList glyphRunList,
const SkPaint paint 
)
inlineoverridevirtual

Reimplemented from SkPaintFilterCanvas.

Definition at line 1576 of file Viewer.cpp.

1577 {
1579 sk_sp<SkTextBlob> blob = glyphRunList.makeBlob();
1580 this->filterTextBlob(paint, blob.get(), &cache);
1581 if (!cache) {
1583 return;
1584 }
1587 builder.blobToGlyphRunList(*cache, glyphRunList.origin());
1589 }
const SkTextBlob * filterTextBlob(const SkPaint &paint, const SkTextBlob *blob, sk_sp< SkTextBlob > *cache)
Definition: Viewer.cpp:1508
void onDrawGlyphRunList(const sktext::GlyphRunList &, const SkPaint &) override
T * get() const
Definition: SkRefCnt.h:303
SkPoint origin() const
Definition: GlyphRun.h:114
sk_sp< SkTextBlob > makeBlob() const
Definition: GlyphRun.cpp:88
def filtered(names, to_skip)
Definition: zip_utils.py:20

◆ onDrawTextBlob()

void OveridePaintFilterCanvas::onDrawTextBlob ( const SkTextBlob blob,
SkScalar  x,
SkScalar  y,
const SkPaint paint 
)
inlineoverridevirtual

Reimplemented from SkPaintFilterCanvas.

Definition at line 1569 of file Viewer.cpp.

1570 {
1573 this->filterTextBlob(paint, blob, &cache), x, y, paint);
1574 }
void onDrawTextBlob(const SkTextBlob *blob, SkScalar x, SkScalar y, const SkPaint &paint) override
double y
double x

◆ onFilter()

bool OveridePaintFilterCanvas::onFilter ( SkPaint paint) const
inlineoverridevirtual

Called with the paint that will be used to draw the specified type. The implementation may modify the paint as they wish.

The result bool is used to determine whether the draw op is to be executed (true) or skipped (false).

Note: The base implementation calls onFilter() for top-level/explicit paints only. To also filter encapsulated paints (e.g. SkPicture, SkTextBlob), clients may need to override the relevant methods (i.e. drawPicture, drawTextBlob).

Implements SkPaintFilterCanvas.

Definition at line 1632 of file Viewer.cpp.

1632 {
1634 paint.setPathEffect(fPaint->refPathEffect());
1635 }
1636 if (fPaintOverrides->fShader) {
1637 paint.setShader(fPaint->refShader());
1638 }
1640 paint.setMaskFilter(fPaint->refMaskFilter());
1641 }
1643 paint.setColorFilter(fPaint->refColorFilter());
1644 }
1646 paint.setImageFilter(fPaint->refImageFilter());
1647 }
1648 if (fPaintOverrides->fColor) {
1649 paint.setColor4f(fPaint->getColor4f());
1650 }
1652 paint.setStrokeWidth(fPaint->getStrokeWidth());
1653 }
1655 paint.setStrokeMiter(fPaint->getStrokeMiter());
1656 }
1659 }
1661 paint.setAntiAlias(fPaint->isAntiAlias());
1662 }
1663 if (fPaintOverrides->fDither) {
1664 paint.setDither(fPaint->isDither());
1665 }
1667 if (std::optional<SkBlendMode> mode = paint.asBlendMode()) {
1669 }
1670 }
1672 paint.setStrokeCap(fPaint->getStrokeCap());
1673 }
1675 paint.setStrokeJoin(fPaint->getStrokeJoin());
1676 }
1677 if (fPaintOverrides->fStyle) {
1678 paint.setStyle(fPaint->getStyle());
1679 }
1680 return true; // we, currently, never elide a draw
1681 }
sk_sp< SkBlender > GetRuntimeBlendForBlendMode(SkBlendMode mode)
SkScalar getStrokeMiter() const
Definition: SkPaint.h:318
Style getStyle() const
Definition: SkPaint.h:204
sk_sp< SkShader > refShader() const
sk_sp< SkImageFilter > refImageFilter() const
SkBlendMode getBlendMode_or(SkBlendMode defaultMode) const
Definition: SkPaint.cpp:143
bool isDither() const
Definition: SkPaint.h:175
sk_sp< SkColorFilter > refColorFilter() const
SkColor4f getColor4f() const
Definition: SkPaint.h:232
bool isAntiAlias() const
Definition: SkPaint.h:162
SkScalar getStrokeWidth() const
Definition: SkPaint.h:300
sk_sp< SkMaskFilter > refMaskFilter() const
sk_sp< SkPathEffect > refPathEffect() const
Cap getStrokeCap() const
Definition: SkPaint.h:372
Join getStrokeJoin() const
Definition: SkPaint.h:383
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

Member Data Documentation

◆ fFont

SkFont* OveridePaintFilterCanvas::fFont

Definition at line 1684 of file Viewer.cpp.

◆ fFontOverrides

Viewer::SkFontFields* OveridePaintFilterCanvas::fFontOverrides

Definition at line 1685 of file Viewer.cpp.

◆ fPaint

SkPaint* OveridePaintFilterCanvas::fPaint

Definition at line 1682 of file Viewer.cpp.

◆ fPaintOverrides

Viewer::SkPaintFields* OveridePaintFilterCanvas::fPaintOverrides

Definition at line 1683 of file Viewer.cpp.


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