<rdar://problem/9018212> Underline thickness is not uniform under non-integral scale factor
https://bugs.webkit.org/show_bug.cgi?id=58083
Reviewed by Simon Fraser.
Source/WebCore:
Test: fast/text/decorations-transformed.html
* platform/graphics/GraphicsContext.h: Added a RoundingMode enum with two values. RoundAllSides
is the existing rounding mode, where each side of the rectangle snaps to the nearest pixel
gridline. RoundOriginAndDimensions snaps the origin to the nearest pixel gridpoint and rounds
the width and the height. In this new mode, translating a rectangle in user space never changes
its dimensions in device pixels.
* platform/graphics/cg/GraphicsContextCG.cpp:
(WebCore::GraphicsContext::roundToDevicePixels): Implemented RoundOriginAndDimensions.
(WebCore::GraphicsContext::drawLineForText): Use RoundOriginAndDimensions, thus ensuring that
all underlines have the same thickness in device pixels.
* platform/graphics/openvg/GraphicsContextOpenVG.cpp:
(WebCore::GraphicsContext::roundToDevicePixels): Added RoundingMode parameter, but did not implement it.
* platform/graphics/qt/GraphicsContextQt.cpp:
(WebCore::GraphicsContext::roundToDevicePixels): Ditto.
* platform/graphics/skia/GraphicsContextSkia.cpp:
(WebCore::GraphicsContext::roundToDevicePixels): Ditto.
* platform/graphics/wince/GraphicsContextWinCE.cpp:
(WebCore::GraphicsContext::roundToDevicePixels): Ditto.
* platform/graphics/wx/GraphicsContextWx.cpp:
(WebCore::GraphicsContext::roundToDevicePixels): Ditto.
* rendering/InlineTextBox.cpp:
(WebCore::InlineTextBox::paintDecoration):
LayoutTests:
* fast/text/decorations-transformed.html: Added.
* platform/mac/fast/text/decorations-transformed-expected.checksum: Added.
* platform/mac/fast/text/decorations-transformed-expected.png: Added.
* platform/mac/fast/text/decorations-transformed-expected.txt: Added.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@83216
268f45cc-cd09-0410-ab3c-
d52691b4dbfc