SVG arcs have wrong curvature when printed
Reported by
jedwar...@gmail.com,
Feb 12 2017
|
||||
Issue descriptionUserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Steps to reproduce the problem: 1. Go to https://jedwards1211.github.io/react-therion-protractor/#/ 2. Click the print button at the top right of the page 3. Compare print preview to what's shown in the body of the page What is the expected behavior? arcs in print preview are perfectly circular and match what's shown in the browser window What went wrong? Arcs bulge outward from the expected curvature, and don't look circular. Maybe its a bezier conversion problem? Did this work before? N/A Does this work in other browsers? Yes Chrome version: 56.0.2924.87 Channel: stable OS Version: OS X 10.12.3 Flash Version: Can't repro in FF or Safari, though they have other SVG issues rendering this page
,
Feb 12 2017
Maybe it's an issue with "reversing" a conic section? The relevant path appears to be: "M -2 0 A 2 2 0 0 0 2 0 Z" which I guess will map to 2(?) conics or so? IIUC that then round-trips through PDF.
,
Feb 12 2017
On Chrome on Android, if I include
<meta name="viewport" content="initial-scale=1">
Then the issue shows in the browser itself when I zoom out and goes away when I zoom to about 200%!
,
Feb 13 2017
Sounds like two different bugs. The original bug where the print preview draws incorrectly may be an error in the Skia to PDF translation. The bug mentioned in #3 may be related to in incorrect device resolution when the stroke is turned into the fill path.
,
Feb 13 2017
The thing that makes me think they're related though is that the arc gets distorted in exactly the same way when it happens on Android Chrome.
,
Feb 13 2017
Yes, there is common code at the bottom but that code is reached through two different paths.
,
Feb 13 2017
See https://skia.googlesource.com/skia/+/chrome/m56/src/pdf/SkPDFUtils.cpp#172 The tolerance in converting conics (such as elipticals) to quadratic paths that PDF recognizes is hardcoded to be 0.25. A path which is zoomed in a lot such as this: "M -2 0 A 2 2 0 0 0 2 0 Z" Will have a tolerance of 12.5%! (2.0 * 0.25). This is a limitation of SkPDF that could go away if we checked the current matrix before converting to quadratics.
,
Feb 13 2017
I meant to say `0.125 == 0.25 / 2.0`, not `0.125 == 0.25 * 2.0`!
,
Feb 13 2017
Minimal test case:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>chromium_691386</title>
</head>
<body>
<svg viewBox="-2 -2 4 4" width="512" height="512">
<path d="M -1 0 A 1 1 0 0 0 1 0 Z" stroke="black" stroke-width="0.025px" fill="none">
</svg>
</body>
</html>
,
Feb 13 2017
The following revision refers to this bug: https://skia.googlesource.com/skia/+/385468f6e277bdfd7d1a57467413c31658175690 commit 385468f6e277bdfd7d1a57467413c31658175690 Author: Hal Canary <halcanary@google.com> Date: Mon Feb 13 18:24:11 2017 SkPDF: better tolerance path conversion to quadratics BUG= chromium:691386 Change-Id: I2cb9be7dd606b2ba61ff609f9fd81a55655901f6 Reviewed-on: https://skia-review.googlesource.com/8381 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Ben Wagner <bungeman@google.com> Reviewed-by: Cary Clark <caryclark@google.com> [modify] https://crrev.com/385468f6e277bdfd7d1a57467413c31658175690/src/pdf/SkPDFDevice.cpp [modify] https://crrev.com/385468f6e277bdfd7d1a57467413c31658175690/gn/gm.gni [add] https://crrev.com/385468f6e277bdfd7d1a57467413c31658175690/gm/crbug_691386.cpp [modify] https://crrev.com/385468f6e277bdfd7d1a57467413c31658175690/src/pdf/SkPDFUtils.cpp [modify] https://crrev.com/385468f6e277bdfd7d1a57467413c31658175690/src/pdf/SkPDFUtils.h
,
Feb 13 2017
Wow, thanks a bunch for the quick fix for this Hal!
,
Feb 13 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/e1d7115274ee66ed6875376c4eb24131bb6a8bab commit e1d7115274ee66ed6875376c4eb24131bb6a8bab Author: skia-deps-roller <skia-deps-roller@chromium.org> Date: Mon Feb 13 22:00:04 2017 Roll src/third_party/skia/ a12c15376..d2d6d726f (8 commits). https://skia.googlesource.com/skia.git/+log/a12c15376ce3..d2d6d726fa3e $ git log a12c15376..d2d6d726f --date=short --no-merges --format='%ad %ae %s' 2017-02-13 mtklein Fix stack alignment in Windows before_loop/after_loop. 2017-02-13 halcanary tools/git-sync-deps: less verbose when fetch is needed 2017-02-13 csmartdalton Make SkAutoTMalloc movable 2017-02-13 jcgregorio fiddle: Fix JSON output logic. 2017-02-12 halcanary SkPDF: skip shader lookup for SkShader::kColor_GradientType 2017-02-13 herb Move GrTessellator from SkChunckAlloc to SkArenaAlloc. 2017-02-13 halcanary SkPDF: better tolerance path conversion to quadratics 2017-02-09 ztenghui A simple gradient test Created with: roll-dep src/third_party/skia BUG= 690875 , 691386 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, see: http://www.chromium.org/developers/tree-sheriffs/sheriff-details-chromium#TOC-Failures-due-to-DEPS-rolls CQ_INCLUDE_TRYBOTS=master.tryserver.blink:linux_trusty_blink_rel TBR=bungeman@google.com Review-Url: https://codereview.chromium.org/2695823002 Cr-Commit-Position: refs/heads/master@{#450107} [modify] https://crrev.com/e1d7115274ee66ed6875376c4eb24131bb6a8bab/DEPS
,
Apr 10 2017
I believe this is fixed in m58. Please verify. |
||||
►
Sign in to add a comment |
||||
Comment 1 by jedwar...@gmail.com
, Feb 12 201777.3 KB
77.3 KB View Download
61.4 KB
61.4 KB View Download
101 KB
101 KB View Download