Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | List of all members
CircleGeometryProcessor Class Reference
Inheritance diagram for CircleGeometryProcessor:
GrGeometryProcessor GrProcessor

Public Member Functions

const char * name () const override
 
void addToKey (const GrShaderCaps &caps, skgpu::KeyBuilder *b) const override
 
std::unique_ptr< ProgramImplmakeProgramImpl (const GrShaderCaps &) const override
 
- 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 Member Functions

static GrGeometryProcessorMake (SkArenaAlloc *arena, bool stroke, bool clipPlane, bool isectPlane, bool unionPlane, bool roundCaps, bool wideColor, const SkMatrix &localMatrix)
 
- Static Public Member Functions inherited from GrGeometryProcessor
static uint32_t ComputeCoordTransformsKey (const GrFragmentProcessor &fp)
 

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
}
 
- Static Public Attributes inherited from GrGeometryProcessor
static constexpr int kCoordTransformKeyBits = 4
 
- 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
 
- Static Protected Member Functions inherited from GrGeometryProcessor
static Attribute MakeColorAttribute (const char *name, bool wideColor)
 
- Protected Attributes inherited from GrProcessor
const ClassID fClassID
 

Detailed Description

The output of this effect is a modulation of the input color and coverage for a circle. It operates in a space normalized by the circle radius (outer radius in the case of a stroke) with origin at the circle center. Three vertex attributes are used: vec2f : position in device space of the bounding geometry vertices vec4ub: color vec4f : (p.xy, outerRad, innerRad) p is the position in the normalized space. outerRad is the outerRadius in device space. innerRad is the innerRadius in normalized space (ignored if not stroking). Additional clip planes are supported for rendering circular arcs. The additional planes are either intersected or unioned together. Up to three planes are supported (an initial plane, a plane intersected with the initial plane, and a plane unioned with the first two). Only two are useful for any given arc, but having all three in one instance allows combining different types of arcs. Round caps for stroking are allowed as well. The caps are specified as two circle center points in the same space as p.xy.

Definition at line 75 of file GrOvalOpFactory.cpp.

Member Function Documentation

◆ addToKey()

void CircleGeometryProcessor::addToKey ( const GrShaderCaps ,
skgpu::KeyBuilder  
) const
inlineoverridevirtual

Adds a key on the skgpu::KeyBuilder that reflects any variety in the code that the geometry processor subclass can emit.

Implements GrGeometryProcessor.

Definition at line 88 of file GrOvalOpFactory.cpp.

88 {
89 b->addBool(fStroke, "stroked" );
90 b->addBool(fInClipPlane.isInitialized(), "clipPlane" );
91 b->addBool(fInIsectPlane.isInitialized(), "isectPlane" );
92 b->addBool(fInUnionPlane.isInitialized(), "unionPlane" );
93 b->addBool(fInRoundCapCenters.isInitialized(), "roundCapCenters");
95 ProgramImpl::ComputeMatrixKey(caps, fLocalMatrix),
96 "localMatrixType");
97 }
constexpr bool isInitialized() const
static uint32_t ComputeMatrixKey(const GrShaderCaps &caps, const SkMatrix &mat)
static bool b

◆ Make()

static GrGeometryProcessor * CircleGeometryProcessor::Make ( SkArenaAlloc arena,
bool  stroke,
bool  clipPlane,
bool  isectPlane,
bool  unionPlane,
bool  roundCaps,
bool  wideColor,
const SkMatrix localMatrix 
)
inlinestatic

Definition at line 77 of file GrOvalOpFactory.cpp.

79 {
80 return arena->make([&](void* ptr) {
81 return new (ptr) CircleGeometryProcessor(stroke, clipPlane, isectPlane, unionPlane,
82 roundCaps, wideColor, localMatrix);
83 });
84 }
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
Definition: SkArenaAlloc.h:120

◆ makeProgramImpl()

std::unique_ptr< ProgramImpl > CircleGeometryProcessor::makeProgramImpl ( const GrShaderCaps ) const
inlineoverridevirtual

Returns a new instance of the appropriate implementation class for the given GrGeometryProcessor.

Implements GrGeometryProcessor.

Definition at line 99 of file GrOvalOpFactory.cpp.

99 {
100 return std::make_unique<Impl>();
101 }

◆ name()

const char * CircleGeometryProcessor::name ( ) const
inlineoverridevirtual

Human-meaningful string to identify this processor; may be embedded in generated shader code and must be a legal SkSL identifier prefix.

Implements GrProcessor.

Definition at line 86 of file GrOvalOpFactory.cpp.

86{ return "CircleGeometryProcessor"; }

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