Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | List of all members
skgpu::ganesh::QuadPerEdgeAA::VertexSpec Struct Reference

#include <QuadPerEdgeAA.h>

Public Member Functions

 VertexSpec ()
 
 VertexSpec (GrQuad::Type deviceQuadType, ColorType colorType, GrQuad::Type localQuadType, bool hasLocalCoords, Subset subset, GrAAType aa, bool coverageAsAlpha, IndexBufferOption indexBufferOption)
 
GrQuad::Type deviceQuadType () const
 
GrQuad::Type localQuadType () const
 
IndexBufferOption indexBufferOption () const
 
bool hasLocalCoords () const
 
ColorType colorType () const
 
bool hasVertexColors () const
 
bool hasSubset () const
 
bool usesCoverageAA () const
 
bool compatibleWithCoverageAsAlpha () const
 
bool requiresGeometrySubset () const
 
int deviceDimensionality () const
 
int localDimensionality () const
 
int verticesPerQuad () const
 
CoverageMode coverageMode () const
 
size_t vertexSize () const
 
bool needsIndexBuffer () const
 
GrPrimitiveType primitiveType () const
 

Detailed Description

Definition at line 54 of file QuadPerEdgeAA.h.

Constructor & Destructor Documentation

◆ VertexSpec() [1/2]

skgpu::ganesh::QuadPerEdgeAA::VertexSpec::VertexSpec ( )
inline

Definition at line 56 of file QuadPerEdgeAA.h.

57 : fDeviceQuadType(0) // kAxisAligned
58 , fLocalQuadType(0) // kAxisAligned
59 , fIndexBufferOption(0) // kPictureFramed
60 , fHasLocalCoords(false)
61 , fColorType(0) // kNone
62 , fHasSubset(false)
63 , fUsesCoverageAA(false)
64 , fCompatibleWithCoverageAsAlpha(false)
65 , fRequiresGeometrySubset(false) {}

◆ VertexSpec() [2/2]

skgpu::ganesh::QuadPerEdgeAA::VertexSpec::VertexSpec ( GrQuad::Type  deviceQuadType,
ColorType  colorType,
GrQuad::Type  localQuadType,
bool  hasLocalCoords,
Subset  subset,
GrAAType  aa,
bool  coverageAsAlpha,
IndexBufferOption  indexBufferOption 
)
inline

Definition at line 67 of file QuadPerEdgeAA.h.

