Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | List of all members
GrDistanceFieldPathGeoProc Class Reference

#include <GrDistanceFieldGeoProc.h>

Inheritance diagram for GrDistanceFieldPathGeoProc:
GrGeometryProcessor GrProcessor

Classes

class  Impl
 

Public Member Functions

 ~GrDistanceFieldPathGeoProc () override
 
const char * name () const override
 
void addNewViews (const GrSurfaceProxyView *, int numActiveViews, GrSamplerState)
 
void addToKey (const GrShaderCaps &, skgpu::KeyBuilder *) 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
 
void getAttributeKey (skgpu::KeyBuilder *b) const
 
- Public Member Functions inherited from GrProcessor
virtual ~GrProcessor ()=default
 
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, const GrShaderCaps &caps, const GrSurfaceProxyView *views, int numActiveViews, GrSamplerState params, const SkMatrix &localMatrix, uint32_t flags)
 
- Static Public Member Functions inherited from GrGeometryProcessor
static uint32_t ComputeCoordTransformsKey (const GrFragmentProcessor &fp)
 

Static Public Attributes

static constexpr int kMaxTextures = 4
 
- Static Public Attributes inherited from GrGeometryProcessor
static constexpr int kCoordTransformKeyBits = 4
 

Private Member Functions

const TextureSampleronTextureSampler (int i) const override
 

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
}
 
- 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 color of this effect is a modulation of the input color and a sample from a distance field texture (using a smoothed step function near 0.5). It allows explicit specification of the filtering and wrap modes (GrSamplerState). The input coords are a custom attribute. No gamma correct blending is applied. Used for paths only.

Definition at line 152 of file GrDistanceFieldGeoProc.h.

Constructor & Destructor Documentation

◆ ~GrDistanceFieldPathGeoProc()

GrDistanceFieldPathGeoProc::~GrDistanceFieldPathGeoProc ( )
inlineoverride

Definition at line 167 of file GrDistanceFieldGeoProc.h.

167{}

Member Function Documentation

◆ addNewViews()

void GrDistanceFieldPathGeoProc::addNewViews ( const GrSurfaceProxyView views,
int  numActiveViews,
GrSamplerState  params 
)

Definition at line 515 of file GrDistanceFieldGeoProc.cpp.

517 {
518 SkASSERT(numViews <= kMaxTextures);
519 // Just to make sure we don't try to add too many proxies
520 numViews = std::min(numViews, kMaxTextures);
521
522 if (!fTextureSamplers[0].isInitialized()) {
523 fAtlasDimensions = views[0].proxy()->dimensions();
524 }
525
526 for (int i = 0; i < numViews; ++i) {
527 const GrSurfaceProxy* proxy = views[i].proxy();
528 SkASSERT(proxy);
529 SkASSERT(proxy->dimensions() == fAtlasDimensions);
530 if (!fTextureSamplers[i].isInitialized()) {
531 fTextureSamplers[i].reset(params, proxy->backendFormat(), views[i].swizzle());
532 }
533 }
534 this->setTextureSamplerCnt(numViews);
535}
#define SkASSERT(cond)
Definition SkAssert.h:116
void reset(GrSamplerState, const GrBackendFormat &, const skgpu::Swizzle &)
void setTextureSamplerCnt(int cnt)
GrSurfaceProxy * proxy() const
const GrBackendFormat & backendFormat() const
SkISize dimensions() const
const EmbeddedViewParams * params

◆ addToKey()

void GrDistanceFieldPathGeoProc::addToKey ( const GrShaderCaps ,
skgpu::KeyBuilder  
) const
overridevirtual

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 537 of file GrDistanceFieldGeoProc.cpp.

538 {
539 uint32_t key = fFlags;
540 key |= ProgramImpl::ComputeMatrixKey(caps, fLocalMatrix) << 16;
541 key |= fLocalMatrix.hasPerspective() << (16 + ProgramImpl::kMatrixKeyBits);
542 b->add32(key);
543 b->add32(this->numTextureSamplers());
544}
bool hasPerspective() const
Definition SkMatrix.h:312
static bool b

◆ Make()

static GrGeometryProcessor * GrDistanceFieldPathGeoProc::Make ( SkArenaAlloc arena,
const GrShaderCaps caps,
const GrSurfaceProxyView views,
int  numActiveViews,
GrSamplerState  params,
const SkMatrix localMatrix,
uint32_t  flags 
)
inlinestatic

The local matrix should be identity if local coords are not required by the GrPipeline.

Definition at line 157 of file GrDistanceFieldGeoProc.h.

160 {
161 return arena->make([&](void* ptr) {
162 return new (ptr) GrDistanceFieldPathGeoProc(caps, views, numActiveViews,
163 params, localMatrix, flags);
164 });
165 }
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
FlutterSemanticsFlag flags

◆ makeProgramImpl()

std::unique_ptr< GrGeometryProcessor::ProgramImpl > GrDistanceFieldPathGeoProc::makeProgramImpl ( const GrShaderCaps ) const
overridevirtual

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

Implements GrGeometryProcessor.

Definition at line 546 of file GrDistanceFieldGeoProc.cpp.

547 {
548 return std::make_unique<Impl>();
549}

◆ name()

const char * GrDistanceFieldPathGeoProc::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 169 of file GrDistanceFieldGeoProc.h.

169{ return "DistanceFieldPath"; }

◆ onTextureSampler()

const TextureSampler & GrDistanceFieldPathGeoProc::onTextureSampler ( int  i) const
inlineoverrideprivatevirtual

Reimplemented from GrGeometryProcessor.

Definition at line 187 of file GrDistanceFieldGeoProc.h.

187{ return fTextureSamplers[i]; }

Member Data Documentation

◆ kMaxTextures

constexpr int GrDistanceFieldPathGeoProc::kMaxTextures = 4
inlinestaticconstexpr

Definition at line 154 of file GrDistanceFieldGeoProc.h.


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