Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
 
sk_sp< SkSurfacemakeSurface (const SkImageInfo &info, const SkSurfaceProps *props=nullptr)
 
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
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 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 onDrawSlug (const sktext::gpu::Slug *slug, const SkPaint &paint) 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
 
- Protected Member Functions inherited from SkCanvas
virtual void didRestore ()
 
virtual void onDrawMesh (const SkMesh &, sk_sp< SkBlender >, const SkPaint &)
 
virtual void onDiscard ()
 
virtual sk_sp< sktext::gpu::SlugonConvertGlyphRunListToSlug (const sktext::GlyphRunList &glyphRunList, const SkPaint &paint)
 
 SkCanvas (const SkIRect &bounds)
 
- Protected Attributes inherited from SkNWayCanvas
SkTDArray< SkCanvas * > fList
 

Detailed Description

Definition at line 1484 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 1486 of file Viewer.cpp.

1489 : SkPaintFilterCanvas(canvas)
1490 , fPaint(paint)
1491 , fPaintOverrides(pfields)
1492 , fFont(font)
1493 , fFontOverrides(ffields) {
1494 }
Viewer::SkFontFields * fFontOverrides
Definition Viewer.cpp:1673
Viewer::SkPaintFields * fPaintOverrides
Definition Viewer.cpp:1671
const Paint & paint

Member Function Documentation

◆ filterFont()

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

Definition at line 1579 of file Viewer.cpp.

1579 {
1581 font->writable()->setTypeface(fFont->refTypeface());
1582 }
1583 if (fFontOverrides->fSize) {
1584 font->writable()->setSize(fFont->getSize());
1585 }
1586 if (fFontOverrides->fScaleX) {
1587 font->writable()->setScaleX(fFont->getScaleX());
1588 }
1589 if (fFontOverrides->fSkewX) {
1590 font->writable()->setSkewX(fFont->getSkewX());
1591 }
1592 if (fFontOverrides->fHinting) {
1593 font->writable()->setHinting(fFont->getHinting());
1594 }
1595 if (fFontOverrides->fEdging) {
1596 font->writable()->setEdging(fFont->getEdging());
1597 }
1599 font->writable()->setSubpixel(fFont->isSubpixel());
1600 }
1602 font->writable()->setForceAutoHinting(fFont->isForceAutoHinting());
1603 }
1605 font->writable()->setEmbeddedBitmaps(fFont->isEmbeddedBitmaps());
1606 }
1608 font->writable()->setLinearMetrics(fFont->isLinearMetrics());
1609 }
1611 font->writable()->setEmbolden(fFont->isEmbolden());
1612 }
1614 font->writable()->setBaselineSnap(fFont->isBaselineSnap());
1615 }
1616
1617 return true; // we, currently, never elide a draw
1618 }
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
font
Font Metadata and Metrics.

◆ filterTextBlob()

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

Definition at line 1496 of file Viewer.cpp.

1498 {
1499 bool blobWillChange = false;
1500 for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) {
1501 SkTCopyOnFirstWrite<SkFont> filteredFont(it.font());
1502 bool shouldDraw = this->filterFont(&filteredFont);
1503 if (it.font() != *filteredFont || !shouldDraw) {
1504 blobWillChange = true;
1505 break;
1506 }
1507 }
1508 if (!blobWillChange) {
1509 return blob;
1510 }
1511
1513 for (SkTextBlobRunIterator it(blob); !it.done(); it.next()) {
1514 SkTCopyOnFirstWrite<SkFont> filteredFont(it.font());
1515 bool shouldDraw = this->filterFont(&filteredFont);
1516 if (!shouldDraw) {
1517 continue;
1518 }
1519
1520 SkFont font = *filteredFont;
1521
1522 const SkTextBlobBuilder::RunBuffer& runBuffer
1524 ? builder.allocRunText(font, it.glyphCount(), it.offset().x(),it.offset().y(),
1525 it.textSize())
1527 ? builder.allocRunTextPosH(font, it.glyphCount(), it.offset().y(),
1528 it.textSize())
1529 : it.positioning() == SkTextBlobRunIterator::kFull_Positioning
1530 ? builder.allocRunTextPos(font, it.glyphCount(), it.textSize())
1532 ? builder.allocRunTextRSXform(font, it.glyphCount(), it.textSize())
1534 uint32_t glyphCount = it.glyphCount();
1535 if (it.glyphs()) {
1536 size_t glyphSize = sizeof(decltype(*it.glyphs()));
1537 memcpy(runBuffer.glyphs, it.glyphs(), glyphCount * glyphSize);
1538 }
1539 if (it.pos()) {
1540 size_t posSize = sizeof(decltype(*it.pos()));
1541 unsigned posPerGlyph = it.scalarsPerGlyph();
1542 memcpy(runBuffer.pos, it.pos(), glyphCount * posPerGlyph * posSize);
1543 }
1544 if (it.text()) {
1545 size_t textSize = sizeof(decltype(*it.text()));
1546 uint32_t textCount = it.textSize();
1547 memcpy(runBuffer.utf8text, it.text(), textCount * textSize);
1548 }
1549 if (it.clusters()) {
1550 size_t clusterSize = sizeof(decltype(*it.clusters()));
1551 memcpy(runBuffer.clusters, it.clusters(), glyphCount * clusterSize);
1552 }
1553 }
1554 *cache = builder.make();
1555 return cache->get();
1556 }
#define SkASSERT_RELEASE(cond)
Definition SkAssert.h:100
bool filterFont(SkTCopyOnFirstWrite< SkFont > *font) const
Definition Viewer.cpp:1579
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 SkCanvas.

