Title: [248351] branches/safari-608.1-branch/Source/WebCore
Revision
248351
Author
[email protected]
Date
2019-08-06 23:52:39 -0700 (Tue, 06 Aug 2019)

Log 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

Modified Paths

Diff

Modified: branches/safari-608.1-branch/Source/WebCore/ChangeLog (248350 => 248351)


--- branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-08-07 06:52:37 UTC (rev 248350)
+++ branches/safari-608.1-branch/Source/WebCore/ChangeLog	2019-08-07 06:52:39 UTC (rev 248351)
@@ -1,5 +1,44 @@
 2019-08-06  Kocsen Chung  <[email protected]>
 
+        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
+
+    2019-07-25  Tim Horton  <[email protected]>
+
+            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!
+
+2019-08-06  Kocsen Chung  <[email protected]>
+
         Cherry-pick r247822. rdar://problem/54017886
 
     Avoid UI Process hangs when the WebContent process is showing JS prompts / alerts

Modified: branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.cpp (248350 => 248351)


--- branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2019-08-07 06:52:37 UTC (rev 248350)
+++ branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.cpp	2019-08-07 06:52:39 UTC (rev 248351)
@@ -108,6 +108,9 @@
     if (frame.settings().delegatesPageScaling())
         scaleFactor *= frame.page()->pageScaleFactor();
 
+    if (options & SnapshotOptionsPaintWithIntegralScaleFactor)
+        scaleFactor = ceilf(scaleFactor);
+
     std::unique_ptr<ImageBuffer> buffer = ImageBuffer::create(imageRect.size(), Unaccelerated, scaleFactor);
     if (!buffer)
         return nullptr;
@@ -116,7 +119,7 @@
     if (!clipRects.isEmpty()) {
         Path clipPath;
         for (auto& rect : clipRects)
-            clipPath.addRect(rect);
+            clipPath.addRect(encloseRectToDevicePixels(rect, scaleFactor));
         buffer->context().clipPath(clipPath);
     }
 

Modified: branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.h (248350 => 248351)


--- branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.h	2019-08-07 06:52:37 UTC (rev 248350)
+++ branches/safari-608.1-branch/Source/WebCore/page/FrameSnapshotting.h	2019-08-07 06:52:39 UTC (rev 248351)
@@ -47,7 +47,8 @@
     SnapshotOptionsInViewCoordinates = 1 << 2,
     SnapshotOptionsForceBlackText = 1 << 3,
     SnapshotOptionsPaintSelectionAndBackgroundsOnly = 1 << 4,
-    SnapshotOptionsPaintEverythingExcludingSelection = 1 << 5
+    SnapshotOptionsPaintEverythingExcludingSelection = 1 << 5,
+    SnapshotOptionsPaintWithIntegralScaleFactor = 1 << 6,
 };
 typedef unsigned SnapshotOptions;
 

Modified: branches/safari-608.1-branch/Source/WebCore/page/TextIndicator.cpp (248350 => 248351)


--- branches/safari-608.1-branch/Source/WebCore/page/TextIndicator.cpp	2019-08-07 06:52:37 UTC (rev 248350)
+++ branches/safari-608.1-branch/Source/WebCore/page/TextIndicator.cpp	2019-08-07 06:52:39 UTC (rev 248351)
@@ -132,7 +132,7 @@
 
 static SnapshotOptions snapshotOptionsForTextIndicatorOptions(TextIndicatorOptions options)
 {
-    SnapshotOptions snapshotOptions = SnapshotOptionsNone;
+    SnapshotOptions snapshotOptions = SnapshotOptionsPaintWithIntegralScaleFactor;
 
     if (!(options & TextIndicatorOptionPaintAllContent)) {
         if (options & TextIndicatorOptionPaintBackgrounds)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to