aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/ccpr
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/ccpr')
-rw-r--r--src/gpu/ccpr/GrCCPRCoverageProcessor.cpp6
-rw-r--r--src/gpu/ccpr/GrCCPRCoverageProcessor.h16
2 files changed, 11 insertions, 11 deletions
diff --git a/src/gpu/ccpr/GrCCPRCoverageProcessor.cpp b/src/gpu/ccpr/GrCCPRCoverageProcessor.cpp
index 69605095f6..079f240231 100644
--- a/src/gpu/ccpr/GrCCPRCoverageProcessor.cpp
+++ b/src/gpu/ccpr/GrCCPRCoverageProcessor.cpp
@@ -159,8 +159,8 @@ void PrimitiveProcessor::emitGeometryShader(const GrCCPRCoverageProcessor& proc,
g->codeAppendf("highp float2 bloat = %f * abs(%s.xz);", kAABloatRadius, rtAdjust);
#ifdef SK_DEBUG
- if (proc.debugVisualizations()) {
- g->codeAppendf("bloat *= %f;", GrCCPRCoverageProcessor::kDebugBloat);
+ if (proc.debugVisualizationsEnabled()) {
+ g->codeAppendf("bloat *= %f;", proc.debugBloat());
}
#endif
@@ -324,7 +324,7 @@ void PrimitiveProcessor::emitCoverage(const GrCCPRCoverageProcessor& proc, GrGLS
f->codeAppendf("%s = float4(1);", outputCoverage);
#ifdef SK_DEBUG
- if (proc.debugVisualizations()) {
+ if (proc.debugVisualizationsEnabled()) {
f->codeAppendf("%s = float4(-%s.a, %s.a, 0, 1);", outputColor, outputColor, outputColor);
}
#endif
diff --git a/src/gpu/ccpr/GrCCPRCoverageProcessor.h b/src/gpu/ccpr/GrCCPRCoverageProcessor.h
index 2835cc5a5f..b8032d9ec2 100644
--- a/src/gpu/ccpr/GrCCPRCoverageProcessor.h
+++ b/src/gpu/ccpr/GrCCPRCoverageProcessor.h
@@ -92,12 +92,12 @@ public:
void getGLSLProcessorKey(const GrShaderCaps&, GrProcessorKeyBuilder*) const override;
GrGLSLPrimitiveProcessor* createGLSLInstance(const GrShaderCaps&) const override;
- static constexpr float kDebugBloat = 50;
#ifdef SK_DEBUG
- // Increases the 1/2 pixel AA bloat by a factor of kDebugBloat and outputs color instead of
+ // 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() { fDebugVisualizations = true; }
- bool debugVisualizations() const { return fDebugVisualizations; }
+ void enableDebugVisualizations(float debugBloat) { fDebugBloat = debugBloat; }
+ bool debugVisualizationsEnabled() const { return fDebugBloat > 0; }
+ float debugBloat() const { SkASSERT(this->debugVisualizationsEnabled()); return fDebugBloat; }
static void Validate(GrRenderTargetProxy* atlasProxy);
#endif
@@ -105,10 +105,10 @@ public:
class PrimitiveProcessor;
private:
- const Mode fMode;
- const Attribute& fInstanceAttrib;
- BufferAccess fPointsBufferAccess;
- SkDEBUGCODE(bool fDebugVisualizations = false;)
+ const Mode fMode;
+ const Attribute& fInstanceAttrib;
+ BufferAccess fPointsBufferAccess;
+ SkDEBUGCODE(float fDebugBloat = false;)
typedef GrGeometryProcessor INHERITED;
};