Chromium Code Reviews| 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 e2c21cc952e1a42bf5d9c046f4bdd8f383304559..c67b07f1918b85cde7c2a4bd212f7281c767c64f 100644 |
| --- a/third_party/WebKit/Source/web/WebViewImpl.cpp |
| +++ b/third_party/WebKit/Source/web/WebViewImpl.cpp |
| @@ -109,6 +109,7 @@ |
| #include "platform/UserGestureIndicator.h" |
| #include "platform/exported/WebActiveGestureAnimation.h" |
| #include "platform/fonts/FontCache.h" |
| +#include "platform/geometry/FloatRect.h" |
| #include "platform/graphics/Color.h" |
| #include "platform/graphics/CompositorMutatorClient.h" |
| #include "platform/graphics/FirstPaintInvalidationTracking.h" |
| @@ -419,7 +420,6 @@ WebViewImpl::WebViewImpl(WebViewClient* client, WebPageVisibilityState visibilit |
| , m_doingDragAndDrop(false) |
| , m_ignoreInputEvents(false) |
| , m_compositorDeviceScaleFactorOverride(0) |
| - , m_rootLayerScale(1) |
| , m_suppressNextKeypressEvent(false) |
| , m_imeAcceptEvents(true) |
| , m_operationsAllowed(WebDragOperationNone) |
| @@ -3849,17 +3849,19 @@ void WebViewImpl::setCompositorDeviceScaleFactorOverride(float deviceScaleFactor |
| updateLayerTreeDeviceScaleFactor(); |
| } |
| -void WebViewImpl::setRootLayerTransform(const WebSize& rootLayerOffset, float rootLayerScale) |
| +void WebViewImpl::setRootLayerTransform(const TransformationMatrix& transform) |
| { |
| - if (m_rootLayerScale == rootLayerScale && m_rootLayerOffset == rootLayerOffset) |
| + if (transform == m_rootLayerTransform) |
| return; |
| - m_rootLayerScale = rootLayerScale; |
| - m_rootLayerOffset = rootLayerOffset; |
| - if (mainFrameImpl()) |
| - mainFrameImpl()->setInputEventsTransformForEmulation(m_rootLayerOffset, m_rootLayerScale); |
| + m_rootLayerTransform = transform; |
| updateRootLayerTransform(); |
| } |
| +TransformationMatrix WebViewImpl::getRootLayerTransformForTesting() const |
| +{ |
| + return m_rootLayerTransform; |
| +} |
| + |
| void WebViewImpl::enableDeviceEmulation(const WebDeviceEmulationParams& params) |
| { |
| m_devToolsEmulator->enableDeviceEmulation(params); |
| @@ -4095,6 +4097,12 @@ void WebViewImpl::pageScaleFactorChanged() |
| pageScaleConstraintsSet().setNeedsReset(false); |
| updateLayerTreeViewport(); |
| m_client->pageScaleFactorChanged(); |
| + m_devToolsEmulator->mainFrameScrollOrScaleChanged(); |
| +} |
| + |
| +void WebViewImpl::mainFrameScrollOffsetChanged() |
| +{ |
| + m_devToolsEmulator->mainFrameScrollOrScaleChanged(); |
| } |
| bool WebViewImpl::useExternalPopupMenus() |
| @@ -4427,12 +4435,8 @@ void WebViewImpl::updateLayerTreeDeviceScaleFactor() |
| void WebViewImpl::updateRootLayerTransform() |
| { |
| - if (m_visualViewportContainerLayer) { |
| - TransformationMatrix transform; |
| - transform.translate(m_rootLayerOffset.width, m_rootLayerOffset.height); |
| - transform = transform.scale(m_rootLayerScale); |
| - m_visualViewportContainerLayer->setTransform(transform); |
| - } |
| + if (m_visualViewportContainerLayer) |
| + m_visualViewportContainerLayer->setTransform(m_rootLayerTransform); |
| } |
| bool WebViewImpl::detectContentOnTouch(const GestureEventWithHitTestResults& targetedEvent) |
| @@ -4597,6 +4601,13 @@ float WebViewImpl::deviceScaleFactor() const |
| return page()->deviceScaleFactor(); |
| } |
| +float WebViewImpl::compositorDeviceScaleFactor() const |
|
dgozman
2016/09/17 01:22:28
Let's inline this method into DevToolsEmulator, si
Eric Seckler
2016/09/22 12:43:00
Done.
|
| +{ |
| + if (m_compositorDeviceScaleFactorOverride) |
| + return m_compositorDeviceScaleFactorOverride; |
| + return deviceScaleFactor(); |
| +} |
| + |
| LocalFrame* WebViewImpl::focusedLocalFrameInWidget() const |
| { |
| if (!mainFrameImpl()) |