tiled-drawing/tiled-backing-in-window.html fails on Retina displays
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 03:46:46 +0000 (03:46 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Sep 2017 03:46:46 +0000 (03:46 +0000)
commit3041d1ab0a03ee6210a3c68d28ed119f1e540edf
tree4402b0ce25deec3974f979c215c36f99b92f90df
parentc65d462ee5da8fcf4ac5a95be0c630a317a9848f
tiled-drawing/tiled-backing-in-window.html fails on Retina displays
https://bugs.webkit.org/show_bug.cgi?id=177113

Reviewed by Tim Horton.

Source/WebKit:

Make m_customDeviceScaleFactor a std::optional<> instead of having the weird "0 is unset"
behavior.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::deviceScaleFactor const):
(WebKit::WebPageProxy::setCustomDeviceScaleFactor):
* UIProcess/WebPageProxy.h:

Tools:

This test removes the view from the window, and then dumps the layer tree, at which point
some layers would report a contentsScale of 2 on Retina displays.

This occurs because WebKitTestRunner overrides the default device scale factor on NSWindow,
but windowless views fall back to [NSScreen mainScreen].backingScaleFactor (in WebViewImpl::intrinsicDeviceScaleFactor()).

Fix by having PlatformWebView::changeWindowScaleIfNeeded() call -_setOverrideDeviceScaleFactor: on the view.

* WebKitTestRunner/mac/PlatformWebViewMac.mm:
(WTR::PlatformWebView::changeWindowScaleIfNeeded):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@222247 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebPageProxy.h
Tools/ChangeLog
Tools/WebKitTestRunner/mac/PlatformWebViewMac.mm