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

Side by Side Diff: third_party/WebKit/Source/web/DevToolsEmulator.cpp

Issue 2390923002: Fix blurry content after disabling dev tools emulation (Closed)
Patch Set: Add function for LayerTreeHostRemote 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 unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « content/renderer/gpu/render_widget_compositor.cc ('k') | third_party/WebKit/Source/web/WebViewImpl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698