diff options
author | 2018-03-19 14:16:44 -0600 | |
---|---|---|
committer | 2018-03-20 20:46:17 +0000 | |
commit | 8d38a7f5215e584d2d3c94e77e213a89d1e4ff97 (patch) | |
tree | 6466e8335cd6c943289172b90819c8550e443bf2 /src | |
parent | f36b8a30c57266d02725bed7e807eeb78ef2e559 (diff) |
ccpr: Update the sample to use proper coverage count buffers
Bug: skia:
Change-Id: I6ce3ec567e671fa2ab3f05403015b48251518227
Reviewed-on: https://skia-review.googlesource.com/115072
Reviewed-by: Robert Phillips <robertphillips@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gpu/ccpr/GrCCCoverageProcessor.cpp | 6 | ||||
-rw-r--r-- | src/gpu/ccpr/GrCCCoverageProcessor.h | 9 | ||||
-rw-r--r-- | src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp | 2 | ||||
-rw-r--r-- | src/gpu/ccpr/GrCCCoverageProcessor_VSImpl.cpp | 2 |
4 files changed, 6 insertions, 13 deletions
diff --git a/src/gpu/ccpr/GrCCCoverageProcessor.cpp b/src/gpu/ccpr/GrCCCoverageProcessor.cpp index 1d570dca06..10b6736f33 100644 --- a/src/gpu/ccpr/GrCCCoverageProcessor.cpp +++ b/src/gpu/ccpr/GrCCCoverageProcessor.cpp @@ -23,12 +23,6 @@ void GrCCCoverageProcessor::Shader::emitFragmentCode(const GrCCCoverageProcessor this->onEmitFragmentCode(f, "coverage"); f->codeAppendf("%s.a = coverage;", skOutputColor); f->codeAppendf("%s = half4(1);", skOutputCoverage); -#ifdef SK_DEBUG - if (proc.debugVisualizationsEnabled()) { - f->codeAppendf("%s = half4(-%s.a, %s.a, 0, abs(%s.a));", - skOutputColor, skOutputColor, skOutputColor, skOutputColor); - } -#endif } void GrCCCoverageProcessor::Shader::EmitEdgeDistanceEquation(GrGLSLVertexGeoBuilder* s, diff --git a/src/gpu/ccpr/GrCCCoverageProcessor.h b/src/gpu/ccpr/GrCCCoverageProcessor.h index a60a38ee5e..d826b810c9 100644 --- a/src/gpu/ccpr/GrCCCoverageProcessor.h +++ b/src/gpu/ccpr/GrCCCoverageProcessor.h @@ -104,11 +104,10 @@ public: GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override; #ifdef SK_DEBUG - // Increases the 1/2 pixel AA bloat by a factor of debugBloat and outputs color instead of - // coverage (coverage=+1 -> green, coverage=0 -> black, coverage=-1 -> red). - void enableDebugVisualizations(float debugBloat) { fDebugBloat = debugBloat; } - bool debugVisualizationsEnabled() const { return fDebugBloat > 0; } - float debugBloat() const { SkASSERT(this->debugVisualizationsEnabled()); return fDebugBloat; } + // Increases the 1/2 pixel AA bloat by a factor of debugBloat. + void enableDebugBloat(float debugBloat) { fDebugBloat = debugBloat; } + bool debugBloatEnabled() const { return fDebugBloat > 0; } + float debugBloat() const { SkASSERT(this->debugBloatEnabled()); return fDebugBloat; } #endif // Appends a GrMesh that will draw the provided instances. The instanceBuffer must be an array diff --git a/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp b/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp index dd3d4890e1..82a292cb06 100644 --- a/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp +++ b/src/gpu/ccpr/GrCCCoverageProcessor_GSImpl.cpp @@ -95,7 +95,7 @@ protected: float bloat = kAABloatRadius; #ifdef SK_DEBUG - if (proc.debugVisualizationsEnabled()) { + if (proc.debugBloatEnabled()) { bloat *= proc.debugBloat(); } #endif diff --git a/src/gpu/ccpr/GrCCCoverageProcessor_VSImpl.cpp b/src/gpu/ccpr/GrCCCoverageProcessor_VSImpl.cpp index 9fbac5a64f..e0ec4d4142 100644 --- a/src/gpu/ccpr/GrCCCoverageProcessor_VSImpl.cpp +++ b/src/gpu/ccpr/GrCCCoverageProcessor_VSImpl.cpp @@ -62,7 +62,7 @@ protected: float bloat = kAABloatRadius; #ifdef SK_DEBUG - if (proc.debugVisualizationsEnabled()) { + if (proc.debugBloatEnabled()) { bloat *= proc.debugBloat(); } #endif |