Flutter Engine
The Flutter Engine
Public Types | Public Member Functions | Static Public Member Functions | List of all members
GrSimpleMeshDrawOpHelperWithStencil Class Reference

#include <GrSimpleMeshDrawOpHelperWithStencil.h>

Inheritance diagram for GrSimpleMeshDrawOpHelperWithStencil:
GrSimpleMeshDrawOpHelper

Public Types

using InputFlags = GrSimpleMeshDrawOpHelper::InputFlags
 

Public Member Functions

GrProgramInfocreateProgramInfoWithStencil (const GrCaps *, SkArenaAlloc *, const GrSurfaceProxyView &writeView, bool usesMSAASurface, GrAppliedClip &&, const GrDstProxyView &, GrGeometryProcessor *, GrPrimitiveType, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp)
 
 GrSimpleMeshDrawOpHelperWithStencil (GrProcessorSet *, GrAAType, const GrUserStencilSettings *, InputFlags=InputFlags::kNone)
 
GrDrawOp::FixedFunctionFlags fixedFunctionFlags () const
 
GrProcessorSet::Analysis finalizeProcessors (const GrCaps &caps, const GrAppliedClip *clip, GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage, GrProcessorAnalysisColor *geometryColor)
 
GrProcessorSet::Analysis finalizeProcessors (const GrCaps &, const GrAppliedClip *, GrClampType, GrProcessorAnalysisCoverage geometryCoverage, SkPMColor4f *geometryColor, bool *wideColor)
 
bool isCompatible (const GrSimpleMeshDrawOpHelperWithStencil &that, const GrCaps &, const SkRect &thisBounds, const SkRect &thatBounds, bool ignoreAAType=false) const
 
const GrUserStencilSettingsstencilSettings () const
 
void visitProxies (const GrVisitProxyFunc &func) const
 
const GrPipelinecreatePipeline (GrOpFlushState *flushState)
 
const GrPipelinecreatePipeline (const GrCaps *, SkArenaAlloc *, skgpu::Swizzle writeViewSwizzle, GrAppliedClip &&, const GrDstProxyView &)
 
GrAAType aaType () const
 
void setAAType (GrAAType aaType)
 
bool isTrivial () const
 
bool usesLocalCoords () const
 
bool compatibleWithCoverageAsAlpha () const
 
GrProcessorSet detachProcessorSet ()
 
GrPipeline::InputFlags pipelineFlags () const
 

Static Public Member Functions

template<typename Op , typename... OpArgs>
static GrOp::Owner FactoryHelper (GrRecordingContext *context, GrPaint &&paint, OpArgs... opArgs)
 

Detailed Description

This class extends GrSimpleMeshDrawOpHelper to support an optional GrUserStencilSettings. This uses private inheritance because it non-virtually overrides methods in the base class and should never be used with a GrSimpleMeshDrawOpHelper pointer or reference.

Definition at line 18 of file GrSimpleMeshDrawOpHelperWithStencil.h.

Member Typedef Documentation

◆ InputFlags

Definition at line 20 of file GrSimpleMeshDrawOpHelperWithStencil.h.

Constructor & Destructor Documentation

◆ GrSimpleMeshDrawOpHelperWithStencil()

GrSimpleMeshDrawOpHelperWithStencil::GrSimpleMeshDrawOpHelperWithStencil ( GrProcessorSet processorSet,
GrAAType  aaType,
const GrUserStencilSettings stencilSettings,
InputFlags  inputFlags = InputFlags::kNone 
)

Definition at line 10 of file GrSimpleMeshDrawOpHelperWithStencil.cpp.

15 : INHERITED(processorSet, aaType, inputFlags)
const GrUserStencilSettings * stencilSettings() const
static const GrUserStencilSettings & kUnused

Member Function Documentation

◆ aaType()

GrAAType GrSimpleMeshDrawOpHelper::aaType ( ) const
inline

Definition at line 107 of file GrSimpleMeshDrawOpHelper.h.

107{ return static_cast<GrAAType>(fAAType); }
GrAAType
Definition: GrTypesPriv.h:200

◆ compatibleWithCoverageAsAlpha()

bool GrSimpleMeshDrawOpHelper::compatibleWithCoverageAsAlpha ( ) const
inline

Definition at line 96 of file GrSimpleMeshDrawOpHelper.h.

◆ createPipeline() [1/2]

const GrPipeline * GrSimpleMeshDrawOpHelper::createPipeline ( const GrCaps caps,
SkArenaAlloc arena,
skgpu::Swizzle  writeViewSwizzle,
GrAppliedClip &&  appliedClip,
const GrDstProxyView dstProxyView 
)

