Changeset 201907 in webkit
- Timestamp:
- Jun 9, 2016 10:27:11 PM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r201906 r201907 1 2016-06-09 Zalan Bujtas <zalan@apple.com> 2 3 Hairline borders do not show up on 3x displays. 4 https://bugs.webkit.org/show_bug.cgi?id=158604 5 <rdar://problem/26511679> 6 7 Reviewed by Simon Fraser. 8 9 On a 3x display, when we convert a 1/3px hairline border from float 10 to LayoutUnit and pixel floor the result, we end up with a 0px width border. 11 It's because float to LayoutUnit is lossy and since the current kFixedPointDenominator % 3 != 0, 12 flooring LayoutUnit(1/3px) ends up being 0px. (float: 1/3 -> LayoutUnit: (1/3 - 1/kFixedPointDenominator) -> floor: 0) 13 This patch eliminates the (unnecessary) float -> LayoutUnit - float conversion on border width. 14 15 * fast/borders/hidpi-3x-input-hairline-border-expected-mismatch.html: Added. 16 * fast/borders/hidpi-3x-input-hairline-border.html: Added. 17 1 18 2016-06-09 Commit Queue <commit-queue@webkit.org> 2 19 -
trunk/Source/WebCore/ChangeLog
r201906 r201907 1 2016-06-09 Zalan Bujtas <zalan@apple.com> 2 3 Hairline borders do not show up on 3x displays. 4 https://bugs.webkit.org/show_bug.cgi?id=158604 5 <rdar://problem/26511679> 6 7 Reviewed by Simon Fraser. 8 9 On a 3x display, when we convert a 1/3px hairline border from float 10 to LayoutUnit and pixel floor the result, we end up with a 0px width border. 11 It's because float to LayoutUnit is lossy and since the current kFixedPointDenominator % 3 != 0, 12 flooring LayoutUnit(1/3px) ends up being 0px. (float: 1/3 -> LayoutUnit: (1/3 - 1/kFixedPointDenominator) -> floor: 0) 13 This patch eliminates the (unnecessary) float -> LayoutUnit - float conversion on border width. 14 15 Test: fast/borders/hidpi-3x-input-hairline-border.html 16 17 * rendering/BorderEdge.cpp: 18 (WebCore::BorderEdge::BorderEdge): 19 * rendering/BorderEdge.h: 20 1 21 2016-06-09 Commit Queue <commit-queue@webkit.org> 2 22 -
trunk/Source/WebCore/rendering/BorderEdge.cpp
r192444 r201907 34 34 namespace WebCore { 35 35 36 BorderEdge::BorderEdge( LayoutUnit edgeWidth, Color edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent, float devicePixelRatio)36 BorderEdge::BorderEdge(float edgeWidth, Color edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent, float devicePixelRatio) 37 37 : m_width(edgeWidth) 38 38 , m_color(edgeColor) … … 44 44 if (edgeStyle == DOUBLE && edgeWidth < borderWidthInDevicePixel(3)) 45 45 m_style = SOLID; 46 m_flooredToDevicePixelWidth = floor ToDevicePixel(edgeWidth, devicePixelRatio);46 m_flooredToDevicePixelWidth = floorf(edgeWidth * devicePixelRatio) / devicePixelRatio; 47 47 } 48 48 -
trunk/Source/WebCore/rendering/BorderEdge.h
r192444 r201907 47 47 48 48 BorderEdge() = default; 49 BorderEdge( LayoutUnit edgeWidth, Color edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent, float devicePixelRatio);49 BorderEdge(float edgeWidth, Color edgeColor, EBorderStyle edgeStyle, bool edgeIsTransparent, bool edgeIsPresent, float devicePixelRatio); 50 50 51 51 static void getBorderEdgeInfo(BorderEdge edges[], const RenderStyle&, float deviceScaleFactor, bool includeLogicalLeftEdge = true, bool includeLogicalRightEdge = true);
Note: See TracChangeset
for help on using the changeset viewer.