aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/viewer/Viewer.cpp
diff options
context:
space:
mode:
authorGravatar Brian Osman <brianosman@google.com>2017-08-29 15:18:34 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-08-29 19:37:32 +0000
commit8b0f265f70703fa96c6d9011b1d8440e60d63632 (patch)
tree612770c26ade4c189b8a3143a8662c43d7c6a4b8 /tools/viewer/Viewer.cpp
parentef45e6eb5862b80769d2ef64630b8003d8ef6c62 (diff)
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>
Diffstat (limited to 'tools/viewer/Viewer.cpp')
-rw-r--r--tools/viewer/Viewer.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index dd8d3303f8..9bfdc4b60a 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -268,13 +268,14 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
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 @@ void Viewer::updateTitle() {
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 @@ void Viewer::drawImGui(SkCanvas* canvas) {
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 @@ void Viewer::drawImGui(SkCanvas* canvas) {
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 @@ void Viewer::updateUIState() {
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 @@ void Viewer::updateUIState() {
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]);