Open Bug 407107 Opened 17 years ago Updated 2 years ago

Canvas tests passing on Mac but failing on Windows/Linux

Categories

(Core :: Graphics, defect, P3)

x86
Linux
defect

Tracking

()

People

(Reporter: bzbarsky, Unassigned)

References

Details

The following tests pass on Mac but not Windows/Linux:

  content/canvas/test/test_2d.path.rect.selfintersect.html
  content/canvas/test/test_2d.path.rect.zero.6.html

Not sure whether they should pass or fail, but the platform difference in behavior seems to be a cairo bug or set of bugs.  We should probably push this upstream, but I'm not sure how to create a simple-ish cairo testcase here.
Flags: blocking1.9?
Flags: blocking1.9? → blocking1.9+
Priority: -- → P2
Flags: tracking1.9+ → blocking1.9-
Flags: wanted-next+
test_2d.path.rect.zero.6 does:

ctx.lineWidth = 200;
ctx.beginPath();
ctx.rect(100, 25, 1000, 0);
ctx.stroke();

and expects this to not draw anything.  In cairo land, a rect is a set of movetos and linetos always, so this is essentially drawing two overlapping horizontal lines and two 0-sized lines for the vertical sides.. thus the stroke() has an effect.  The spec says:

> The rect(x, y, w, h) method must create a new subpath containing just the four points (x, y), (x+w, y), (x+w, y+h), (x, y+h), with those four points connected by straight lines, and must then mark the subpath as closed. It must then create a new subpath with the point (x, y) as the only point in the subpath. 

So, this test is invalid.


rect.selfintersect looks like a valid cairo bug.
> So, this test is invalid.

Like I said, I'm not sure whether passing or failing is the right thing, but doing it differently on Mac and Windows/Linux is wrong, right?  If the test is invalid that means passing is wrong, so the Mac behavior her is wrong?
rect.zero.6 draws a rectangle from (100,25) to (1100,25) and expects it to not draw anything in the visible region (0,0)-(100,50). It should only draw any pixels with x >= 100.

If the height was *not* zero, then the vertical lines of the rectangle and the miters in the corners would get drawn with x < 100 (given the miter limit and line width). But since the height is zero, and "Zero-length line segments must be pruned before stroking a path", there are no vertical lines; the rect() is roughly equivalent to

  moveTo(100, 25);
  lineTo(1100, 25);
  closePath();

so there's no vertical line and the line join miter won't get drawn, so nothing gets drawn at x < 100.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.