[webkit-reviews] review granted: [Bug 28268] adjustLineToPixelBoundaries used in platform/GraphicsContext drawLine needs refactoring finished. : [Attachment 35044] Correct version of Rename functions in patch - Refactor patternWidth and patternOffset calculations from GraphicsContextQt/Cairo/CG.cpp into GraphicsContext.cpp as requested.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Aug 18 09:28:15 PDT 2009


Eric Seidel <eric at webkit.org> has granted Mike Fenton
<mike.fenton at torchmobile.com>'s request for review:
Bug 28268: adjustLineToPixelBoundaries used in platform/GraphicsContext
drawLine needs refactoring finished.
https://bugs.webkit.org/show_bug.cgi?id=28268

Attachment 35044: Correct version of Rename functions in patch - Refactor
patternWidth and patternOffset calculations from GraphicsContextQt/Cairo/CG.cpp
into GraphicsContext.cpp as requested.
https://bugs.webkit.org/attachment.cgi?id=35044&action=review

------- Additional Comments from Eric Seidel <eric at webkit.org>
This seems unneeded:
+    // Special case 1px dotted borders for speed.
+    if (width == 1)
+	 return 1.0f;

A few floating point divisions should not going to outweigh the cost of a
function call.

We don't even have to subtract the remainder here, do we?
 602	 int numSegments = (distance - remainder) / width;
unless I'm forgetting how int / int works.
(It's fine to do so, just surprised to see it).

It seems that patternOffsetForDashes could probably use a bit more commentary
around the math.

Looks OK though.


More information about the webkit-reviews mailing list