Flutter Engine
The Flutter Engine
|
#include <GrGeometryProcessor.h>
Classes | |
class | Attribute |
class | AttributeSet |
class | ProgramImpl |
class | TextureSampler |
Public Member Functions | |
GrGeometryProcessor (ClassID) | |
int | numTextureSamplers () const |
const TextureSampler & | textureSampler (int index) const |
int | numVertexAttributes () const |
const AttributeSet & | vertexAttributes () const |
int | numInstanceAttributes () const |
const AttributeSet & | instanceAttributes () 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< ProgramImpl > | makeProgramImpl (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 T & | cast () const |
ClassID | classID () const |
Static Public Member Functions | |
static uint32_t | ComputeCoordTransformsKey (const GrFragmentProcessor &fp) |
Static Public Attributes | |
static constexpr int | kCoordTransformKeyBits = 4 |
Protected Member Functions | |
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 | |
GrProcessor & | operator= (const GrProcessor &)=delete |
Static Protected Member Functions | |
static Attribute | MakeColorAttribute (const char *name, bool wideColor) |
Private Member Functions | |
virtual const TextureSampler & | onTextureSampler (int) const |
The GrGeometryProcessor represents some kind of geometric primitive. This includes the shape of the primitive and the inherent color of the primitive. The GrGeometryProcessor is responsible for providing a color and coverage input into the Ganesh rendering pipeline. Through optimization, Ganesh may decide a different color, no color, and / or no coverage are required from the GrGeometryProcessor, so the GrGeometryProcessor must be able to support this functionality.
There are two feedback loops between the GrFragmentProcessors, the GrXferProcessor, and the GrGeometryProcessor. These loops run on the CPU and to determine known properties of the final color and coverage inputs to the GrXferProcessor in order to perform optimizations that preserve correctness. The GrDrawOp seeds these loops with initial color and coverage, in its getProcessorAnalysisInputs implementation. These seed values are processed by the subsequent stages of the rendering pipeline and the output is then fed back into the GrDrawOp in the applyPipelineOptimizations call, where the op can use the information to inform decisions about GrGeometryProcessor creation.
Note that all derived classes should hide their constructors and provide a Make factory function that takes an arena (except for Tesselation-specific classes). This is because geometry processors can be created in either the record-time or flush-time arenas which define their lifetimes (i.e., a DDLs life time in the first case and a single flush in the second case).
Definition at line 53 of file GrGeometryProcessor.h.
GrGeometryProcessor::GrGeometryProcessor | ( | ClassID | classID | ) |
Definition at line 20 of file GrGeometryProcessor.cpp.
|
pure virtual |
Adds a key on the skgpu::KeyBuilder that reflects any variety in the code that the geometry processor subclass can emit.
Implemented in skgpu::ganesh::QuadPerEdgeAA::QuadPerEdgeAAGeometryProcessor, GrDistanceFieldA8TextGeoProc, GrDistanceFieldPathGeoProc, GrDistanceFieldLCDTextGeoProc, GrRRectShadowGeoProc, GrConicEffect, GrQuadEffect, GrBitmapTextGeoProc, DefaultGeoProc, CircleGeometryProcessor, ButtCapDashedCircleGeometryProcessor, EllipseGeometryProcessor, and DIEllipseGeometryProcessor.
|
static |
Computes a key for the transforms owned by an FP based on the shader code that will be emitted by the primitive processor to implement them.
Definition at line 27 of file GrGeometryProcessor.cpp.
void GrGeometryProcessor::getAttributeKey | ( | skgpu::KeyBuilder * | b | ) | const |
Definition at line 37 of file GrGeometryProcessor.cpp.
|
inline |
Definition at line 189 of file GrGeometryProcessor.h.
|
inline |
Definition at line 188 of file GrGeometryProcessor.h.
|
inline |
Definition at line 186 of file GrGeometryProcessor.h.
|
inline |
Definition at line 197 of file GrGeometryProcessor.h.
|
inlinestaticprotected |
Definition at line 224 of file GrGeometryProcessor.h.
|
pure virtual |
Returns a new instance of the appropriate implementation class for the given GrGeometryProcessor.
Implemented in GrConicEffect, GrQuadEffect, GrDistanceFieldA8TextGeoProc, GrDistanceFieldPathGeoProc, GrDistanceFieldLCDTextGeoProc, GrRRectShadowGeoProc, DefaultGeoProc, CircleGeometryProcessor, ButtCapDashedCircleGeometryProcessor, EllipseGeometryProcessor, DIEllipseGeometryProcessor, skgpu::ganesh::QuadPerEdgeAA::QuadPerEdgeAAGeometryProcessor, and GrBitmapTextGeoProc.
|
inline |
Definition at line 185 of file GrGeometryProcessor.h.
|
inline |
Definition at line 181 of file GrGeometryProcessor.h.
|
inline |
Definition at line 183 of file GrGeometryProcessor.h.
|
inlineprivatevirtual |
Definition at line 250 of file GrGeometryProcessor.h.
|
inlineprotected |
Definition at line 232 of file GrGeometryProcessor.h.
|
inlineprotected |
Definition at line 240 of file GrGeometryProcessor.h.
|
inlineprotected |
Definition at line 244 of file GrGeometryProcessor.h.
|
inlineprotected |
Definition at line 229 of file GrGeometryProcessor.h.
|
inlineprotected |
Definition at line 237 of file GrGeometryProcessor.h.
const GrGeometryProcessor::TextureSampler & GrGeometryProcessor::textureSampler | ( | int | index | ) | const |
Definition at line 22 of file GrGeometryProcessor.cpp.
|
inline |
Definition at line 184 of file GrGeometryProcessor.h.
|
inline |
A common practice is to populate the the vertex/instance's memory using an implicit array of structs. In this case, it is best to assert that: stride == sizeof(struct)
Definition at line 196 of file GrGeometryProcessor.h.
|
inlinestaticconstexpr |
Definition at line 205 of file GrGeometryProcessor.h.