diff options
author | Chris Dalton <csmartdalton@google.com> | 2018-03-08 15:55:58 +0000 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-08 15:56:02 +0000 |
commit | baf3e78092243210ca4489e51134df6fc8a90eee (patch) | |
tree | 41d16430ad639f72787a148f04476ee079e9ad56 /src/gpu/ccpr/GrCCCubicShader.h | |
parent | fe462efbcb105914e4c4bbf689525b530a438773 (diff) |
Revert "ccpr: Draw curves in a single pass"
This reverts commit df04ce29490a24f9d5b4f5caafd8f6a3368a19e0.
Reason for revert: Going to revisit AAA quality
Original change's description:
> ccpr: Draw curves in a single pass
>
> Throws out the complicated MSAA curve corner shaders, and instead just
> ramps coverage to zero at bloat vertices that fall outside the curve.
>
> Updates SampleCCPRGeometry to better visualize this new geometry by
> clearing to black and drawing with SkBlendMode::kPlus.
>
> Bug: skia:
> Change-Id: Ibe86cbc741d8b015127b10dd43e3b52e7cb35732
> Reviewed-on: https://skia-review.googlesource.com/112626
> Commit-Queue: Chris Dalton <csmartdalton@google.com>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
TBR=bsalomon@google.com,csmartdalton@google.com
Change-Id: I014baa60b248d870717f5ee8794e0bed66da86e6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/113181
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src/gpu/ccpr/GrCCCubicShader.h')
-rw-r--r-- | src/gpu/ccpr/GrCCCubicShader.h | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/src/gpu/ccpr/GrCCCubicShader.h b/src/gpu/ccpr/GrCCCubicShader.h index 70d3300461..063549264a 100644 --- a/src/gpu/ccpr/GrCCCubicShader.h +++ b/src/gpu/ccpr/GrCCCubicShader.h @@ -24,17 +24,37 @@ class GrCCCubicShader : public GrCCCoverageProcessor::Shader { protected: void emitSetupCode(GrGLSLVertexGeoBuilder*, const char* pts, const char* repetitionID, - const char* wind, GeometryVars*) const override; + const char* wind, GeometryVars*) const final; + virtual void onEmitSetupCode(GrGLSLVertexGeoBuilder*, const char* pts, const char* repetitionID, + GeometryVars*) const {} void onEmitVaryings(GrGLSLVaryingHandler*, GrGLSLVarying::Scope, SkString* code, - const char* position, const char* inputCoverage, const char* wind) override; + const char* position, const char* inputCoverage, const char* wind) final; + virtual void onEmitVaryings(GrGLSLVaryingHandler*, GrGLSLVarying::Scope, SkString* code) = 0; - void onEmitFragmentCode(const GrCCCoverageProcessor&, GrGLSLFPFragmentBuilder*, - const char* outputCoverage) const override; + void onEmitFragmentCode(GrGLSLFPFragmentBuilder*, const char* outputCoverage) const final; + virtual void emitCoverage(GrGLSLFPFragmentBuilder*, const char* outputCoverage) const = 0; GrShaderVar fKLMMatrix{"klm_matrix", kFloat3x3_GrSLType}; - GrGLSLVarying fKLMW; + GrShaderVar fEdgeDistanceEquation{"edge_distance_equation", kFloat3_GrSLType}; + GrGLSLVarying fKLMD; +}; + +class GrCCCubicHullShader : public GrCCCubicShader { + void onEmitVaryings(GrGLSLVaryingHandler*, GrGLSLVarying::Scope, SkString* code) override; + void emitCoverage(GrGLSLFPFragmentBuilder*, const char* outputCoverage) const override; + GrGLSLVarying fGradMatrix; }; +class GrCCCubicCornerShader : public GrCCCubicShader { + void onEmitSetupCode(GrGLSLVertexGeoBuilder*, const char* pts, const char* repetitionID, + GeometryVars*) const override; + void onEmitVaryings(GrGLSLVaryingHandler*, GrGLSLVarying::Scope, SkString* code) override; + void emitCoverage(GrGLSLFPFragmentBuilder*, const char* outputCoverage) const override; + + GrGLSLVarying fdKLMDdx; + GrGLSLVarying fdKLMDdy; +}; + #endif |