Changeset 222247 in webkit
- Timestamp:
- Sep 19, 2017 8:46:46 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r222233 r222247 1 2017-09-19 Simon Fraser <simon.fraser@apple.com> 2 3 tiled-drawing/tiled-backing-in-window.html fails on Retina displays 4 https://bugs.webkit.org/show_bug.cgi?id=177113 5 6 Reviewed by Tim Horton. 7 8 Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset" 9 behavior. 10 11 * UIProcess/WebPageProxy.cpp: 12 (WebKit::WebPageProxy::deviceScaleFactor const): 13 (WebKit::WebPageProxy::setCustomDeviceScaleFactor): 14 * UIProcess/WebPageProxy.h: 15 1 16 2017-09-19 Alex Christensen <achristensen@webkit.org> 2 17 -
trunk/Source/WebKit/UIProcess/WebPageProxy.cpp
r222183 r222247 2562 2562 float WebPageProxy::deviceScaleFactor() const 2563 2563 { 2564 if (m_customDeviceScaleFactor) 2565 return m_customDeviceScaleFactor; 2566 return m_intrinsicDeviceScaleFactor; 2564 return m_customDeviceScaleFactor.value_or(m_intrinsicDeviceScaleFactor); 2567 2565 } 2568 2566 … … 2578 2576 #endif 2579 2577 2580 if (m_customDeviceScaleFactor == customScaleFactor)2578 if (m_customDeviceScaleFactor && m_customDeviceScaleFactor.value() == customScaleFactor) 2581 2579 return; 2582 2580 2583 2581 float oldScaleFactor = deviceScaleFactor(); 2584 2582 2585 m_customDeviceScaleFactor = customScaleFactor; 2583 // A value of 0 clears the customScaleFactor. 2584 if (customScaleFactor) 2585 m_customDeviceScaleFactor = customScaleFactor; 2586 else 2587 m_customDeviceScaleFactor = std::nullopt; 2586 2588 2587 2589 if (deviceScaleFactor() != oldScaleFactor) -
trunk/Source/WebKit/UIProcess/WebPageProxy.h
r222059 r222247 1757 1757 double m_viewScaleFactor { 1 }; 1758 1758 float m_intrinsicDeviceScaleFactor { 1 }; 1759 float m_customDeviceScaleFactor { 0 };1759 std::optional<float> m_customDeviceScaleFactor; 1760 1760 float m_topContentInset { 0 }; 1761 1761 -
trunk/Tools/ChangeLog
r222245 r222247 1 2017-09-19 Simon Fraser <simon.fraser@apple.com> 2 3 tiled-drawing/tiled-backing-in-window.html fails on Retina displays 4 https://bugs.webkit.org/show_bug.cgi?id=177113 5 6 Reviewed by Tim Horton. 7 8 This test removes the view from the window, and then dumps the layer tree, at which point 9 some layers would report a contentsScale of 2 on Retina displays. 10 11 This occurs because WebKitTestRunner overrides the default device scale factor on NSWindow, 12 but windowless views fall back to [NSScreen mainScreen].backingScaleFactor (in WebViewImpl::intrinsicDeviceScaleFactor()). 13 14 Fix by having PlatformWebView::changeWindowScaleIfNeeded() call -_setOverrideDeviceScaleFactor: on the view. 15 16 * WebKitTestRunner/mac/PlatformWebViewMac.mm: 17 (WTR::PlatformWebView::changeWindowScaleIfNeeded): 18 1 19 2017-09-19 Wenson Hsieh <wenson_hsieh@apple.com> 2 20 -
trunk/Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm
r216931 r222247 288 288 if (currentScale == newScale) 289 289 return; 290 290 291 [m_window _setWindowResolution:newScale displayIfChanged:YES]; 292 #if WK_API_ENABLED 293 [m_view _setOverrideDeviceScaleFactor:newScale]; 294 #endif 295 291 296 // Instead of re-constructing the current window, let's fake resize it to ensure that the scale change gets picked up. 292 297 forceWindowFramesChanged();
Note: See TracChangeset
for help on using the changeset viewer.