aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr/GrCCPRTriangleShader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ccpr/GrCCPRTriangleShader.h')
-rw-r--r--src/gpu/ccpr/GrCCPRTriangleShader.h25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/gpu/ccpr/GrCCPRTriangleShader.h b/src/gpu/ccpr/GrCCPRTriangleShader.h
index 1f58e84d78..02eb77174b 100644
--- a/src/gpu/ccpr/GrCCPRTriangleShader.h
+++ b/src/gpu/ccpr/GrCCPRTriangleShader.h
@@ -11,35 +11,38 @@
#include "ccpr/GrCCPRCoverageProcessor.h"
/**
- * Passes 1 & 2: Draw the triangle's conservative raster hull with a coverage of 1, then smooth the
- * edges by drawing the conservative rasters of all 3 edges and interpolating from
- * coverage=-1 on the outside to coverage=0 on the inside.
+ * Steps 1 & 2: Draw the triangle's conservative raster hull with a coverage of +1, then smooth the
+ * edges by drawing the conservative rasters of all 3 edges and interpolating from
+ * coverage=-1 on the outside to coverage=0 on the inside. The Impl may choose to
+ * implement these steps in either one or two actual render passes.
*/
class GrCCPRTriangleShader : public GrCCPRCoverageProcessor::Shader {
- WindHandling onEmitVaryings(GrGLSLVaryingHandler*, SkString* code, const char* position,
- const char* coverage, const char* wind) override;
+ WindHandling onEmitVaryings(GrGLSLVaryingHandler*, GrGLSLVarying::Scope, SkString* code,
+ const char* position, const char* coverage,
+ const char* wind) override;
void onEmitFragmentCode(GrGLSLPPFragmentBuilder*, const char* outputCoverage) const override;
- GrGLSLVarying fCoverageTimesWind{kHalf_GrSLType, GrGLSLVarying::Scope::kGeoToFrag};
+ GrGLSLVarying fCoverageTimesWind;
};
/**
- * Pass 3: Touch up the corner pixels. Here we fix the simple distance-to-edge coverage analysis
+ * Step 3: Touch up the corner pixels. Here we fix the simple distance-to-edge coverage analysis
* done previously so that it takes into account the region that is outside both edges at
* the same time.
*/
class GrCCPRTriangleCornerShader : public GrCCPRCoverageProcessor::Shader {
void emitSetupCode(GrGLSLVertexGeoBuilder*, const char* pts, const char* repetitionID,
const char* wind, GeometryVars*) const override;
- WindHandling onEmitVaryings(GrGLSLVaryingHandler*, SkString* code, const char* position,
- const char* coverage, const char* wind) override;
+ WindHandling onEmitVaryings(GrGLSLVaryingHandler*, GrGLSLVarying::Scope, SkString* code,
+ const char* position, const char* coverage,
+ const char* wind) override;
void onEmitFragmentCode(GrGLSLPPFragmentBuilder* f, const char* outputCoverage) const override;
GrShaderVar fAABoxMatrices{"aa_box_matrices", kFloat2x2_GrSLType, 2};
GrShaderVar fAABoxTranslates{"aa_box_translates", kFloat2_GrSLType, 2};
GrShaderVar fGeoShaderBisects{"bisects", kFloat2_GrSLType, 2};
- GrGLSLVarying fCornerLocationInAABoxes{kFloat2x2_GrSLType, GrGLSLVarying::Scope::kGeoToFrag};
- GrGLSLVarying fBisectInAABoxes{kFloat2x2_GrSLType, GrGLSLVarying::Scope::kGeoToFrag};
+ GrGLSLVarying fCornerLocationInAABoxes;
+ GrGLSLVarying fBisectInAABoxes;
};
#endif