Title: [240131] trunk/Source/WebKitLegacy/win
Revision
240131
Author
pvol...@apple.com
Date
2019-01-17 13:45:07 -0800 (Thu, 17 Jan 2019)

Log Message

[Win][HighDPI] Repaint glitches when scrolling.
https://bugs.webkit.org/show_bug.cgi?id=173152
<rdar://problem/45269953>

Reviewed by Brent Fulgham.

Non-integral device scale factors are causing repaint glitches, because the computation of the scroll
delta in pixel coordinates from the scroll delta in logical coordinates will not always be correct.
Instead of blitting the scroll rectangle, repaint the entire region affected by scrolling.

* WebView.cpp:
(WebView::scrollBackingStore):

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/win/ChangeLog (240130 => 240131)


--- trunk/Source/WebKitLegacy/win/ChangeLog	2019-01-17 21:38:34 UTC (rev 240130)
+++ trunk/Source/WebKitLegacy/win/ChangeLog	2019-01-17 21:45:07 UTC (rev 240131)
@@ -1,3 +1,18 @@
+2019-01-17  Per Arne Vollan  <pvol...@apple.com>
+
+        [Win][HighDPI] Repaint glitches when scrolling.
+        https://bugs.webkit.org/show_bug.cgi?id=173152
+        <rdar://problem/45269953>
+
+        Reviewed by Brent Fulgham.
+
+        Non-integral device scale factors are causing repaint glitches, because the computation of the scroll
+        delta in pixel coordinates from the scroll delta in logical coordinates will not always be correct.
+        Instead of blitting the scroll rectangle, repaint the entire region affected by scrolling.
+
+        * WebView.cpp:
+        (WebView::scrollBackingStore):
+
 2019-01-17  Alex Christensen  <achristen...@webkit.org>
 
         Stop using NetworkStorageSession::storageSession in WebCore

Modified: trunk/Source/WebKitLegacy/win/WebView.cpp (240130 => 240131)


--- trunk/Source/WebKitLegacy/win/WebView.cpp	2019-01-17 21:38:34 UTC (rev 240130)
+++ trunk/Source/WebKitLegacy/win/WebView.cpp	2019-01-17 21:45:07 UTC (rev 240131)
@@ -953,6 +953,19 @@
 
 void WebView::scrollBackingStore(FrameView* frameView, int logicalDx, int logicalDy, const IntRect& logicalScrollViewRect, const IntRect& logicalClipRect)
 {
+    if (deviceScaleFactor() != static_cast<int>(deviceScaleFactor())) {
+        // Non-integral device scale factors are causing repaint glitches, because the computation of the scroll
+        // delta in pixel coordinates from the scroll delta in logical coordinates will not always be correct.
+        // Instead of blitting the scroll rectangle, repaint the entire region affected by scrolling.
+        // FIXME: This is inefficient, we should be able to blit the scroll rectangle in this case as well,
+        // see https://bugs.webkit.org/show_bug.cgi?id=193542.
+        IntRect repaintRect = logicalScrollViewRect;
+        repaintRect.move(logicalDx, logicalDy);
+        repaintRect.unite(logicalScrollViewRect);
+        repaint(repaintRect, true);
+        return;
+    }
+
     m_needsDisplay = true;
 
     // Dimensions passed to us from WebCore are in logical units. We must convert to pixels:
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to