Changeset 197524 in webkit


Ignore:
Timestamp:
Mar 3, 2016 3:55:52 PM (8 years ago)
Author:
Alan Bujtas
Message:

Subpixel rendering: Make collapsed borders painting subpixel aware.
https://bugs.webkit.org/show_bug.cgi?id=154980

Reviewed by David Hyatt.

This patch enables collapsed borders with odd pixel width paint on subpixel position.
Currently borders with odd pixels are split at integral position so that border-width: 3px;
paints 1px on the left(top) and 2px on the right(bottom) side. With this patch
we paint 1.5px on both sides(on 2x display).

Source/WebCore:

Test: fast/table/hidpi-collapsed-border-with-odd-pixel-width.html

  • rendering/RenderTableCell.cpp:

(WebCore::RenderTableCell::paintCollapsedBorders):

LayoutTests:

  • fast/table/hidpi-collapsed-border-with-odd-pixel-width-expected.html: Added.
  • fast/table/hidpi-collapsed-border-with-odd-pixel-width.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r197520 r197524  
     12016-03-03  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel rendering: Make collapsed borders painting subpixel aware.
     4        https://bugs.webkit.org/show_bug.cgi?id=154980
     5
     6        Reviewed by David Hyatt.
     7
     8        This patch enables collapsed borders with odd pixel width paint on subpixel position.
     9        Currently borders with odd pixels are split at integral position so that border-width: 3px;
     10        paints 1px on the left(top) and 2px on the right(bottom) side. With this patch
     11        we paint 1.5px on both sides(on 2x display).
     12
     13        * fast/table/hidpi-collapsed-border-with-odd-pixel-width-expected.html: Added.
     14        * fast/table/hidpi-collapsed-border-with-odd-pixel-width.html: Added.
     15
    1162016-03-03  Filip Pizlo  <fpizlo@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r197519 r197524  
     12016-03-03  Zalan Bujtas  <zalan@apple.com>
     2
     3        Subpixel rendering: Make collapsed borders painting subpixel aware.
     4        https://bugs.webkit.org/show_bug.cgi?id=154980
     5
     6        Reviewed by David Hyatt.
     7
     8        This patch enables collapsed borders with odd pixel width paint on subpixel position.
     9        Currently borders with odd pixels are split at integral position so that border-width: 3px;
     10        paints 1px on the left(top) and 2px on the right(bottom) side. With this patch
     11        we paint 1.5px on both sides(on 2x display).
     12
     13        Test: fast/table/hidpi-collapsed-border-with-odd-pixel-width.html
     14
     15        * rendering/RenderTableCell.cpp:
     16        (WebCore::RenderTableCell::paintCollapsedBorders):
     17
    1182016-03-03  Dave Hyatt  <hyatt@apple.com>
    219
  • trunk/Source/WebCore/rendering/RenderTableCell.cpp

    r197486 r197524  
    12051205    LayoutUnit rightWidth = rightVal.width();
    12061206
    1207     LayoutRect borderRect = LayoutRect(paintRect.x() - floorToInt(leftWidth / 2),
    1208         paintRect.y() - floorToInt(topWidth / 2),
    1209         paintRect.width() + floorToInt(leftWidth / 2) + floorToInt((rightWidth + 1) / 2),
    1210         paintRect.height() + floorToInt(topWidth / 2) + floorToInt((bottomWidth + 1) / 2));
     1207    float deviceScaleFactor = document().deviceScaleFactor();
     1208    LayoutRect borderRect = LayoutRect(paintRect.x() - floorToDevicePixel(leftWidth / 2, deviceScaleFactor),
     1209        paintRect.y() - floorToDevicePixel(topWidth / 2, deviceScaleFactor),
     1210        paintRect.width() + floorToDevicePixel(leftWidth / 2, deviceScaleFactor) + floorToDevicePixel(rightWidth / 2, deviceScaleFactor),
     1211        paintRect.height() + floorToDevicePixel(topWidth / 2, deviceScaleFactor) + floorToDevicePixel(bottomWidth / 2, deviceScaleFactor));
    12111212   
    12121213    EBorderStyle topStyle = collapsedBorderStyle(topVal.style());
Note: See TracChangeset for help on using the changeset viewer.