Closed Bug 949661 Opened 6 years ago Closed 5 years ago

PathBuilderCG::Arc bug causes rotation transforms applied to circle with stroke-dasharray to be treated as zero degrees at multiples of 90 degrees

Categories

(Core :: SVG, defect)

x86_64
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla36

People

(Reporter: jwatt, Assigned: jwatt)

References

Details

(Keywords: regression)

Attachments

(5 files)

Attached image rotate.svg
Works in Firefox 25. Broken in Nightly.

In the testcase the second circle should have a notch at the 6 o'clock position, not the 3 o'clock position.
WORKSFORME on yesterday's Linux Nightly (i.e. the second circle has a notch at the 6 o'clock position).

Mac-only?
WFM in Linux but can reproduce on Mac with the same build (2014-01-22). So it appears to be OS-specific? I'll find a regression window shortly.
Last good revision: ce0759a746fb
First bad revision: 39f4bb8c55d8
Pushlog:
http://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=ce0759a746fb&tochange=39f4bb8c55d8

Jonathan, looks like this is from your own push.
Flags: needinfo?(jwatt)
Unbelievably, this was caused by bug 929441 - in other words multiplying the identity matrix onto the gfxContext makes a difference!

The change was this:

   // Apply any stroke-specific transform
-  aContext->Multiply(GetStrokeTransform(aFrame));
+  gfxMatrix strokeTransform = GetStrokeTransform(aFrame);
+  if (!strokeTransform.IsIdentity()) {
+    aContext->Multiply(strokeTransform);
+  }
Blocks: 929441
Flags: needinfo?(jwatt)
Duplicate of this bug: 1085472
All the old Thebes code is gone from these SVG code paths in Nightly so the snippet in comment 4 isn't so helpful any more. Here's a patch that proves that on Mac calling TransformedCopyToBuilder with the identity transform and using that (in principal identical) Path gets things working.

Jeff, any idea what's rotten in the CG Moz2D backend here?
Flags: needinfo?(jmuizelaar)
So it seems that HTML canvas manages to avoid this bug because it uses the ArcToBezier Moz2D helper instead of PathSink::Arc. This patch changes HTML canvas to use PathSink::Arc after which the attached canvas test fails.
Summary: Rotation transforms applied to circle with stroke-dasharray treated as zero degrees at multiples of 90 degrees → PathBuilderCG::Arc bug causes rotation transforms applied to circle with stroke-dasharray to be treated as zero degrees at multiples of 90 degrees
WebKit seems to use CGPathAddArc and works on this test case. For now it might be best to just use the helper.
Flags: needinfo?(jmuizelaar)
Or even better replace the implementation of PathCG::Arc with a working implemenation that uses the helper.
Attached patch patchSplinter Review
Assignee: nobody → jwatt
Attachment #8512304 - Flags: review?(jmuizelaar)
Attachment #8512304 - Flags: review?(jmuizelaar) → review+
Failures in layout/base/tests/test_getBoxQuads_convertPointRectQuad.html caused by rounding errors due to this change meant that it was necessary to fix bug 1090211 in order to land this.
Depends on: 1090211
https://hg.mozilla.org/mozilla-central/rev/1240f21309cd
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla36
QA Whiteboard: [good first verify]
See Also: → 1202453
You need to log in before you can comment on or make changes to this bug.