75 : fDeviceQuadType(static_cast<unsigned>(deviceQuadType))
76 , fLocalQuadType(static_cast<unsigned>(localQuadType))
77 , fIndexBufferOption(static_cast<unsigned>(indexBufferOption))
78 , fHasLocalCoords(hasLocalCoords)
79 , fColorType(static_cast<unsigned>(colorType))
80 , fHasSubset(static_cast<unsigned>(subset))
81 , fUsesCoverageAA(aa == GrAAType::kCoverage)
82 , fCompatibleWithCoverageAsAlpha(coverageAsAlpha)
83 , fRequiresGeometrySubset(aa == GrAAType::kCoverage &&
IndexBufferOption indexBufferOption() const

Member Function Documentation

◆ colorType()

ColorType skgpu::ganesh::QuadPerEdgeAA::VertexSpec::colorType ( ) const
inline

Definition at line 92 of file QuadPerEdgeAA.h.

92{ return static_cast<ColorType>(fColorType); }

◆ compatibleWithCoverageAsAlpha()

bool skgpu::ganesh::QuadPerEdgeAA::VertexSpec::compatibleWithCoverageAsAlpha ( ) const
inline

Definition at line 96 of file QuadPerEdgeAA.h.

96{ return fCompatibleWithCoverageAsAlpha; }

◆ coverageMode()

CoverageMode skgpu::ganesh::QuadPerEdgeAA::VertexSpec::coverageMode ( ) const

Definition at line 540 of file QuadPerEdgeAA.cpp.

540 {
541 if (this->usesCoverageAA()) {
542 if (this->compatibleWithCoverageAsAlpha() && this->hasVertexColors() &&
543 !this->requiresGeometrySubset()) {
544 // Using a geometric subset acts as a second source of coverage and folding
545 // the original coverage into color makes it impossible to apply the color's
546 // alpha to the geometric subset's coverage when the original shape is clipped.
548 } else {
550 }
551 } else {
552 return CoverageMode::kNone;
553 }
554}

◆ deviceDimensionality()

int skgpu::ganesh::QuadPerEdgeAA::VertexSpec::deviceDimensionality ( ) const

Definition at line 532 of file QuadPerEdgeAA.cpp.

532 {
533 return this->deviceQuadType() == GrQuad::Type::kPerspective ? 3 : 2;
534}

◆ deviceQuadType()

GrQuad::Type skgpu::ganesh::QuadPerEdgeAA::VertexSpec::deviceQuadType ( ) const
inline

Definition at line 86 of file QuadPerEdgeAA.h.

86{ return static_cast<GrQuad::Type>(fDeviceQuadType); }

◆ hasLocalCoords()

bool skgpu::ganesh::QuadPerEdgeAA::VertexSpec::hasLocalCoords ( ) const
inline

Definition at line 91 of file QuadPerEdgeAA.h.

91{ return fHasLocalCoords; }

◆ hasSubset()

bool skgpu::ganesh::QuadPerEdgeAA::VertexSpec::hasSubset ( ) const
inline

Definition at line 94 of file QuadPerEdgeAA.h.

94{ return fHasSubset; }

◆ hasVertexColors()

bool skgpu::ganesh::QuadPerEdgeAA::VertexSpec::hasVertexColors ( ) const
inline

Definition at line 93 of file QuadPerEdgeAA.h.

93{ return ColorType::kNone != this->colorType(); }

◆ indexBufferOption()

IndexBufferOption skgpu::ganesh::QuadPerEdgeAA::VertexSpec::indexBufferOption ( ) const
inline

Definition at line 88 of file QuadPerEdgeAA.h.

88 {
89 return static_cast<IndexBufferOption>(fIndexBufferOption);
90 }

◆ localDimensionality()

int skgpu::ganesh::QuadPerEdgeAA::VertexSpec::localDimensionality ( ) const

Definition at line 536 of file QuadPerEdgeAA.cpp.

536 {
537 return fHasLocalCoords ? (this->localQuadType() == GrQuad::Type::kPerspective ? 3 : 2) : 0;
538}

◆ localQuadType()

GrQuad::Type skgpu::ganesh::QuadPerEdgeAA::VertexSpec::localQuadType ( ) const
inline

Definition at line 87 of file QuadPerEdgeAA.h.

87{ return static_cast<GrQuad::Type>(fLocalQuadType); }

◆ needsIndexBuffer()

bool skgpu::ganesh::QuadPerEdgeAA::VertexSpec::needsIndexBuffer ( ) const
inline

Definition at line 108 of file QuadPerEdgeAA.h.

108 {
109 return this->indexBufferOption() != IndexBufferOption::kTriStrips;
110 }

◆ primitiveType()

GrPrimitiveType skgpu::ganesh::QuadPerEdgeAA::VertexSpec::primitiveType ( ) const
inline

Definition at line 112 of file QuadPerEdgeAA.h.

112 {
113 switch (this->indexBufferOption()) {
114 case IndexBufferOption::kPictureFramed:
116 case IndexBufferOption::kIndexedRects:
118 case IndexBufferOption::kTriStrips:
120 }
121
123 }
#define SkUNREACHABLE
Definition SkAssert.h:135

◆ requiresGeometrySubset()

bool skgpu::ganesh::QuadPerEdgeAA::VertexSpec::requiresGeometrySubset ( ) const
inline

Definition at line 97 of file QuadPerEdgeAA.h.

97{ return fRequiresGeometrySubset; }

◆ usesCoverageAA()

bool skgpu::ganesh::QuadPerEdgeAA::VertexSpec::usesCoverageAA ( ) const
inline

Definition at line 95 of file QuadPerEdgeAA.h.

95{ return fUsesCoverageAA; }

◆ vertexSize()

size_t skgpu::ganesh::QuadPerEdgeAA::VertexSpec::vertexSize ( ) const

Definition at line 557 of file QuadPerEdgeAA.cpp.

557 {
558 bool needsPerspective = (this->deviceDimensionality() == 3);
560
561 size_t count = 0;
562
563 if (coverageMode == CoverageMode::kWithPosition) {
564 if (needsPerspective) {
566 } else {
569 }
570 } else {
571 if (needsPerspective) {
573 } else {
575 }
576 }
577
578 if (this->requiresGeometrySubset()) {
580 }
581
583
584 if (ColorType::kByte == this->colorType()) {
586 } else if (ColorType::kFloat == this->colorType()) {
588 }
589
590 if (this->hasSubset()) {
592 }
593
594 return count;
595}
int count
static constexpr size_t GrVertexAttribTypeSize(GrVertexAttribType type)
@ kFloat2_GrVertexAttribType
@ kUByte4_norm_GrVertexAttribType
@ kFloat3_GrVertexAttribType
@ kFloat_GrVertexAttribType
@ kFloat4_GrVertexAttribType

◆ verticesPerQuad()

int skgpu::ganesh::QuadPerEdgeAA::VertexSpec::verticesPerQuad ( ) const
inline

Definition at line 103 of file QuadPerEdgeAA.h.

103{ return fUsesCoverageAA ? 8 : 4; }

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