Flutter Engine
The Flutter Engine
Classes | Static Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
GrPathTessellationShader Class Reference

#include <GrPathTessellationShader.h>

Inheritance diagram for GrPathTessellationShader:
GrTessellationShader GrGeometryProcessor GrProcessor

Classes

class  Impl
 

Static Public Member Functions

static GrPathTessellationShaderMakeSimpleTriangleShader (SkArenaAlloc *, const SkMatrix &viewMatrix, const SkPMColor4f &)
 
static GrPathTessellationShaderMake (const GrShaderCaps &, SkArenaAlloc *, const SkMatrix &viewMatrix, const SkPMColor4f &, PatchAttribs)
 
static const GrUserStencilSettingsStencilPathSettings (GrFillRule fillRule)
 
static const GrUserStencilSettingsTestAndResetStencilSettings (bool isInverseFill=false)
 
static const GrPipelineMakeStencilOnlyPipeline (const ProgramArgs &, GrAAType, const GrAppliedHardClip &, GrPipeline::InputFlags=GrPipeline::InputFlags::kNone)
 
- Static Public Member Functions inherited from GrTessellationShader
static const GrPipelineMakePipeline (const ProgramArgs &, GrAAType, GrAppliedClip &&, GrProcessorSet &&)
 
static GrProgramInfoMakeProgram (const ProgramArgs &args, const GrTessellationShader *shader, const GrPipeline *pipeline, const GrUserStencilSettings *stencil)
 
static const char * WangsFormulaSkSL ()
 
- Static Public Member Functions inherited from GrGeometryProcessor
static uint32_t ComputeCoordTransformsKey (const GrFragmentProcessor &fp)
 

Protected Types

using PatchAttribs = skgpu::tess::PatchAttribs
 

Protected Member Functions

 GrPathTessellationShader (ClassID classID, GrPrimitiveType primitiveType, const SkMatrix &viewMatrix, const SkPMColor4f &color, PatchAttribs attribs)
 
- Protected Member Functions inherited from GrGeometryProcessor
void setVertexAttributes (const Attribute *attrs, int attrCount, size_t stride)
 
void setInstanceAttributes (const Attribute *attrs, int attrCount, size_t stride)
 
void setVertexAttributesWithImplicitOffsets (const Attribute *attrs, int attrCount)
 
void setInstanceAttributesWithImplicitOffsets (const Attribute *attrs, int attrCount)
 
void setTextureSamplerCnt (int cnt)
 
- Protected Member Functions inherited from GrProcessor
 GrProcessor (ClassID classID)
 
 GrProcessor (const GrProcessor &)=delete
 
GrProcessoroperator= (const GrProcessor &)=delete
 

Protected Attributes

const PatchAttribs fAttribs
 
- Protected Attributes inherited from GrProcessor
const ClassID fClassID
 

Static Protected Attributes

static constexpr size_t kMiddleOutVertexStride = 2 * sizeof(float)
 

Additional Inherited Members

- Public Types inherited from GrProcessor
enum  ClassID {
  kNull_ClassID , kAttributeTestProcessor_ClassID , kBigKeyProcessor_ClassID , kBlendFragmentProcessor_ClassID ,
  kBlockInputFragmentProcessor_ClassID , kButtCapStrokedCircleGeometryProcessor_ClassID , kCircleGeometryProcessor_ClassID , kCircularRRectEffect_ClassID ,
  kClockwiseTestProcessor_ClassID , kColorTableEffect_ClassID , kCoverageSetOpXP_ClassID , kCustomXP_ClassID ,
  kDashingCircleEffect_ClassID , kDashingLineEffect_ClassID , kDefaultGeoProc_ClassID , kDeviceSpace_ClassID ,
  kDIEllipseGeometryProcessor_ClassID , kDisableColorXP_ClassID , kDrawAtlasPathShader_ClassID , kEllipseGeometryProcessor_ClassID ,
  kEllipticalRRectEffect_ClassID , kFwidthSquircleTestProcessor_ClassID , kGP_ClassID , kGrBicubicEffect_ClassID ,
  kGrBitmapTextGeoProc_ClassID , kGrColorSpaceXformEffect_ClassID , kGrConicEffect_ClassID , kGrConvexPolyEffect_ClassID ,
  kGrDiffuseLightingEffect_ClassID , kGrDisplacementMapEffect_ClassID , kGrDistanceFieldA8TextGeoProc_ClassID , kGrDistanceFieldLCDTextGeoProc_ClassID ,
  kGrDistanceFieldPathGeoProc_ClassID , kGrFillRRectOp_Processor_ClassID , kGrGaussianConvolutionFragmentProcessor_ClassID , kGrMatrixConvolutionEffect_ClassID ,
  kGrMatrixEffect_ClassID , kGrMeshTestProcessor_ClassID , kGrMorphologyEffect_ClassID , kGrPerlinNoise2Effect_ClassID ,
  kGrPipelineDynamicStateTestProcessor_ClassID , kGrQuadEffect_ClassID , kGrRRectShadowGeoProc_ClassID , kGrSkSLFP_ClassID ,
  kGrSpecularLightingEffect_ClassID , kGrTextureEffect_ClassID , kGrUnrolledBinaryGradientColorizer_ClassID , kGrYUVtoRGBEffect_ClassID ,
  kHighPrecisionFragmentProcessor_ClassID , kLatticeGP_ClassID , kPDLCDXferProcessor_ClassID , kPorterDuffXferProcessor_ClassID ,
  kPremulFragmentProcessor_ClassID , kQuadEdgeEffect_ClassID , kQuadPerEdgeAAGeometryProcessor_ClassID , kSeriesFragmentProcessor_ClassID ,
  kShaderPDXferProcessor_ClassID , kSurfaceColorProcessor_ClassID , kSwizzleFragmentProcessor_ClassID , kTessellate_BoundingBoxShader_ClassID ,
  kTessellate_GrModulateAtlasCoverageEffect_ClassID , kTessellate_GrStrokeTessellationShader_ClassID , kTessellate_HullShader_ClassID , kTessellate_MiddleOutShader_ClassID ,
  kTessellate_SimpleTriangleShader_ClassID , kTessellationTestTriShader_ClassID , kTestFP_ClassID , kTestRectOp_ClassID ,
  kVertexColorSpaceBenchGP_ClassID , kVerticesGP_ClassID
}
 
