[Webkit-unassigned] [Bug 74578] Incorrect stroke near borders

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 6 08:06:54 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=74578





--- Comment #5 from Philip Rogers <pdr at google.com>  2012-01-06 08:06:54 PST ---
Created an attachment (id=121433)
 --> (https://bugs.webkit.org/attachment.cgi?id=121433&action=review)
Example of clipping fixed with this patch

(In reply to comment #3)
> I believe you that this works... but it feels like a bit of a one-off-hack for this situation.  Should we be doing this inflate in a more central place?

I agree it feels like a one-off hack but it's the result of clipping so deep in the stack. This codepath only occurs because a separate transparency layer is created for objects with opacity or shadow and we have to clip when drawing.

That said, I really don't like a random 0.5 inflate in the middle of the code. I'll have a followup patch that switches to enclosingLayoutRect(object->repaintRectInLocalCoordinates()), which is used for similar purposes elsewhere. Instead of adding 0.5, enclosingLayoutRect uses floor on the top and left coordinates, and ceil on the right and bottom coordinates, which should be exactly what we need.


(In reply to comment #4)
> (From update of attachment 119654 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=119654&action=review
> 
> Eric is right, the patch is not correct. Also what if the border is thicker than 1? You can not hard code the inflation.

This extra padding is only to account for the "overdraw" outside the repaint rect, not the border itself. For instance, the rightmost line in the test extends from x=99.5 to x=100.5, but is actually drawn using pixels at x=99. Previously, we were clipping the pixels at x=99 and not drawing them.

> 
> > Source/WebCore/rendering/svg/SVGRenderSupport.cpp:94
> >          FloatRect repaintRect = object->repaintRectInLocalCoordinates();
> 
> The repaintRectInLocalCoordinates should already include the border. If we clip sty of the border away, it seems like a bug in repaintRectInLocalCoordinates(). Is it just for lines? Do you see that for SVGRects or SVGCircles as well?

Unfortunately it looks like repaintRect is just the minimum enclosing rect for the path and does not account for the overdraw. This bug occurs for all shapes (lines, rects, even circles) and this patch fixes them all. Looking at the diffs of the new failing tests, the current expected results clearly have clipping, which is fixed with this patch (see the attached image clipping.png).

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list