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

#include <PathInnerTriangulateOp.h>

Inheritance diagram for skgpu::ganesh::PathInnerTriangulateOp:
GrDrawOp GrOp SkNoncopyable

Private Member Functions

const char * name () const override
 
void visitProxies (const GrVisitProxyFunc &) const override
 
FixedFunctionFlags fixedFunctionFlags () const override
 
GrProcessorSet::Analysis finalize (const GrCaps &, const GrAppliedClip *, GrClampType) override
 
void onPrePrepare (GrRecordingContext *, const GrSurfaceProxyView &, GrAppliedClip *, const GrDstProxyView &, GrXferBarrierFlags, GrLoadOp colorLoadOp) override
 
void onPrepare (GrOpFlushState *) override
 
void onExecute (GrOpFlushState *, const SkRect &chainBounds) override
 

Friends

class GrOp
 

Additional Inherited Members

- Public Types inherited from GrDrawOp
enum class  ClipResult { kFail , kClippedGeometrically , kClippedInShader , kClippedOut }
 
- Public Types inherited from GrOp
enum class  CombineResult { kMerged , kMayChain , kCannotCombine }
 
enum class  HasAABloat : bool { kNo = false , kYes = true }
 
enum class  IsHairline : bool { kNo = false , kYes = true }
 
using Owner = std::unique_ptr< GrOp >
 
- Public Member Functions inherited from GrDrawOp
 GrDrawOp (uint32_t classID)
 
virtual bool usesMSAA () const
 
virtual ClipResult clipToShape (skgpu::ganesh::SurfaceDrawContext *, SkClipOp, const SkMatrix &, const GrShape &, GrAA)
 
virtual bool usesStencil () const
 
- Public Member Functions inherited from GrOp
virtual ~GrOp ()=default
 
CombineResult combineIfPossible (GrOp *that, SkArenaAlloc *alloc, const GrCaps &caps)
 
const SkRectbounds () const
 
void setClippedBounds (const SkRect &clippedBounds)
 
bool hasAABloat () const
 
bool hasZeroArea () const
 
void operator delete (void *p)
 
template<typename T >
const Tcast () const
 
template<typename T >
Tcast ()
 
uint32_t classID () const
 
uint32_t uniqueID () const
 
