From 8b0f265f70703fa96c6d9011b1d8440e60d63632 Mon Sep 17 00:00:00 2001 From: Brian Osman Date: Tue, 29 Aug 2017 15:18:34 -0400 Subject: 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 Reviewed-by: Brian Salomon Commit-Queue: Brian Osman --- tools/viewer/Viewer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'tools/viewer/Viewer.cpp') 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]); -- cgit v1.2.3