aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--gm/circle_sizes.cpp16
-rw-r--r--gn/gm.gni1
-rw-r--r--src/pdf/SkPDFDevice.cpp3
3 files changed, 19 insertions, 1 deletions
diff --git a/gm/circle_sizes.cpp b/gm/circle_sizes.cpp
new file mode 100644
index 0000000000..8ed95dd0ed
--- /dev/null
+++ b/gm/circle_sizes.cpp
@@ -0,0 +1,16 @@
+/*
+ * Copyright 2017 Google Inc.
+ *
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+#include "gm.h"
+// https://crbug.com/772953
+DEF_SIMPLE_GM(circle_sizes, canvas, 128, 128) {
+ SkPaint p;
+ p.setAntiAlias(true);
+ for (int i = 0; i < 16; ++i) {
+ canvas->drawCircle({14.0f + 32.0f * (i % 4),
+ 14.0f + 32.0f * (i / 4)}, i + 1.0f, p);
+ }
+}
diff --git a/gn/gm.gni b/gn/gm.gni
index 22d562f187..ad542fb976 100644
--- a/gn/gm.gni
+++ b/gn/gm.gni
@@ -60,6 +60,7 @@ gm_sources = [
"$_gm/bug615686.cpp",
"$_gm/cgm.c",
"$_gm/cgms.cpp",
+ "$_gm/circle_sizes.cpp",
"$_gm/circles.cpp",
"$_gm/circulararcs.cpp",
"$_gm/circularclips.cpp",
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 61205ba36d..10ec6911a2 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -952,8 +952,9 @@ void SkPDFDevice::internalDrawPath(const SkClipStack& clipStack,
if (!content.entry()) {
return;
}
+ constexpr SkScalar kToleranceScale = 0.0625f; // smaller = better conics (circles).
SkScalar matrixScale = matrix.mapRadius(1.0f);
- SkScalar tolerance = matrixScale > 0.0f ? 0.25f / matrixScale : 0.25f;
+ SkScalar tolerance = matrixScale > 0.0f ? kToleranceScale / matrixScale : kToleranceScale;
bool consumeDegeratePathSegments =
paint.getStyle() == SkPaint::kFill_Style ||
(paint.getStrokeCap() != SkPaint::kRound_Cap &&