Definition at line 1564 of file Viewer.cpp.

1565 {
1567 sk_sp<SkTextBlob> blob = glyphRunList.makeBlob();
1568 this->filterTextBlob(paint, blob.get(), &cache);
1569 if (!cache) {
1571 return;
1572 }
1575 builder.blobToGlyphRunList(*cache, glyphRunList.origin());
1577 }
const SkTextBlob * filterTextBlob(const SkPaint &paint, const SkTextBlob *blob, sk_sp< SkTextBlob > *cache)
Definition Viewer.cpp:1496
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
filtered(names, to_skip)
Definition zip_utils.py:20

◆ onDrawTextBlob()

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

Implements SkCanvasVirtualEnforcer< SkNWayCanvas >.

Definition at line 1557 of file Viewer.cpp.

1558 {
1561 this->filterTextBlob(paint, blob, &cache), x, y, paint);
1562 }
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 1620 of file Viewer.cpp.

1620 {
1622 paint.setPathEffect(fPaint->refPathEffect());
1623 }
1624 if (fPaintOverrides->fShader) {
1625 paint.setShader(fPaint->refShader());
1626 }
1628 paint.setMaskFilter(fPaint->refMaskFilter());
1629 }
1631 paint.setColorFilter(fPaint->refColorFilter());
1632 }
1634 paint.setImageFilter(fPaint->refImageFilter());
1635 }
1636 if (fPaintOverrides->fColor) {
1637 paint.setColor4f(fPaint->getColor4f());
1638 }
1640 paint.setStrokeWidth(fPaint->getStrokeWidth());
1641 }
1643 paint.setStrokeMiter(fPaint->getStrokeMiter());
1644 }
1647 }
1649 paint.setAntiAlias(fPaint->isAntiAlias());
1650 }
1651 if (fPaintOverrides->fDither) {
1652 paint.setDither(fPaint->isDither());
1653 }
1655 if (std::optional<SkBlendMode> mode = paint.asBlendMode()) {
1656 paint.setBlender(GetRuntimeBlendForBlendMode(*mode));
1657 }
1658 }
1660 paint.setStrokeCap(fPaint->getStrokeCap());
1661 }
1663 paint.setStrokeJoin(fPaint->getStrokeJoin());
1664 }
1665 if (fPaintOverrides->fStyle) {
1666 paint.setStyle(fPaint->getStyle());
1667 }
1668 return true; // we, currently, never elide a draw
1669 }
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

Member Data Documentation

◆ fFont

SkFont* OveridePaintFilterCanvas::fFont

Definition at line 1672 of file Viewer.cpp.

◆ fFontOverrides

Viewer::SkFontFields* OveridePaintFilterCanvas::fFontOverrides

Definition at line 1673 of file Viewer.cpp.

◆ fPaint

SkPaint* OveridePaintFilterCanvas::fPaint

Definition at line 1670 of file Viewer.cpp.

◆ fPaintOverrides

Viewer::SkPaintFields* OveridePaintFilterCanvas::fPaintOverrides

Definition at line 1671 of file Viewer.cpp.


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