aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-07-14 15:17:41 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-07-14 21:45:35 +0000
commit1a325d25b941ef801b3e9b2c0342da43cf35cdba (patch)
tree3f65d36541399e1ae6a529a534119815a2c5ba36 /tools
parent588fb040b3ad410cdb10c87f9a7884b6eb825e90 (diff)
Coverage counting path renderer
Initial implementation of a GPU path renderer that draws antialiased paths by counting coverage in an offscreen buffer. Initially disabled until it has had time to soak. Bug: skia: Change-Id: I003d8cfdf8dc62641581b5ea2dc4f0aa00108df6 Reviewed-on: https://skia-review.googlesource.com/21541 Commit-Queue: Chris Dalton <csmartdalton@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Salomon <bsalomon@google.com> Reviewed-by: Robert Phillips <robertphillips@google.com>
Diffstat (limited to 'tools')
-rw-r--r--tools/flags/SkCommonFlagsPathRenderer.h2
-rw-r--r--tools/viewer/Viewer.cpp9
2 files changed, 11 insertions, 0 deletions
diff --git a/tools/flags/SkCommonFlagsPathRenderer.h b/tools/flags/SkCommonFlagsPathRenderer.h
index 12755dcc06..ac293a1e79 100644
--- a/tools/flags/SkCommonFlagsPathRenderer.h
+++ b/tools/flags/SkCommonFlagsPathRenderer.h
@@ -40,6 +40,8 @@ inline GrContextOptions::GpuPathRenderers get_named_pathrenderers_flags(const ch
return GpuPathRenderers::kAALinearizing;
} else if (!strcmp(name, "small")) {
return GpuPathRenderers::kSmall;
+ } else if (!strcmp(name, "ccpr")) {
+ return GpuPathRenderers::kCoverageCounting;
} else if (!strcmp(name, "tess")) {
return GpuPathRenderers::kTessellating;
} else if (!strcmp(name, "grdefault")) {
diff --git a/tools/viewer/Viewer.cpp b/tools/viewer/Viewer.cpp
index 29e5b70cb8..6753b6b63e 100644
--- a/tools/viewer/Viewer.cpp
+++ b/tools/viewer/Viewer.cpp
@@ -37,6 +37,8 @@
#include "imgui.h"
+#include "ccpr/GrCoverageCountingPathRenderer.h"
+
#include <stdlib.h>
#include <map>
@@ -262,6 +264,7 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
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";
@@ -1069,6 +1072,9 @@ void Viewer::drawImGui(SkCanvas* canvas) {
prButton(GpuPathRenderers::kNone);
} else {
prButton(GpuPathRenderers::kAll);
+ if (GrCoverageCountingPathRenderer::IsSupported(*ctx->caps())) {
+ prButton(GpuPathRenderers::kCoverageCounting);
+ }
prButton(GpuPathRenderers::kSmall);
prButton(GpuPathRenderers::kTessellating);
prButton(GpuPathRenderers::kNone);
@@ -1305,6 +1311,9 @@ void Viewer::updateUIState() {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kNone]);
} else {
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kAll]);
+ if (GrCoverageCountingPathRenderer::IsSupported(*ctx->caps())) {
+ prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kCoverageCounting]);
+ }
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kSmall]);
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kTessellating]);
prState[kOptions].append(gPathRendererNames[GpuPathRenderers::kNone]);