Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
skgpu::graphite::MiddleOutFanRenderStep Class Referencefinal

#include <MiddleOutFanRenderStep.h>

Inheritance diagram for skgpu::graphite::MiddleOutFanRenderStep:
skgpu::graphite::RenderStep

Public Member Functions

 MiddleOutFanRenderStep (bool evenOdd)
 
 ~MiddleOutFanRenderStep () override
 
std::string vertexSkSL () const override
 
void writeVertices (DrawWriter *, const DrawParams &, skvx::ushort2 ssboIndices) const override
 
void writeUniformsAndTextures (const DrawParams &, PipelineDataGatherer *) const override
 
- Public Member Functions inherited from skgpu::graphite::RenderStep
virtual ~RenderStep ()=default
 
virtual void writeVertices (DrawWriter *, const DrawParams &, skvx::ushort2 ssboIndices) const =0
 
virtual void writeUniformsAndTextures (const DrawParams &, PipelineDataGatherer *) const =0
 
virtual std::string vertexSkSL () const =0
 
virtual std::string texturesAndSamplersSkSL (const ResourceBindingRequirements &, int *nextBindingIndex) const
 
virtual const char * fragmentCoverageSkSL () const
 
virtual const char * fragmentColorSkSL () const
 
uint32_t uniqueID () const
 
const char * name () const
 
bool requiresMSAA () const
 
bool performsShading () const
 
bool hasTextures () const
 
bool emitsPrimitiveColor () const
 
bool outsetBoundsForAA () const
 
Coverage coverage () const
 
PrimitiveType primitiveType () const
 
size_t vertexStride () const
 
size_t instanceStride () const
 
size_t numUniforms () const
 
size_t numVertexAttributes () const
 
size_t numInstanceAttributes () const
 
SkSpan< const Uniformuniforms () const
 
SkSpan< const AttributevertexAttributes () const
 
SkSpan< const AttributeinstanceAttributes () const
 
SkSpan< const Varyingvaryings () const
 
const DepthStencilSettingsdepthStencilSettings () const
 
SkEnumBitMask< DepthStencilFlagsdepthStencilFlags () const
 

Additional Inherited Members

- Static Public Member Functions inherited from skgpu::graphite::RenderStep
static const char * ssboIndicesAttribute ()
 
static const char * ssboIndicesVarying ()
 
- Protected Types inherited from skgpu::graphite::RenderStep
enum class  Flags : unsigned {
  kNone = 0b0000000 , kRequiresMSAA = 0b0000001 , kPerformsShading = 0b0000010 , kHasTextures = 0b0000100 ,
  kEmitsCoverage = 0b0001000 , kLCDCoverage = 0b0010000 , kEmitsPrimitiveColor = 0b0100000 , kOutsetBoundsForAA = 0b1000000
}
 
- Protected Member Functions inherited from skgpu::graphite::RenderStep
 RenderStep (std::string_view className, std::string_view variantName, SkEnumBitMask< Flags > flags, std::initializer_list< Uniform > uniforms, PrimitiveType primitiveType, DepthStencilSettings depthStencilSettings, SkSpan< const Attribute > vertexAttrs, SkSpan< const Attribute > instanceAttrs, SkSpan< const Varying > varyings={})
 

Detailed Description

Definition at line 15 of file MiddleOutFanRenderStep.h.

Constructor & Destructor Documentation

◆ MiddleOutFanRenderStep()

skgpu::graphite::MiddleOutFanRenderStep::MiddleOutFanRenderStep ( bool  evenOdd)

Definition at line 20 of file MiddleOutFanRenderStep.cpp.

21 : RenderStep("MiddleOutFanRenderStep",
22 evenOdd ? "even-odd" : "winding",
24 /*uniforms=*/{{"localToDevice", SkSLType::kFloat4x4}},
27 /*vertexAttrs=*/
31 /*instanceAttrs=*/{}) {}
RenderStep(std::string_view className, std::string_view variantName, SkEnumBitMask< Flags > flags, std::initializer_list< Uniform > uniforms, PrimitiveType primitiveType, DepthStencilSettings depthStencilSettings, SkSpan< const Attribute > vertexAttrs, SkSpan< const Attribute > instanceAttrs, SkSpan< const Varying > varyings={})
Definition: Renderer.cpp:19
constexpr DepthStencilSettings kWindingStencilPass
constexpr DepthStencilSettings kEvenOddStencilPass

◆ ~MiddleOutFanRenderStep()

skgpu::graphite::MiddleOutFanRenderStep::~MiddleOutFanRenderStep ( )
override

Definition at line 33 of file MiddleOutFanRenderStep.cpp.

33{}

Member Function Documentation

◆ vertexSkSL()

std::string skgpu::graphite::MiddleOutFanRenderStep::vertexSkSL ( ) const
overridevirtual

Implements skgpu::graphite::RenderStep.

Definition at line 35 of file MiddleOutFanRenderStep.cpp.

35 {
36 return R"(
37 float4 devPosition = localToDevice * float4(position, 0.0, 1.0);
38 devPosition.z = depth;
39 stepLocalCoords = position;
40 )";
41}

◆ writeUniformsAndTextures()

void skgpu::graphite::MiddleOutFanRenderStep::writeUniformsAndTextures ( const DrawParams params,
PipelineDataGatherer gatherer 
) const
overridevirtual

Implements skgpu::graphite::RenderStep.

Definition at line 65 of file MiddleOutFanRenderStep.cpp.

66 {
67 SkDEBUGCODE(UniformExpectationsValidator uev(gatherer, this->uniforms());)
68
69 gatherer->write(params.transform().matrix());
70}
SkDEBUGCODE(SK_SPI) SkThreadID SkGetThreadID()
SkSpan< const Uniform > uniforms() const
Definition: Renderer.h:143
const EmbeddedViewParams * params

◆ writeVertices()

void skgpu::graphite::MiddleOutFanRenderStep::writeVertices ( DrawWriter writer,
const DrawParams params,
skvx::ushort2  ssboIndices 
) const
overridevirtual

Implements skgpu::graphite::RenderStep.

Definition at line 43 of file MiddleOutFanRenderStep.cpp.

45 {
46 // TODO: Have Shape provide a path-like iterator so we don't actually have to convert non
47 // paths to SkPath just to iterate their pts/verbs
48 SkPath path = params.geometry().shape().asPath();
49
50 const int maxTrianglesInFans = std::max(path.countVerbs() - 2, 0);
51
52 float depth = params.order().depthAsFloat();
53
54 DrawWriter::Vertices verts{*writer};
55 verts.reserve(maxTrianglesInFans * 3);
56 for (tess::PathMiddleOutFanIter it(path); !it.done();) {
57 for (auto [p0, p1, p2] : it.nextStack()) {
58 verts.append(3) << p0 << depth << ssboIndices
59 << p1 << depth << ssboIndices
60 << p2 << depth << ssboIndices;
61 }
62 }
63}
Definition: SkPath.h:59
static float max(float r, float g, float b)
Definition: hsl.cpp:49
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition: switches.h:57

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