- Public Member Functions inherited from GrTessellationShader
 GrTessellationShader (ClassID classID, GrPrimitiveType primitiveType, const SkMatrix &viewMatrix, const SkPMColor4f &color)
 
GrPrimitiveType primitiveType () const
 
const SkMatrixviewMatrix () const
 
const SkPMColor4fcolor () const
 
- Public Member Functions inherited from GrGeometryProcessor
 GrGeometryProcessor (ClassID)
 
int numTextureSamplers () const
 
const TextureSamplertextureSampler (int index) const
 
int numVertexAttributes () const
 
const AttributeSetvertexAttributes () const
 
int numInstanceAttributes () const
 
const AttributeSetinstanceAttributes () const
 
bool hasVertexAttributes () const
 
bool hasInstanceAttributes () const
 
size_t vertexStride () const
 
size_t instanceStride () const
 
virtual void addToKey (const GrShaderCaps &, skgpu::KeyBuilder *) const =0
 
void getAttributeKey (skgpu::KeyBuilder *b) const
 
virtual std::unique_ptr< ProgramImplmakeProgramImpl (const GrShaderCaps &) const =0
 
- Public Member Functions inherited from GrProcessor
virtual ~GrProcessor ()=default
 
virtual const char * name () const =0
 
void * operator new (size_t size)
 
void * operator new (size_t object_size, size_t footer_size)
 
void operator delete (void *target)
 
void * operator new (size_t size, void *placement)
 
void operator delete (void *target, void *placement)
 
template<typename T >
const Tcast () const
 
ClassID classID () const
 
- Static Public Attributes inherited from GrGeometryProcessor
static constexpr int kCoordTransformKeyBits = 4
 
- Static Protected Member Functions inherited from GrGeometryProcessor
static Attribute MakeColorAttribute (const char *name, bool wideColor)
 

Detailed Description

Definition at line 15 of file GrPathTessellationShader.h.

Member Typedef Documentation

◆ PatchAttribs

Definition at line 17 of file GrPathTessellationShader.h.

Constructor & Destructor Documentation

◆ GrPathTessellationShader()

GrPathTessellationShader::GrPathTessellationShader ( ClassID  classID,
GrPrimitiveType  primitiveType,
const SkMatrix viewMatrix,
const SkPMColor4f color,
PatchAttribs  attribs 
)
inlineprotected

Definition at line 110 of file GrPathTessellationShader.h.

116 , fAttribs(attribs) {
117 }
ClassID classID() const
Definition: GrProcessor.h:129
GrPrimitiveType primitiveType() const
const SkPMColor4f & color() const
const SkMatrix & viewMatrix() const
GrTessellationShader(ClassID classID, GrPrimitiveType primitiveType, const SkMatrix &viewMatrix, const SkPMColor4f &color)

Member Function Documentation

◆ Make()

GrPathTessellationShader * GrPathTessellationShader::Make ( const GrShaderCaps shaderCaps,
SkArenaAlloc arena,
const SkMatrix viewMatrix,
const SkPMColor4f color,
PatchAttribs  attribs 
)
static

