⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 248351 in webkit


Ignore:
Timestamp:
Aug 6, 2019, 11:52:39 PM (7 years ago)
Author:
Kocsen Chung
Message:

Cherry-pick r247846. rdar://problem/54017896

Subpixel fringes around TextIndicator snapshots at non-integral scale factors
https://bugs.webkit.org/show_bug.cgi?id=200145

Reviewed by Simon Fraser.

  • page/FrameSnapshotting.cpp: (WebCore::snapshotFrameRectWithClip):
  • page/FrameSnapshotting.h:
  • page/TextIndicator.cpp: (WebCore::snapshotOptionsForTextIndicatorOptions): Round the scale factor up, and snappily enclose the clip rects.

TextIndicator doesn't require the use of the precise scale factor that
the page is painted at, but we want it to be sharp, so we overshoot!

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

Location:
branches/safari-608.1-branch/Source/WebCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-608.1-branch/Source/WebCore/ChangeLog

    r248349 r248351  
     12019-08-06  Kocsen Chung  <kocsen_chung@apple.com>
     2
     3        Cherry-pick r247846. rdar://problem/54017896
     4
     5    Subpixel fringes around TextIndicator snapshots at non-integral scale factors
     6    https://bugs.webkit.org/show_bug.cgi?id=200145
     7   
     8    Reviewed by Simon Fraser.
     9   
     10    * page/FrameSnapshotting.cpp:
     11    (WebCore::snapshotFrameRectWithClip):
     12    * page/FrameSnapshotting.h:
     13    * page/TextIndicator.cpp:
     14    (WebCore::snapshotOptionsForTextIndicatorOptions):
     15    Round the scale factor up, and snappily enclose the clip rects.
     16   
     17    TextIndicator doesn't require the use of the precise scale factor that
     18    the page is painted at, but we want it to be sharp, so we overshoot!
     19   
     20   
     21    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247846 268f45cc-cd09-0410-ab3c-d52691b4dbfc
     22
     23    2019-07-25  Tim Horton  <timothy_horton@apple.com>
     24
     25            Subpixel fringes around TextIndicator snapshots at non-integral scale factors
     26            https://bugs.webkit.org/show_bug.cgi?id=200145
     27
     28            Reviewed by Simon Fraser.
     29
     30            * page/FrameSnapshotting.cpp:
     31            (WebCore::snapshotFrameRectWithClip):
     32            * page/FrameSnapshotting.h:
     33            * page/TextIndicator.cpp:
     34            (WebCore::snapshotOptionsForTextIndicatorOptions):
     35            Round the scale factor up, and snappily enclose the clip rects.
     36
     37            TextIndicator doesn't require the use of the precise scale factor that
     38            the page is painted at, but we want it to be sharp, so we overshoot!
     39
    1402019-08-06  Kocsen Chung  <kocsen_chung@apple.com>
    241
  • branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.cpp

    r235560 r248351  
    109109        scaleFactor *= frame.page()->pageScaleFactor();
    110110
     111    if (options & SnapshotOptionsPaintWithIntegralScaleFactor)
     112        scaleFactor = ceilf(scaleFactor);
     113
    111114    std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), Unaccelerated, scaleFactor);
    112115    if (!buffer)
     
    117120        Path clipPath;
    118121        for (auto& rect : clipRects)
    119             clipPath.addRect(rect);
     122            clipPath.addRect(encloseRectToDevicePixels(rect, scaleFactor));
    120123        buffer->context().clipPath(clipPath);
    121124    }
  • branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.h

    r222113 r248351  
    4848    SnapshotOptionsForceBlackText = 1 << 3,
    4949    SnapshotOptionsPaintSelectionAndBackgroundsOnly = 1 << 4,
    50     SnapshotOptionsPaintEverythingExcludingSelection = 1 << 5
     50    SnapshotOptionsPaintEverythingExcludingSelection = 1 << 5,
     51    SnapshotOptionsPaintWithIntegralScaleFactor = 1 << 6,
    5152};
    5253typedef unsigned SnapshotOptions;
  • branches/safari-608.1-branch/Source/WebCore/page/TextIndicator.cpp

    r248345 r248351  
    133133static SnapshotOptions snapshotOptionsForTextIndicatorOptions(TextIndicatorOptions options)
    134134{
    135     SnapshotOptions snapshotOptions = SnapshotOptionsNone;
     135    SnapshotOptions snapshotOptions = SnapshotOptionsPaintWithIntegralScaleFactor;
    136136
    137137    if (!(options & TextIndicatorOptionPaintAllContent)) {
Note: See TracChangeset for help on using the changeset viewer.