Make WebCore keep track of the current device scale factor
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 13:26:12 +0000 (13:26 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 18 Aug 2011 13:26:12 +0000 (13:26 +0000)
commit7a103b8238d9a910caad49d5eb47e347713b21bb
tree9c69d77a7e690f38791f972a20440f72af6f3f3a
parent1e69cd3386b90cb975425e75315b92d2c29e2841
Make WebCore keep track of the current device scale factor

Fixes <http://webkit.org/b/66413> WebCore requires every WebKit port to keep track of the
device scale factor

Reviewed by Darin Adler.

Source/WebCore:

* WebCore.exp.in: Removed Frame::deviceScaleFactorChanged, added Page::setDeviceScaleFactor.

* css/MediaQueryEvaluator.cpp:
(WebCore::device_pixel_ratioMediaFeatureEval):
* html/HTMLCanvasElement.cpp:
(WebCore::HTMLCanvasElement::HTMLCanvasElement):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::devicePixelRatio):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::addDashboardRegions):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::deviceScaleFactor):
* rendering/RenderObject.cpp:
(WebCore::RenderObject::addDashboardRegions):
Changed to get the device scale factor from Page.

* loader/EmptyClients.h:
* page/Chrome.cpp:
* page/Chrome.h:
* page/ChromeClient.h:
Removed Chrome[Client]::deviceScaleFactor.

* page/Frame.cpp:
* page/Frame.h:
Removed deviceScaleFactorChanged. Made deviceOrPageScaleFactorChanged public.

* page/Page.cpp:
(WebCore::Page::Page): Initialize m_deviceScaleFactor.
(WebCore::Page::setDeviceScaleFactor): Added. Code came from
Frame::deviceScaleFactorChanged.

* page/Page.h: Added m_deviceScaleFactor.
(WebCore::Page::deviceScaleFactor): Added simple getter.

Source/WebKit/chromium:

* src/ChromeClientImpl.cpp:
* src/ChromeClientImpl.h:
Removed deviceScaleFactor.

Source/WebKit/efl:

* WebCoreSupport/ChromeClientEfl.cpp:
* WebCoreSupport/ChromeClientEfl.h:
Removed deviceScaleFactor.

Source/WebKit/gtk:

* WebCoreSupport/ChromeClientGtk.cpp:
* WebCoreSupport/ChromeClientGtk.h:
Removed deviceScaleFactor.

Source/WebKit/haiku:

* WebCoreSupport/ChromeClientHaiku.cpp:
* WebCoreSupport/ChromeClientHaiku.h:
Removed deviceScaleFactor.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
Moved code to calculate the device scale factor from here...

* WebView/WebView.mm:
(-[WebView _deviceScaleFactor]):
...to here.

(-[WebView _windowDidChangeResolution:]): Now calls Page::setDeviceScaleFactor.

Source/WebKit/qt:

* Api/qwebpage.cpp:
(QWebPagePrivate::QWebPagePrivate): Removed pixelRatio.
(QWebPage::viewportAttributesForSize): Now calls Page::setDeviceScaleFactor.

* Api/qwebpage_p.h: Removed pixelRatio.

* WebCoreSupport/ChromeClientQt.cpp:
* WebCoreSupport/ChromeClientQt.h:
Removed deviceScaleFactor.

Source/WebKit/win:

* WebCoreSupport/WebChromeClient.cpp:
* WebCoreSupport/WebChromeClient.h:
Removed deviceScaleFactor.

Source/WebKit/wince:

* WebCoreSupport/ChromeClientWinCE.cpp:
* WebCoreSupport/ChromeClientWinCE.h:
Removed deviceScaleFactor.

Source/WebKit/wx:

* WebKitSupport/ChromeClientWx.cpp:
* WebKitSupport/ChromeClientWx.h:
Removed deviceScaleFactor.

Source/WebKit2:

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
Removed deviceScaleFactor.

* WebProcess/WebPage/DrawingAreaImpl.cpp:
(WebKit::DrawingAreaImpl::sendDidUpdateBackingStoreState):
(WebKit::DrawingAreaImpl::exitAcceleratedCompositingMode):
(WebKit::DrawingAreaImpl::display):
* WebProcess/WebPage/FindController.cpp:
(WebKit::FindController::updateFindIndicator):
(WebKit::FindController::hideFindIndicator):
* WebProcess/WebPage/ca/LayerTreeHostCA.cpp:
(WebKit::LayerTreeHostCA::deviceScaleFactor):
Changed to get the device scale factor from WebCore.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::setDeviceScaleFactor):
* WebProcess/WebPage/WebPage.h:
Removed m_deviceScaleFactor. We always get the scale factor from WebCore now.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93303 268f45cc-cd09-0410-ab3c-d52691b4dbfc
54 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/css/MediaQueryEvaluator.cpp
Source/WebCore/html/HTMLCanvasElement.cpp
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/Chrome.cpp
Source/WebCore/page/Chrome.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/DOMWindow.cpp
Source/WebCore/page/Frame.cpp
Source/WebCore/page/Frame.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/rendering/RenderInline.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderObject.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/ChromeClientImpl.cpp
Source/WebKit/chromium/src/ChromeClientImpl.h
Source/WebKit/efl/ChangeLog
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.cpp
Source/WebKit/efl/WebCoreSupport/ChromeClientEfl.h
Source/WebKit/gtk/ChangeLog
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
Source/WebKit/haiku/ChangeLog
Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.cpp
Source/WebKit/haiku/WebCoreSupport/ChromeClientHaiku.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/qt/Api/qwebpage.cpp
Source/WebKit/qt/Api/qwebpage_p.h
Source/WebKit/qt/ChangeLog
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.cpp
Source/WebKit/qt/WebCoreSupport/ChromeClientQt.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebCoreSupport/WebChromeClient.cpp
Source/WebKit/win/WebCoreSupport/WebChromeClient.h
Source/WebKit/wince/ChangeLog
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.cpp
Source/WebKit/wince/WebCoreSupport/ChromeClientWinCE.h
Source/WebKit/wx/ChangeLog
Source/WebKit/wx/WebKitSupport/ChromeClientWx.cpp
Source/WebKit/wx/WebKitSupport/ChromeClientWx.h
Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebPage/DrawingAreaImpl.cpp
Source/WebKit2/WebProcess/WebPage/FindController.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/ca/LayerTreeHostCA.cpp