Definition at line 256 of file GrPathTessellationShader.cpp.

260 {
261 // We should use explicit curve type when, and only when, there isn't infinity support.
262 // Otherwise the GPU can infer curve type based on infinity.
263 SkASSERT(shaderCaps.fInfinitySupport != (attribs & PatchAttribs::kExplicitCurveType));
264 return arena->make<MiddleOutShader>(shaderCaps, viewMatrix, color, attribs);
265}
#define SkASSERT(cond)
Definition: SkAssert.h:116
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
Definition: SkArenaAlloc.h:120
bool fInfinitySupport
Definition: SkSLUtil.h:103

◆ MakeSimpleTriangleShader()

GrPathTessellationShader * GrPathTessellationShader::MakeSimpleTriangleShader ( SkArenaAlloc arena,
const SkMatrix viewMatrix,
const SkPMColor4f color 
)
static

Definition at line 267 of file GrPathTessellationShader.cpp.

268 {
269 return arena->make<SimpleTriangleShader>(viewMatrix, color);
270}

◆ MakeStencilOnlyPipeline()

const GrPipeline * GrPathTessellationShader::MakeStencilOnlyPipeline ( const ProgramArgs args,
GrAAType  aaType,
const GrAppliedHardClip hardClip,
GrPipeline::InputFlags  pipelineFlags = GrPipeline::InputFlags::kNone 
)
static

Definition at line 272 of file GrPathTessellationShader.cpp.

276 {
277 GrPipeline::InitArgs pipelineArgs;
278 pipelineArgs.fInputFlags = pipelineFlags;
279 pipelineArgs.fCaps = args.fCaps;
280 return args.fArena->make<GrPipeline>(pipelineArgs,
282 hardClip);
283}
static sk_sp< const GrXferProcessor > MakeXferProcessor()
G_BEGIN_DECLS G_MODULE_EXPORT FlValue * args
InputFlags fInputFlags
Definition: GrPipeline.h:63
const GrCaps * fCaps
Definition: GrPipeline.h:64

◆ StencilPathSettings()

static const GrUserStencilSettings * GrPathTessellationShader::StencilPathSettings ( GrFillRule  fillRule)
inlinestatic

Definition at line 47 of file GrPathTessellationShader.h.

47 {
48 // Increments clockwise triangles and decrements counterclockwise. Used for "winding" fill.
49 constexpr static GrUserStencilSettings kIncrDecrStencil(
51 0x0000, 0x0000,
53 0xffff, 0xffff,
56 0xffff, 0xffff>());
57
58 // Inverts the bottom stencil bit. Used for "even/odd" fill.
59 constexpr static GrUserStencilSettings kInvertStencil(
61 0x0000,
63 0xffff,
66 0x0001>());
67
68 return (fillRule == GrFillRule::kNonzero) ? &kIncrDecrStencil : &kInvertStencil;
69 }
static constexpr Init< Ref, Test, TestMask, PassOp, FailOp, WriteMask > StaticInit()
static constexpr InitSeparate< CWRef, CCWRef, CWTest, CCWTest, CWTestMask, CCWTestMask, CWPassOp, CCWPassOp, CWFailOp, CCWFailOp, CWWriteMask, CCWWriteMask > StaticInitSeparate()

◆ TestAndResetStencilSettings()

static const GrUserStencilSettings * GrPathTessellationShader::TestAndResetStencilSettings ( bool  isInverseFill = false)
inlinestatic

Definition at line 74 of file GrPathTessellationShader.h.

74 {
77 0x0000,
78 // No need to check the clip because the previous stencil pass will have only
79 // written to samples already inside the clip.
81 0xffff,
84 0xffff>());
85
86 constexpr static GrUserStencilSettings kTestAndResetStencilInverted(
88 0x0000,
89 // No need to check the clip because the previous stencil pass will have only
90 // written to samples already inside the clip.
92 0xffff,
95 0xffff>());
96
97 return isInverseFill ? &kTestAndResetStencilInverted : &kTestAndResetStencil;
98 }
static constexpr GrUserStencilSettings kTestAndResetStencil(GrUserStencilSettings::StaticInit< 0x0000, GrUserStencilTest::kLessIfInClip, 0x0001, GrUserStencilOp::kZero, GrUserStencilOp::kReplace, 0xffff >())

Member Data Documentation

◆ fAttribs

const PatchAttribs GrPathTessellationShader::fAttribs
protected

Definition at line 147 of file GrPathTessellationShader.h.

◆ kMiddleOutVertexStride

constexpr size_t GrPathTessellationShader::kMiddleOutVertexStride = 2 * sizeof(float)
staticconstexprprotected

Definition at line 108 of file GrPathTessellationShader.h.


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