Underline should round to match other content.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2013 22:54:13 +0000 (22:54 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Feb 2013 22:54:13 +0000 (22:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111005

Patch by Ben Wagner <bungeman@chromium.org> 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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144375 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/platform/chromium/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp

index 5f3579e..0ff739a 100644 (file)
@@ -157,6 +157,9 @@ webkit.org/b/111054 [ Debug Mac Win7 ] fast/forms/time-multiple-fields/time-mult
 # 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 ]
 
index ddf53d2..4ccb667 100644 (file)
@@ -1,3 +1,16 @@
+2013-02-28  Ben Wagner  <bungeman@chromium.org>
+
+        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  <eric.carlson@apple.com>
 
         Refine Ryosuke's r144367 fix.
index ac90de9..6a56ccb 100644 (file)
@@ -750,7 +750,8 @@ void GraphicsContext::drawLineForText(const FloatPoint& pt,
     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);