Definition at line 127 of file GrSimpleMeshDrawOpHelper.cpp.

152 {
154 arena,
155 writeViewSwizzle,
156 std::move(appliedClip),
157 dstProxyView,
158 this->detachProcessorSet(),
159 this->pipelineFlags());
160}
GrPipeline::InputFlags pipelineFlags() const
static const GrPipeline * CreatePipeline(const GrCaps *, SkArenaAlloc *, skgpu::Swizzle writeViewSwizzle, GrAppliedClip &&, const GrDstProxyView &, GrProcessorSet &&, GrPipeline::InputFlags pipelineFlags)

◆ createPipeline() [2/2]

const GrPipeline * GrSimpleMeshDrawOpHelper::createPipeline ( GrOpFlushState flushState)

Definition at line 125 of file GrSimpleMeshDrawOpHelper.cpp.

138 {
139 return CreatePipeline(&flushState->caps(),
140 flushState->allocator(),
141 flushState->writeView().swizzle(),
142 flushState->detachAppliedClip(),
143 flushState->dstProxyView(),
144 this->detachProcessorSet(),
145 this->pipelineFlags());
146}
const GrDstProxyView & dstProxyView() const final
SkArenaAlloc * allocator() override
const GrSurfaceProxyView & writeView() const final
GrAppliedClip detachAppliedClip() final
const GrCaps & caps() const final
skgpu::Swizzle swizzle() const

◆ createProgramInfoWithStencil()

GrProgramInfo * GrSimpleMeshDrawOpHelperWithStencil::createProgramInfoWithStencil ( const GrCaps caps,
SkArenaAlloc arena,
const GrSurfaceProxyView writeView,
bool  usesMSAASurface,
GrAppliedClip &&  appliedClip,
const GrDstProxyView dstProxyView,
GrGeometryProcessor gp,
GrPrimitiveType  primType,
GrXferBarrierFlags  renderPassXferBarriers,
GrLoadOp  colorLoadOp 
)

Definition at line 45 of file GrSimpleMeshDrawOpHelperWithStencil.cpp.

55 {
56 return CreateProgramInfo(caps,
57 arena,
58 writeView,
59 usesMSAASurface,
60 std::move(appliedClip),
61 dstProxyView,
62 gp,
63 this->detachProcessorSet(),
64 primType,
65 renderPassXferBarriers,
66 colorLoadOp,
67 this->pipelineFlags(),
68 this->stencilSettings());
69}
static GrProgramInfo * CreateProgramInfo(const GrCaps *, SkArenaAlloc *, const GrPipeline *, const GrSurfaceProxyView &writeView, bool usesMSAASurface, GrGeometryProcessor *, GrPrimitiveType, GrXferBarrierFlags renderPassXferBarriers, GrLoadOp colorLoadOp, const GrUserStencilSettings *=&GrUserStencilSettings::kUnused)

◆ detachProcessorSet()

GrProcessorSet GrSimpleMeshDrawOpHelper::detachProcessorSet ( )
inline

Definition at line 175 of file GrSimpleMeshDrawOpHelper.h.

175 {
176 return fProcessors ? std::move(*fProcessors) : GrProcessorSet::MakeEmptySet();
177 }

◆ FactoryHelper()

template<typename Op , typename... OpArgs>
static GrOp::Owner GrSimpleMeshDrawOpHelperWithStencil::FactoryHelper ( GrRecordingContext context,
GrPaint &&  paint,
OpArgs...  opArgs 
)
inlinestatic

Definition at line 38 of file GrSimpleMeshDrawOpHelperWithStencil.h.

39 {
41 context, std::move(paint), std::forward<OpArgs>(opArgs)...);
42 }
static GrOp::Owner FactoryHelper(GrRecordingContext *, GrPaint &&, OpArgs &&...)
const Paint & paint
Definition: color_source.cc:38

◆ finalizeProcessors() [1/2]

GrProcessorSet::Analysis GrSimpleMeshDrawOpHelperWithStencil::finalizeProcessors ( const GrCaps caps,
const GrAppliedClip clip,
GrClampType  clampType,
GrProcessorAnalysisCoverage  geometryCoverage,
SkPMColor4f geometryColor,
bool *  wideColor 
)

Definition at line 26 of file GrSimpleMeshDrawOpHelperWithStencil.cpp.

