Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | List of all members
skgpu::ganesh::TriangulatingPathRenderer Class Referencefinal

#include <TriangulatingPathRenderer.h>

Inheritance diagram for skgpu::ganesh::TriangulatingPathRenderer:
skgpu::ganesh::PathRenderer SkRefCnt SkRefCntBase

Public Member Functions

 TriangulatingPathRenderer ()
 
const char * name () const override
 
- Public Member Functions inherited from skgpu::ganesh::PathRenderer
 PathRenderer ()=default
 
StencilSupport getStencilSupport (const GrStyledShape &shape) const
 
CanDrawPath canDrawPath (const CanDrawPathArgs &args) const
 
bool drawPath (const DrawPathArgs &args)
 
void stencilPath (const StencilPathArgs &args)
 
- Public Member Functions inherited from SkRefCntBase
 SkRefCntBase ()
 
virtual ~SkRefCntBase ()
 
bool unique () const
 
void ref () const
 
void unref () const
 

Private Member Functions

CanDrawPath onCanDrawPath (const CanDrawPathArgs &) const override
 
StencilSupport onGetStencilSupport (const GrStyledShape &) const override
 
bool onDrawPath (const DrawPathArgs &) override
 

Additional Inherited Members

- Public Types inherited from skgpu::ganesh::PathRenderer
enum  StencilSupport { kNoSupport_StencilSupport , kStencilOnly_StencilSupport , kNoRestriction_StencilSupport }
 
enum class  CanDrawPath { kNo , kAsBackup , kYes }
 
- Static Protected Member Functions inherited from skgpu::ganesh::PathRenderer
static void GetPathDevBounds (const SkPath &path, SkISize devSize, const SkMatrix &matrix, SkRect *bounds)
 

Detailed Description

Subclass that renders the path by converting to screen-space trapezoids plus extra 1-pixel geometry for AA.

Definition at line 21 of file TriangulatingPathRenderer.h.

Constructor & Destructor Documentation

◆ TriangulatingPathRenderer()

skgpu::ganesh::TriangulatingPathRenderer::TriangulatingPathRenderer ( )

Definition at line 582 of file TriangulatingPathRenderer.cpp.

583 : fMaxVerbCount(GR_AA_TESSELLATOR_MAX_VERB_COUNT) {
584}
#define GR_AA_TESSELLATOR_MAX_VERB_COUNT

Member Function Documentation

◆ name()

const char * skgpu::ganesh::TriangulatingPathRenderer::name ( ) const
inlineoverridevirtual

Implements skgpu::ganesh::PathRenderer.

Definition at line 28 of file TriangulatingPathRenderer.h.

28{ return "Triangulating"; }

◆ onCanDrawPath()

PathRenderer::CanDrawPath skgpu::ganesh::TriangulatingPathRenderer::onCanDrawPath ( const CanDrawPathArgs args) const
overrideprivatevirtual

Subclass implementation of canDrawPath()

Implements skgpu::ganesh::PathRenderer.

Definition at line 586 of file TriangulatingPathRenderer.cpp.

587 {
588
589 // Don't use this path renderer with dynamic MSAA. DMSAA tries to not rely on caching.
590 if (args.fSurfaceProps->flags() & SkSurfaceProps::kDynamicMSAA_Flag) {
591 return CanDrawPath::kNo;
592 }
593 // This path renderer can draw fill styles, and can do screenspace antialiasing via a
594 // one-pixel coverage ramp. It can do convex and concave paths, but we'll leave the convex
595 // ones to simpler algorithms. We pass on paths that have styles, though they may come back
596 // around after applying the styling information to the geometry to create a filled path.
597 if (!args.fShape->style().isSimpleFill() || args.fShape->knownToBeConvex()) {
598 return CanDrawPath::kNo;
599 }
600 switch (args.fAAType) {
601 case GrAAType::kNone:
602 case GrAAType::kMSAA:
603 // Prefer MSAA, if any antialiasing. In the non-analytic-AA case, We skip paths that
604 // don't have a key since the real advantage of this path renderer comes from caching
605 // the tessellated geometry.
606 if (!args.fShape->hasUnstyledKey()) {
607 return CanDrawPath::kNo;
608 }
609 break;
611 // Use analytic AA if we don't have MSAA. In this case, we do not cache, so we accept
612 // paths without keys.
613 SkPath path;
614 args.fShape->asPath(&path);
615 if (path.countVerbs() > fMaxVerbCount) {
616 return CanDrawPath::kNo;
617 }
618 break;
619 }
620 return CanDrawPath::kYes;
621}
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
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

◆ onDrawPath()

bool skgpu::ganesh::TriangulatingPathRenderer::onDrawPath ( const DrawPathArgs args)
overrideprivatevirtual

Subclass implementation of drawPath()

Implements skgpu::ganesh::PathRenderer.

Definition at line 623 of file TriangulatingPathRenderer.cpp.

623 {
624 GR_AUDIT_TRAIL_AUTO_FRAME(args.fContext->priv().auditTrail(),
625 "GrTriangulatingPathRenderer::onDrawPath");
626
627 GrOp::Owner op = TriangulatingPathOp::Make(
628 args.fContext, std::move(args.fPaint), *args.fShape, *args.fViewMatrix,
629 *args.fClipConservativeBounds, args.fAAType, args.fUserStencilSettings);
630 args.fSurfaceDrawContext->addDrawOp(args.fClip, std::move(op));
631 return true;
632}
#define GR_AUDIT_TRAIL_AUTO_FRAME(audit_trail, framename)
std::unique_ptr< GrOp > Owner
Definition GrOp.h:72

◆ onGetStencilSupport()

StencilSupport skgpu::ganesh::TriangulatingPathRenderer::onGetStencilSupport ( const GrStyledShape ) const
inlineoverrideprivatevirtual

Subclass overrides if it has any limitations of stenciling support.

Reimplemented from skgpu::ganesh::PathRenderer.

Definition at line 33 of file TriangulatingPathRenderer.h.


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