Always include the default path renderer in the chain
This (plus SW) ensures that we can always draw any path. Changed the path
renderer command line flags so that 'default' means everything but CCPR,
and 'All' really means 'every path renderer'.
Bug: skia:
Change-Id: I2801d1c50ab939f23efb4600e0f90e6add2891b7
Reviewed-on: https://skia-review.googlesource.com/40221
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Brian Osman <brianosman@google.com>
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index dd8d330..9bfdc4b 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -268,13 +268,14 @@
static SkOnce initPathRendererNames;
initPathRendererNames([]() {
- gPathRendererNames[GpuPathRenderers::kAll] = "Default Ganesh Behavior (best path renderer)";
+ gPathRendererNames[GpuPathRenderers::kAll] = "All Path Renderers";
+ gPathRendererNames[GpuPathRenderers::kDefault] =
+ "Default Ganesh Behavior (best path renderer, not including CCPR)";
gPathRendererNames[GpuPathRenderers::kStencilAndCover] = "NV_path_rendering";
gPathRendererNames[GpuPathRenderers::kMSAA] = "Sample shading";
gPathRendererNames[GpuPathRenderers::kSmall] = "Small paths (cached sdf or alpha masks)";
gPathRendererNames[GpuPathRenderers::kCoverageCounting] = "Coverage counting";
gPathRendererNames[GpuPathRenderers::kTessellating] = "Tessellating";
- gPathRendererNames[GpuPathRenderers::kDefault] = "Original Ganesh path renderer";
gPathRendererNames[GpuPathRenderers::kNone] = "Software masks";
});
@@ -613,7 +614,7 @@
title.append("]");
GpuPathRenderers pr = fWindow->getRequestedDisplayParams().fGrContextOptions.fGpuPathRenderers;
- if (GpuPathRenderers::kAll != pr) {
+ if (GpuPathRenderers::kDefault != pr) {
title.appendf(" [Path renderer: %s]", gPathRendererNames[pr].c_str());
}
@@ -1103,6 +1104,7 @@
if (!ctx) {
ImGui::RadioButton("Software", true);
} else if (fWindow->sampleCount()) {
+ prButton(GpuPathRenderers::kDefault);
prButton(GpuPathRenderers::kAll);
if (ctx->caps()->shaderCaps()->pathRenderingSupport()) {
prButton(GpuPathRenderers::kStencilAndCover);
@@ -1111,9 +1113,9 @@
prButton(GpuPathRenderers::kMSAA);
}
prButton(GpuPathRenderers::kTessellating);
- prButton(GpuPathRenderers::kDefault);
prButton(GpuPathRenderers::kNone);
} else {
+ prButton(GpuPathRenderers::kDefault);
prButton(GpuPathRenderers::kAll);
if (GrCoverageCountingPathRenderer::IsSupported(*ctx->caps())) {
prButton(GpuPathRenderers::kCoverageCounting);
@@ -1342,6 +1344,7 @@
if (!ctx) {
prState[kOptions].append("Software");
} else if (fWindow->sampleCount()) {
+ prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kDefault]);
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kAll]);
if (ctx->caps()->shaderCaps()->pathRenderingSupport()) {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kStencilAndCover]);
@@ -1350,9 +1353,9 @@
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kMSAA]);
}
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kTessellating]);
- prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kDefault]);
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kNone]);
} else {
+ prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kDefault]);
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kAll]);
if (GrCoverageCountingPathRenderer::IsSupported(*ctx->caps())) {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kCoverageCounting]);