Title: [144375] trunk
Revision
144375
Author
[email protected]
Date
2013-02-28 14:54:13 -0800 (Thu, 28 Feb 2013)

Log Message

Underline should round to match other content.
https://bugs.webkit.org/show_bug.cgi?id=111005

Patch by Ben Wagner <[email protected]> on 2013-02-28
Reviewed by Stephen White.

Test: fast/text/decorations-with-text-combine.html

* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::drawLineForText):
Round (instead of floor) underlines to match other content.

Modified Paths

Diff

Modified: trunk/LayoutTests/platform/chromium/TestExpectations (144374 => 144375)


--- trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-28 22:51:42 UTC (rev 144374)
+++ trunk/LayoutTests/platform/chromium/TestExpectations	2013-02-28 22:54:13 UTC (rev 144375)
@@ -157,6 +157,9 @@
 # TEMPORARILY SKIPPED TESTS
 # -----------------------------------------------------------------
 
+# Underline placement needs to be rounded to match other content.
+webkit.org/b/111005 fast/text/decorations-with-text-combine.html [ ImageOnlyFailure ]
+
 # Context menu behavior differs on Mac. This test needs to be adjusted for Mac.
 webkit.org/b/102987 [ Mac ] fast/events/context-nodrag.html [ Skip ]
 

Modified: trunk/Source/WebCore/ChangeLog (144374 => 144375)


--- trunk/Source/WebCore/ChangeLog	2013-02-28 22:51:42 UTC (rev 144374)
+++ trunk/Source/WebCore/ChangeLog	2013-02-28 22:54:13 UTC (rev 144375)
@@ -1,3 +1,16 @@
+2013-02-28  Ben Wagner  <[email protected]>
+
+        Underline should round to match other content.
+        https://bugs.webkit.org/show_bug.cgi?id=111005
+
+        Reviewed by Stephen White.
+
+        Test: fast/text/decorations-with-text-combine.html
+
+        * platform/graphics/skia/GraphicsContextSkia.cpp:
+        (WebCore::GraphicsContext::drawLineForText):
+        Round (instead of floor) underlines to match other content.
+
 2013-02-28  Eric Carlson  <[email protected]>
 
         Refine Ryosuke's r144367 fix.

Modified: trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp (144374 => 144375)


--- trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	2013-02-28 22:51:42 UTC (rev 144374)
+++ trunk/Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp	2013-02-28 22:54:13 UTC (rev 144375)
@@ -750,7 +750,8 @@
     SkRect r;
     r.fLeft = WebCoreFloatToSkScalar(pt.x());
     // Avoid anti-aliasing lines. Currently, these are always horizontal.
-    r.fTop = WebCoreFloatToSkScalar(floorf(pt.y()));
+    // Round to nearest pixel to match text and other content.
+    r.fTop = WebCoreFloatToSkScalar(floorf(pt.y() + 0.5f));
     r.fRight = r.fLeft + WebCoreFloatToSkScalar(width);
     r.fBottom = r.fTop + SkIntToScalar(thickness);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to