OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "web/DevToolsEmulator.h" | 5 #include "web/DevToolsEmulator.h" |
6 | 6 |
7 #include "core/frame/FrameHost.h" | 7 #include "core/frame/FrameHost.h" |
8 #include "core/frame/FrameView.h" | 8 #include "core/frame/FrameView.h" |
9 #include "core/frame/Settings.h" | 9 #include "core/frame/Settings.h" |
10 #include "core/frame/VisualViewport.h" | 10 #include "core/frame/VisualViewport.h" |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 transform->scale(1. / m_webViewImpl->pageScaleFactor()); | 421 transform->scale(1. / m_webViewImpl->pageScaleFactor()); |
422 } | 422 } |
423 | 423 |
424 void DevToolsEmulator::updateRootLayerTransform() { | 424 void DevToolsEmulator::updateRootLayerTransform() { |
425 TransformationMatrix transform; | 425 TransformationMatrix transform; |
426 | 426 |
427 // Apply device emulation transform first, so that it is affected by the | 427 // Apply device emulation transform first, so that it is affected by the |
428 // viewport override. | 428 // viewport override. |
429 applyViewportOverride(&transform); | 429 applyViewportOverride(&transform); |
430 applyDeviceEmulationTransform(&transform); | 430 applyDeviceEmulationTransform(&transform); |
431 m_webViewImpl->setRootLayerTransform(transform); | 431 m_webViewImpl->setDeviceEmulationTransform(transform); |
432 } | 432 } |
433 | 433 |
434 WTF::Optional<IntRect> DevToolsEmulator::visibleContentRectForPainting() const { | 434 WTF::Optional<IntRect> DevToolsEmulator::visibleContentRectForPainting() const { |
435 if (!m_viewportOverride) | 435 if (!m_viewportOverride) |
436 return WTF::nullopt; | 436 return WTF::nullopt; |
437 FloatSize viewportSize(m_webViewImpl->layerTreeView()->getViewportSize()); | 437 FloatSize viewportSize(m_webViewImpl->layerTreeView()->getViewportSize()); |
438 viewportSize.scale(1. / compositorDeviceScaleFactor()); | 438 viewportSize.scale(1. / compositorDeviceScaleFactor()); |
439 viewportSize.scale(1. / m_viewportOverride->scale); | 439 viewportSize.scale(1. / m_viewportOverride->scale); |
440 return enclosingIntRect( | 440 return enclosingIntRect( |
441 FloatRect(m_viewportOverride->position.x, m_viewportOverride->position.y, | 441 FloatRect(m_viewportOverride->position.x, m_viewportOverride->position.y, |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
517 m_lastPinchAnchorCss.reset(); | 517 m_lastPinchAnchorCss.reset(); |
518 m_lastPinchAnchorDip.reset(); | 518 m_lastPinchAnchorDip.reset(); |
519 } | 519 } |
520 return true; | 520 return true; |
521 } | 521 } |
522 | 522 |
523 return false; | 523 return false; |
524 } | 524 } |
525 | 525 |
526 } // namespace blink | 526 } // namespace blink |
OLD | NEW |