Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2390923002: Fix blurry content after disabling dev tools emulation (Closed)
Patch Set: Rename testing function too Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..bb94c806e7896c8ece6b8ae922b69a8a9eea6be0 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -3981,15 +3981,17 @@ 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;
+TransformationMatrix WebViewImpl::getDeviceEmulationTransformForTesting()
+ const {
+ return m_deviceEmulationTransform;
}
void WebViewImpl::enableDeviceEmulation(
@@ -4394,7 +4396,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 +4578,15 @@ void WebViewImpl::updateLayerTreeDeviceScaleFactor() {
m_layerTreeView->setDeviceScaleFactor(deviceScaleFactor);
}
-void WebViewImpl::updateRootLayerTransform() {
- if (m_visualViewportContainerLayer)
- m_visualViewportContainerLayer->setTransform(m_rootLayerTransform);
+void WebViewImpl::updateDeviceEmulationTransform() {
+ 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();
vmpstr 2016/10/04 00:25:53 I wonder if this is going to cause inconsistencies
enne (OOO) 2016/10/04 16:49:21 Yeah, I also think it is ok to crisp up content he
}
bool WebViewImpl::detectContentOnTouch(
« no previous file with comments | « third_party/WebKit/Source/web/WebViewImpl.h ('k') | third_party/WebKit/Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698