Skip to content

Commit 576b2a5

Browse files
csmartdalton86Skia Commit-Bot
authored andcommitted
Disable coverage counting by default
Bug: skia: Change-Id: Iacb4cb3e409c6abdd25319ec0884ef673fb04cec Reviewed-on: https://skia-review.googlesource.com/c/skia/+/201101 Reviewed-by: Brian Salomon <[email protected]> Commit-Queue: Chris Dalton <[email protected]>
1 parent 895e1ee commit 576b2a5

File tree

9 files changed

+19
-11
lines changed

9 files changed

+19
-11
lines changed

include/gpu/GrContextOptions.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ struct SK_API GrContextOptions {
8282
* rendering artifacts along shared edges if care isn't taken to ensure both contours wind in
8383
* the same direction.
8484
*/
85-
bool fDisableCoverageCountingPaths = false;
85+
// FIXME: Once this is removed from Chrome and Android, rename to fEnable"".
86+
bool fDisableCoverageCountingPaths = true;
8687

8788
/**
8889
* Disables distance field rendering for paths. Distance field computation can be expensive,
@@ -218,7 +219,7 @@ struct SK_API GrContextOptions {
218219
/**
219220
* Include or exclude specific GPU path renderers.
220221
*/
221-
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kAll;
222+
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kDefault;
222223
#endif
223224

224225
#if SK_SUPPORT_ATLAS_TEXT

include/private/GrTypesPriv.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -833,7 +833,9 @@ enum class GpuPathRenderers {
833833
kSmall = 1 << 6,
834834
kTessellating = 1 << 7,
835835

836-
kAll = (kTessellating | (kTessellating - 1))
836+
kAll = (kTessellating | (kTessellating - 1)),
837+
kDefault = kAll & ~kCoverageCounting
838+
837839
};
838840

839841
/**

platform_tools/android/apps/skottie/src/main/cpp/native-lib.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ Java_org_skia_skottie_SkottieRunner_nCreateProxy(JNIEnv *env, jclass clazz) {
6969

7070
GrContextOptions options;
7171
options.fDisableDistanceFieldPaths = true;
72-
options.fDisableCoverageCountingPaths = true;
7372
sk_sp<GrContext> grContext = GrContext::MakeGL(std::move(glInterface), options);
7473
if (!grContext.get()) {
7574
return 0;

src/gpu/GrPathRendererChain.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class GrPathRendererChain : public SkNoncopyable {
2828
public:
2929
struct Options {
3030
bool fAllowPathMaskCaching = false;
31-
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kAll;
31+
GpuPathRenderers fGpuPathRenderers = GpuPathRenderers::kDefault;
3232
};
3333
GrPathRendererChain(GrRecordingContext* context, const Options&);
3434

src/gpu/GrRecordingContext.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,9 @@ void GrRecordingContext::setupDrawingManager(bool explicitlyAllocate, bool sortO
7070
#if GR_TEST_UTILS
7171
prcOptions.fGpuPathRenderers = this->options().fGpuPathRenderers;
7272
#endif
73-
if (this->options().fDisableCoverageCountingPaths) {
74-
prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kCoverageCounting;
73+
// FIXME: Once this is removed from Chrome and Android, rename to fEnable"".
74+
if (!this->options().fDisableCoverageCountingPaths) {
75+
prcOptions.fGpuPathRenderers |= GpuPathRenderers::kCoverageCounting;
7576
}
7677
if (this->options().fDisableDistanceFieldPaths) {
7778
prcOptions.fGpuPathRenderers &= ~GpuPathRenderers::kSmall;

tests/GrCCPRTest.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ class CCPRTest {
155155
mockOptions.fFlatInterpolationSupport = true;
156156

157157
GrContextOptions ctxOptions;
158+
ctxOptions.fDisableCoverageCountingPaths = false;
158159
ctxOptions.fAllowPathMaskCaching = false;
159160
ctxOptions.fGpuPathRenderers = GpuPathRenderers::kCoverageCounting;
160161

tools/flags/SkCommonFlags.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ DEFINE_bool(cachePathMasks, true, "Allows path mask textures to be cached in GPU
161161

162162
DEFINE_bool(noGS, false, "Disables support for geometry shaders.");
163163

164-
DEFINE_string(pr, "all",
164+
DEFINE_string(pr, "",
165165
"Set of enabled gpu path renderers. Defined as a list of: "
166166
"[~]none [~]dashline [~]nvpr [~]ccpr [~]aahairline [~]aaconvex [~]aalinearizing "
167167
"[~]small [~]tess] [~]all");

tools/flags/SkCommonFlagsGpu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ inline GpuPathRenderers get_named_pathrenderers_flags(const char* name) {
4646

4747
inline GpuPathRenderers CollectGpuPathRenderersFromFlags() {
4848
if (FLAGS_pr.isEmpty()) {
49-
return GpuPathRenderers::kAll;
49+
return GpuPathRenderers::kDefault;
5050
}
51-
GpuPathRenderers gpuPathRenderers = '~' == FLAGS_pr[0][0]
51+
GpuPathRenderers gpuPathRenderers = ('~' == FLAGS_pr[0][0])
5252
? GpuPathRenderers::kAll : GpuPathRenderers::kNone;
5353
for (int i = 0; i < FLAGS_pr.count(); ++i) {
5454
const char* name = FLAGS_pr[i];

tools/viewer/Viewer.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,7 @@ Viewer::Viewer(int argc, char** argv, void* platformData)
219219
{
220220
SkGraphics::Init();
221221

222+
gPathRendererNames[GpuPathRenderers::kDefault] = "Default Path Renderers";
222223
gPathRendererNames[GpuPathRenderers::kAll] = "All Path Renderers";
223224
gPathRendererNames[GpuPathRenderers::kStencilAndCover] = "NV_path_rendering";
224225
gPathRendererNames[GpuPathRenderers::kSmall] = "Small paths (cached sdf or alpha masks)";
@@ -875,7 +876,7 @@ void Viewer::updateTitle() {
875876
title.append("]");
876877

877878
GpuPathRenderers pr = fWindow->getRequestedDisplayParams().fGrContextOptions.fGpuPathRenderers;
878-
if (GpuPathRenderers::kAll != pr) {
879+
if (GpuPathRenderers::kDefault != pr) {
879880
title.appendf(" [Path renderer: %s]", gPathRendererNames[pr].c_str());
880881
}
881882

@@ -1563,13 +1564,15 @@ void Viewer::drawImGui() {
15631564
if (!ctx) {
15641565
ImGui::RadioButton("Software", true);
15651566
} else if (fWindow->sampleCount() > 1) {
1567+
prButton(GpuPathRenderers::kDefault);
15661568
prButton(GpuPathRenderers::kAll);
15671569
if (ctx->priv().caps()->shaderCaps()->pathRenderingSupport()) {
15681570
prButton(GpuPathRenderers::kStencilAndCover);
15691571
}
15701572
prButton(GpuPathRenderers::kTessellating);
15711573
prButton(GpuPathRenderers::kNone);
15721574
} else {
1575+
prButton(GpuPathRenderers::kDefault);
15731576
prButton(GpuPathRenderers::kAll);
15741577
if (GrCoverageCountingPathRenderer::IsSupported(
15751578
*ctx->priv().caps())) {
@@ -2074,6 +2077,7 @@ void Viewer::updateUIState() {
20742077
} else {
20752078
const auto* caps = ctx->priv().caps();
20762079

2080+
writer.appendString(gPathRendererNames[GpuPathRenderers::kDefault].c_str());
20772081
writer.appendString(gPathRendererNames[GpuPathRenderers::kAll].c_str());
20782082
if (fWindow->sampleCount() > 1) {
20792083
if (caps->shaderCaps()->pathRenderingSupport()) {

0 commit comments

Comments
 (0)