Closed Bug 1199417 Opened 9 years ago Closed 9 years ago

PathSkia::ContainsPoint fails for paths with small coordinates

Categories

(Core :: Graphics, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla43
Tracking Status
firefox43 --- fixed

People

(Reporter: lsalzman, Assigned: lsalzman)

References

Details

Attachments

(1 file, 1 obsolete file)

The main symptoms are the following mochitest failures:

616 INFO TEST-UNEXPECTED-FAIL | dom/svg/test/test_pointer-events-3.xhtml | Top of circle should hit - got [object SVGSVGElement], expected [object SVGCircleElement]
619 INFO TEST-UNEXPECTED-FAIL | dom/svg/test/test_pointer-events-3.xhtml | Left of circle should hit - got [object SVGSVGElement], expected [object SVGCircleElement] 

This is because the SVG circle is created in a very small coordinate system. With (1.5, 1.5) as the center and a radius of 1.

Since the path gets truncated to integer coordinates when it is converted to a region, the path doesn't survive the conversion to a region.
This employs a similar solution to what Blink and Webkit are currently doing: scale the path up as far as we can within the coordinate precision Skia can support.

I also investigated whether the SkPath::contains() method still had the same problems outlined in bug 831529, and it is so. For now, we're stuck with the current regionizing workaround we have.
Attachment #8653677 - Flags: review?(matt.woodrow)
Attachment #8653677 - Flags: review?(matt.woodrow) → review+
Updated comment to note issue with bug 831259 and why we're still using this particular workaround.
Attachment #8653677 - Attachment is obsolete: true
Attachment #8653720 - Flags: review+
Blocks: skia-reftest
https://hg.mozilla.org/mozilla-central/rev/4931013ed9e9
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla43
See Also: → 1254243
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: