Revert "Disable coverage counting by default"

This reverts commit 576b2a5596.

Reason for revert: DDL and MSRTC unhappy

Original change's description:
> Disable coverage counting by default
> 
> Bug: skia:
> Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Chris Dalton <csmartdalton@google.com>

TBR=djsollen@google.com,bsalomon@google.com,csmartdalton@google.com

Change-Id: Iabdb3116d97c7470044b962ff78cffd47ccee744
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: skia:
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201933
Reviewed-by: Chris Dalton <csmartdalton@google.com>
Commit-Queue: Chris Dalton <csmartdalton@google.com>
This commit is contained in:
Chris Dalton 2019-03-18 15:59:39 +00:00 committed by Skia Commit-Bot
parent 2697dd626e
commit 9ff956e6de
9 changed files with 11 additions and 19 deletions

View File

@ -82,8 +82,7 @@ struct SK_API GrContextOptions {
* rendering artifacts along shared edges if care isn't taken to ensure both contours wind in
* the same direction.
*/
// FIXME: Once this is removed from Chrome and Android, rename to fEnable"".
bool fDisableCoverageCountingPaths = true;
bool fDisableCoverageCountingPaths = false;
/**
* Disables distance field rendering for paths. Distance field computation can be expensive,
@ -219,7 +218,7 @@ struct SK_API GrContextOptions {
/**
* Include or exclude specific GPU path renderers.
*/
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kDefault;
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kAll;
#endif
#if SK_SUPPORT_ATLAS_TEXT

View File

@ -833,9 +833,7 @@ enum class GpuPathRenderers {
kSmall = 1 << 6,
kTessellating = 1 << 7,
kAll = (kTessellating | (kTessellating - 1)),
kDefault = kAll & ~kCoverageCounting
kAll = (kTessellating | (kTessellating - 1))
};
/**

View File

@ -69,6 +69,7 @@ Java_org_skia_skottie_SkottieRunner_nCreateProxy(JNIEnv *env, jclass clazz) {
GrContextOptions options;
options.fDisableDistanceFieldPaths = true;
options.fDisableCoverageCountingPaths = true;
sk_sp<GrContext> grContext = GrContext::MakeGL(std::move(glInterface), options);
if (!grContext.get()) {
return 0;

View File

@ -28,7 +28,7 @@ class GrPathRendererChain : public SkNoncopyable {
public:
struct Options {
bool fAllowPathMaskCaching = false;
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kDefault;
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kAll;
};
GrPathRendererChain(GrRecordingContext* context, const Options&);

View File

@ -70,9 +70,8 @@ void GrRecordingContext::setupDrawingManager(bool explicitlyAllocate, bool sortO
#if GR_TEST_UTILS
prcOptions.fGpuPathRenderers = this->options().fGpuPathRenderers;
#endif
// FIXME: Once this is removed from Chrome and Android, rename to fEnable"".
if (!this->options().fDisableCoverageCountingPaths) {
prcOptions.fGpuPathRenderers |= GpuPathRenderers::kCoverageCounting;
if (this->options().fDisableCoverageCountingPaths) {
prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kCoverageCounting;
}
if (this->options().fDisableDistanceFieldPaths) {
prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;

View File

@ -155,7 +155,6 @@ public:
mockOptions.fFlatInterpolationSupport = true;
GrContextOptions ctxOptions;
ctxOptions.fDisableCoverageCountingPaths = false;
ctxOptions.fAllowPathMaskCaching = false;
ctxOptions.fGpuPathRenderers = GpuPathRenderers::kCoverageCounting;

View File

@ -161,7 +161,7 @@ DEFINE_bool(cachePathMasks, true, "Allows path mask textures to be cached in GPU
DEFINE_bool(noGS, false, "Disables support for geometry shaders.");
DEFINE_string(pr, "",
DEFINE_string(pr, "all",
"Set of enabled gpu path renderers. Defined as a list of: "
"[~]none [~]dashline [~]nvpr [~]ccpr [~]aahairline [~]aaconvex [~]aalinearizing "
"[~]small [~]tess] [~]all");

View File

@ -46,9 +46,9 @@ inline GpuPathRenderers get_named_pathrenderers_flags(const char* name) {
inline GpuPathRenderers CollectGpuPathRenderersFromFlags() {
if (FLAGS_pr.isEmpty()) {
return GpuPathRenderers::kDefault;
return GpuPathRenderers::kAll;
}
GpuPathRenderers gpuPathRenderers = ('~' == FLAGS_pr[0][0])
GpuPathRenderers gpuPathRenderers = '~' == FLAGS_pr[0][0]
? GpuPathRenderers::kAll : GpuPathRenderers::kNone;
for (int i = 0; i < FLAGS_pr.count(); ++i) {
const char* name = FLAGS_pr[i];

View File

@ -219,7 +219,6 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
{
SkGraphics::Init();
gPathRendererNames[GpuPathRenderers::kDefault] = "Default Path Renderers";
gPathRendererNames[GpuPathRenderers::kAll] = "All Path Renderers";
gPathRendererNames[GpuPathRenderers::kStencilAndCover] = "NV_path_rendering";
gPathRendererNames[GpuPathRenderers::kSmall] = "Small paths (cached sdf or alpha masks)";
@ -876,7 +875,7 @@ void Viewer::updateTitle() {
title.append("]");
GpuPathRenderers pr = fWindow->getRequestedDisplayParams().fGrContextOptions.fGpuPathRenderers;
if (GpuPathRenderers::kDefault != pr) {
if (GpuPathRenderers::kAll != pr) {
title.appendf(" [Path renderer: %s]", gPathRendererNames[pr].c_str());
}
@ -1564,7 +1563,6 @@ void Viewer::drawImGui() {
if (!ctx) {
ImGui::RadioButton("Software", true);
} else if (fWindow->sampleCount() > 1) {
prButton(GpuPathRenderers::kDefault);
prButton(GpuPathRenderers::kAll);
if (ctx->priv().caps()->shaderCaps()->pathRenderingSupport()) {
prButton(GpuPathRenderers::kStencilAndCover);
@ -1572,7 +1570,6 @@ void Viewer::drawImGui() {
prButton(GpuPathRenderers::kTessellating);
prButton(GpuPathRenderers::kNone);
} else {
prButton(GpuPathRenderers::kDefault);
prButton(GpuPathRenderers::kAll);
if (GrCoverageCountingPathRenderer::IsSupported(
*ctx->priv().caps())) {
@ -2077,7 +2074,6 @@ void Viewer::updateUIState() {
} else {
const auto* caps = ctx->priv().caps();
writer.appendString(gPathRendererNames[GpuPathRenderers::kDefault].c_str());
writer.appendString(gPathRendererNames[GpuPathRenderers::kAll].c_str());
if (fWindow->sampleCount() > 1) {
if (caps->shaderCaps()->pathRenderingSupport()) {