Index: third_party/WebKit/Source/web/WebViewImpl.cpp |
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp |
index 72326e93daf0387e933ef84ec0a30ccde5f7c4fb..a9cef586d2a353d63e0c6f0547b6f3c68bb1e230 100644 |
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
@@ -3981,15 +3981,16 @@ void WebViewImpl::setCompositorDeviceScaleFactorOverride( |
updateLayerTreeDeviceScaleFactor(); |
} |
-void WebViewImpl::setRootLayerTransform(const TransformationMatrix& transform) { |
- if (transform == m_rootLayerTransform) |
+void WebViewImpl::setDeviceEmulationTransform( |
+ const TransformationMatrix& transform) { |
+ if (transform == m_deviceEmulationTransform) |
return; |
- m_rootLayerTransform = transform; |
- updateRootLayerTransform(); |
+ m_deviceEmulationTransform = transform; |
+ updateDeviceEmulationTransform(); |
} |
TransformationMatrix WebViewImpl::getRootLayerTransformForTesting() const { |
- return m_rootLayerTransform; |
+ return m_deviceEmulationTransform; |
} |
void WebViewImpl::enableDeviceEmulation( |
@@ -4394,7 +4395,7 @@ void WebViewImpl::setRootGraphicsLayer(GraphicsLayer* graphicsLayer) { |
m_rootGraphicsLayer = visualViewport.rootGraphicsLayer(); |
m_visualViewportContainerLayer = visualViewport.containerLayer(); |
m_rootLayer = m_rootGraphicsLayer->platformLayer(); |
- updateRootLayerTransform(); |
+ updateDeviceEmulationTransform(); |
m_layerTreeView->setRootLayer(*m_rootLayer); |
// We register viewport layers here since there may not be a layer |
// tree view prior to this point. |
@@ -4576,9 +4577,15 @@ void WebViewImpl::updateLayerTreeDeviceScaleFactor() { |
m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor); |
} |
-void WebViewImpl::updateRootLayerTransform() { |
- if (m_visualViewportContainerLayer) |
- m_visualViewportContainerLayer->setTransform(m_rootLayerTransform); |
+void WebViewImpl::updateDeviceEmulationTransform() { |
enne (OOO)
2016/10/03 23:27:30
Renamed this as devtools is the only consumer of t
|
+ if (!m_visualViewportContainerLayer) |
+ return; |
+ |
+ // When the device emulation transform is updated, to avoid incorrect |
+ // scales and fuzzy raster from the compositor, force all content to |
+ // pick ideal raster scales. |
+ m_visualViewportContainerLayer->setTransform(m_deviceEmulationTransform); |
+ m_layerTreeView->forceRecalculateRasterScales(); |
} |
bool WebViewImpl::detectContentOnTouch( |