void prePrepare (GrRecordingContext *context, const GrSurfaceProxyView &dstView, GrAppliedClip *clip, const GrDstProxyView &dstProxyView, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
 
void prepare (GrOpFlushState *state)
 
void execute (GrOpFlushState *state, const SkRect &chainBounds)
 
void chainConcat (GrOp::Owner)
 
bool isChainHead () const
 
bool isChainTail () const
 
GrOpnextInChain () const
 
GrOpprevInChain () const
 
GrOp::Owner cutChain ()
 
void setBounds (const SkRect &newBounds, HasAABloat aabloat, IsHairline zeroArea)
 
void setTransformedBounds (const SkRect &srcBounds, const SkMatrix &m, HasAABloat aabloat, IsHairline zeroArea)
 
void makeFullScreen (GrSurfaceProxy *proxy)
 
- Static Public Member Functions inherited from GrOp
template<typename Op , typename... Args>
static Owner Make (GrRecordingContext *context, Args &&... args)
 
template<typename Op , typename... Args>
static Owner MakeWithProcessorSet (GrRecordingContext *context, const SkPMColor4f &color, GrPaint &&paint, Args &&... args)
 
template<typename Op , typename... Args>
static Owner MakeWithExtraMemory (GrRecordingContext *context, size_t extraSize, Args &&... args)
 
static uint32_t GenOpClassID ()
 
- Protected Types inherited from GrDrawOp
enum class  FixedFunctionFlags : uint32_t { kNone = 0x0 , kUsesHWAA = 0x1 , kUsesStencil = 0x2 }
 
- Protected Member Functions inherited from GrDrawOp
 GR_DECL_BITFIELD_CLASS_OPS_FRIENDS (FixedFunctionFlags)
 

Detailed Description

Definition at line 32 of file PathInnerTriangulateOp.h.

Member Function Documentation

◆ finalize()

GrProcessorSet::Analysis skgpu::ganesh::PathInnerTriangulateOp::finalize ( const GrCaps ,
const GrAppliedClip ,
GrClampType   
)
overrideprivatevirtual

This is called after the GrAppliedClip has been computed and just prior to recording the op or combining it with a previously recorded op. The op should convert any proxies or resources it owns to "pending io" status so that resource allocation can be more optimal. Additionally, at this time the op must report whether a copy of the destination (or destination texture itself) needs to be provided to the GrXferProcessor when this op executes.

Implements GrDrawOp.

Definition at line 194 of file PathInnerTriangulateOp.cpp.

196 {
197 return fProcessors.finalize(fColor, GrProcessorAnalysisCoverage::kNone, clip, nullptr, caps,
198 clampType, &fColor);
199}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition SkPath.cpp:3824
Analysis finalize(const GrProcessorAnalysisColor &, const GrProcessorAnalysisCoverage, const GrAppliedClip *, const GrUserStencilSettings *, const GrCaps &, GrClampType, SkPMColor4f *inputColorOverride)

◆ fixedFunctionFlags()

GrDrawOp::FixedFunctionFlags skgpu::ganesh::PathInnerTriangulateOp::fixedFunctionFlags ( ) const
overrideprivatevirtual

Reimplemented from GrDrawOp.

Definition at line 186 of file PathInnerTriangulateOp.cpp.

186 {
188 if (GrAAType::kNone != fAAType) {
190 }
191 return flags;
192}
FlutterSemanticsFlag flags

◆ name()

const char * skgpu::ganesh::PathInnerTriangulateOp::name ( ) const
inlineoverrideprivatevirtual

Implements GrOp.

Definition at line 53 of file PathInnerTriangulateOp.h.

53{ return "PathInnerTriangulateOp"; }

◆ onExecute()

void skgpu::ganesh::PathInnerTriangulateOp::onExecute ( GrOpFlushState flushState,
const SkRect chainBounds 
)
overrideprivatevirtual

Implements GrOp.

Definition at line 447 of file PathInnerTriangulateOp.cpp.

447 {
448 if (fCoverHullsProgram &&
449 fCoverHullsProgram->geomProc().hasVertexAttributes() &&
450 !fHullVertexBufferIfNoIDSupport) {
451 return;
452 }
453
454 if (fStencilCurvesProgram) {
455 SkASSERT(fTessellator);
456 flushState->bindPipelineAndScissorClip(*fStencilCurvesProgram, this->bounds());
457 fTessellator->draw(flushState);
458 }
459
460 // Allocation of the fan vertex buffer may have failed but we already pushed back fan programs.
461 if (fFanBuffer) {
462 for (const GrProgramInfo* fanProgram : fFanPrograms) {
463 flushState->bindPipelineAndScissorClip(*fanProgram, this->bounds());
464 flushState->bindTextures(fanProgram->geomProc(), nullptr, fanProgram->pipeline());
465 flushState->bindBuffers(nullptr, nullptr, fFanBuffer);
466 flushState->draw(fFanVertexCount, fBaseFanVertex);
467 }
468 }
469
470 if (fCoverHullsProgram) {
471 SkASSERT(fTessellator);
472 flushState->bindPipelineAndScissorClip(*fCoverHullsProgram, this->bounds());
473 flushState->bindTextures(fCoverHullsProgram->geomProc(), nullptr, *fPipelineForFills);
474 fTessellator->drawHullInstances(flushState, fHullVertexBufferIfNoIDSupport);
475 }
476}
#define SkASSERT(cond)
Definition SkAssert.h:116
void bindPipelineAndScissorClip(const GrProgramInfo &programInfo, const SkRect &drawBounds)
void bindBuffers(sk_sp< const GrBuffer > indexBuffer, sk_sp< const GrBuffer > instanceBuffer, sk_sp< const GrBuffer > vertexBuffer, GrPrimitiveRestart primitiveRestart=GrPrimitiveRestart::kNo)
void bindTextures(const GrGeometryProcessor &geomProc, const GrSurfaceProxy &singleGeomProcTexture, const GrPipeline &pipeline)
void draw(int vertexCount, int baseVertex)
const SkRect & bounds() const
Definition GrOp.h:122
const GrGeometryProcessor & geomProc() const
void drawHullInstances(GrOpFlushState *, sk_sp< const GrGpuBuffer > vertexBufferIfNeeded) const
void draw(GrOpFlushState *) const final

◆ onPrepare()

void skgpu::ganesh::PathInnerTriangulateOp::onPrepare ( GrOpFlushState flushState)
overrideprivatevirtual

Implements GrOp.

Definition at line 409 of file PathInnerTriangulateOp.cpp.

409 {
410 const GrCaps& caps = flushState->caps();
411
412 if (!fFanTriangulator) {
413 this->prePreparePrograms({flushState->allocator(), flushState->writeView(),
414 flushState->usesMSAASurface(), &flushState->dstProxyView(),
415 flushState->renderPassBarriers(), flushState->colorLoadOp(),
416 &caps}, flushState->detachAppliedClip());
417 if (!fFanTriangulator) {
418 return;
419 }
420 }
421
422 if (fFanPolys) {
423 GrEagerDynamicVertexAllocator alloc(flushState, &fFanBuffer, &fBaseFanVertex);
424 fFanVertexCount = fFanTriangulator->polysToTriangles(fFanPolys, &alloc, &fFanBreadcrumbs);
425 }
426
427 if (fTessellator) {
428 auto tessShader = &fStencilCurvesProgram->geomProc().cast<GrPathTessellationShader>();
429 fTessellator->prepareWithTriangles(flushState,
430 tessShader->viewMatrix(),
431 &fFanBreadcrumbs,
433 fPath.countVerbs());
434 }
435
436 if (!caps.shaderCaps()->fVertexIDSupport) {
437 constexpr static float kStripOrderIDs[4] = {0, 1, 3, 2};
438
439 SKGPU_DEFINE_STATIC_UNIQUE_KEY(gHullVertexBufferKey);
440
441 fHullVertexBufferIfNoIDSupport = flushState->resourceProvider()->findOrMakeStaticBuffer(
442 GrGpuBufferType::kVertex, sizeof(kStripOrderIDs), kStripOrderIDs,
443 gHullVertexBufferKey);
444 }
445}
#define SKGPU_DEFINE_STATIC_UNIQUE_KEY(name)
constexpr SkPMColor4f SK_PMColor4fTRANSPARENT
const GrShaderCaps * shaderCaps() const
Definition GrCaps.h:63
int polysToTriangles(Poly *polys, GrEagerVertexAllocator *vertexAlloc, BreadcrumbTriangleList *breadcrumbList) const
GrLoadOp colorLoadOp() const final
const GrDstProxyView & dstProxyView() const final
GrXferBarrierFlags renderPassBarriers() const final
SkArenaAlloc * allocator() override
const GrSurfaceProxyView & writeView() const final
GrResourceProvider * resourceProvider() const final
GrAppliedClip detachAppliedClip() final
const GrCaps & caps() const final
bool usesMSAASurface() const final
const T & cast() const
sk_sp< const GrGpuBuffer > findOrMakeStaticBuffer(GrGpuBufferType intendedType, size_t size, const skgpu::UniqueKey &key, InitializeBufferFn)
static const SkMatrix & I()
int countVerbs() const
Definition SkPath.cpp:546
void prepareWithTriangles(GrMeshDrawTarget *target, const SkMatrix &shaderMatrix, GrInnerFanTriangulator::BreadcrumbTriangleList *extraTriangles, const PathDrawList &pathDrawList, int totalCombinedPathVerbCnt)
bool fVertexIDSupport

◆ onPrePrepare()

void skgpu::ganesh::PathInnerTriangulateOp::onPrePrepare ( GrRecordingContext context,
const GrSurfaceProxyView writeView,
GrAppliedClip clip,
const GrDstProxyView dstProxyView,
GrXferBarrierFlags  renderPassXferBarriers,
GrLoadOp  colorLoadOp 
)
overrideprivatevirtual

Implements GrOp.

Definition at line 384 of file PathInnerTriangulateOp.cpp.

389 {
390 // DMSAA is not supported on DDL.
391 bool usesMSAASurface = writeView.asRenderTargetProxy()->numSamples() > 1;
392 this->prePreparePrograms({context->priv().recordTimeAllocator(), writeView, usesMSAASurface,
393 &dstProxyView, renderPassXferBarriers, colorLoadOp,
394 context->priv().caps()},
395 (clip) ? std::move(*clip) : GrAppliedClip::Disabled());
396 if (fStencilCurvesProgram) {
397 context->priv().recordProgramInfo(fStencilCurvesProgram);
398 }
399 for (const GrProgramInfo* fanProgram : fFanPrograms) {
400 context->priv().recordProgramInfo(fanProgram);
401 }
402 if (fCoverHullsProgram) {
403 context->priv().recordProgramInfo(fCoverHullsProgram);
404 }
405}
static GrAppliedClip Disabled()
const GrCaps * caps() const
void recordProgramInfo(const GrProgramInfo *programInfo)
GrRecordingContextPriv priv()
GrRenderTargetProxy * asRenderTargetProxy() const

◆ visitProxies()

void skgpu::ganesh::PathInnerTriangulateOp::visitProxies ( const GrVisitProxyFunc func) const
overrideprivatevirtual

Reimplemented from GrOp.

Definition at line 178 of file PathInnerTriangulateOp.cpp.

178 {
179 if (fPipelineForFills) {
180 fPipelineForFills->visitProxies(func);
181 } else {
182 fProcessors.visitProxies(func);
183 }
184}
void visitProxies(const GrVisitProxyFunc &) const
void visitProxies(const GrVisitProxyFunc &) const

Friends And Related Symbol Documentation

◆ GrOp

friend class GrOp
friend

Definition at line 105 of file PathInnerTriangulateOp.h.


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