28 {
29 GrProcessorAnalysisColor color = *geometryColor;
30 auto result = this->finalizeProcessors(caps, clip, clampType, geometryCoverage, &color);
31 color.isConstant(geometryColor);
32 if (wideColor) {
33 *wideColor = !geometryColor->fitsInBytes();
34 }
35 return result;
36}
static SkPath clip(const SkPath &path, const SkHalfPlane &plane)
Definition: SkPath.cpp:3892
GrProcessorSet::Analysis finalizeProcessors(const GrCaps &caps, const GrAppliedClip *clip, GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage, GrProcessorAnalysisColor *geometryColor)
DlColor color
GAsyncResult * result
bool fitsInBytes() const
Definition: SkColor.h:350

◆ finalizeProcessors() [2/2]

GrProcessorSet::Analysis GrSimpleMeshDrawOpHelperWithStencil::finalizeProcessors ( const GrCaps caps,
const GrAppliedClip clip,
GrClampType  clampType,
GrProcessorAnalysisCoverage  geometryCoverage,
GrProcessorAnalysisColor geometryColor 
)
inline

Definition at line 49 of file GrSimpleMeshDrawOpHelperWithStencil.h.

52 {
53 return this->INHERITED::finalizeProcessors(caps, clip, fStencilSettings, clampType,
54 geometryCoverage, geometryColor);
55 }
GrProcessorSet::Analysis finalizeProcessors(const GrCaps &caps, const GrAppliedClip *clip, GrClampType clampType, GrProcessorAnalysisCoverage geometryCoverage, GrProcessorAnalysisColor *geometryColor)

◆ fixedFunctionFlags()

GrDrawOp::FixedFunctionFlags GrSimpleMeshDrawOpHelperWithStencil::fixedFunctionFlags ( ) const

Definition at line 18 of file GrSimpleMeshDrawOpHelperWithStencil.cpp.

18 {
20 if (fStencilSettings != &GrUserStencilSettings::kUnused) {
22 }
23 return flags;
24}
FixedFunctionFlags
Definition: GrDrawOp.h:104
GrDrawOp::FixedFunctionFlags fixedFunctionFlags() const
FlutterSemanticsFlag flags

◆ isCompatible()

bool GrSimpleMeshDrawOpHelperWithStencil::isCompatible ( const GrSimpleMeshDrawOpHelperWithStencil that,
const GrCaps caps,
const SkRect thisBounds,
const SkRect thatBounds,
bool  ignoreAAType = false 
) const

Definition at line 38 of file GrSimpleMeshDrawOpHelperWithStencil.cpp.

40 {
41 return INHERITED::isCompatible(that, caps, thisBounds, thatBounds, ignoreAAType) &&
42 fStencilSettings == that.fStencilSettings;
43}
bool isCompatible(const GrSimpleMeshDrawOpHelper &that, const GrCaps &, const SkRect &thisBounds, const SkRect &thatBounds, bool ignoreAAType=false) const

◆ isTrivial()

bool GrSimpleMeshDrawOpHelper::isTrivial ( ) const
inline

Definition at line 87 of file GrSimpleMeshDrawOpHelper.h.

87 {
88 return fProcessors == nullptr;
89 }

◆ pipelineFlags()

GrPipeline::InputFlags GrSimpleMeshDrawOpHelper::pipelineFlags ( ) const
inline

Definition at line 179 of file GrSimpleMeshDrawOpHelper.h.

179{ return fPipelineFlags; }
GrPipeline::InputFlags fPipelineFlags

◆ setAAType()

void GrSimpleMeshDrawOpHelper::setAAType ( GrAAType  aaType)
inline

Definition at line 109 of file GrSimpleMeshDrawOpHelper.h.

109 {
110 fAAType = static_cast<unsigned>(aaType);
111 }

◆ stencilSettings()

const GrUserStencilSettings * GrSimpleMeshDrawOpHelperWithStencil::stencilSettings ( ) const
inline

Definition at line 77 of file GrSimpleMeshDrawOpHelperWithStencil.h.

77{ return fStencilSettings; }

◆ usesLocalCoords()

bool GrSimpleMeshDrawOpHelper::usesLocalCoords ( ) const
inline

Definition at line 91 of file GrSimpleMeshDrawOpHelper.h.

91 {
92 SkASSERT(fDidAnalysis);
93 return fUsesLocalCoords;
94 }
#define SkASSERT(cond)
Definition: SkAssert.h:116

◆ visitProxies()

void GrSimpleMeshDrawOpHelper::visitProxies ( const GrVisitProxyFunc func) const
inline

Definition at line 98 of file GrSimpleMeshDrawOpHelper.h.

98 {
99 if (fProcessors) {
101 }
102 }
void visitProxies(const GrVisitProxyFunc &) const

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