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

Unified Diff: third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp

Issue 2237433004: Adds DevTools commands for forced viewport override. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove offset/scale params, rename commands, clip by backing size. Created 4 years, 4 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
Index: third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp
diff --git a/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp b/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp
index 4157507c9d2c7aa4695cc92b09c74ab4a28b7a76..e639a103faaa74f32d503f266bc799cbcc6c3d9d 100644
--- a/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp
+++ b/third_party/WebKit/Source/platform/testing/WebLayerTreeViewImplForTesting.cpp
@@ -99,11 +99,23 @@ void WebLayerTreeViewImplForTesting::setViewportSize(const WebSize& deviceViewpo
m_layerTreeHost->GetLayerTree()->SetViewportSize(gfxSize);
}
+WebSize WebLayerTreeViewImplForTesting::getViewportSize() const
+{
+ return WebSize(
+ m_layerTreeHost->GetLayerTree()->device_viewport_size().width(),
+ m_layerTreeHost->GetLayerTree()->device_viewport_size().height());
+}
+
void WebLayerTreeViewImplForTesting::setDeviceScaleFactor(float deviceScaleFactor)
{
m_layerTreeHost->GetLayerTree()->SetDeviceScaleFactor(deviceScaleFactor);
}
+float WebLayerTreeViewImplForTesting::getDeviceScaleFactor() const
+{
+ return m_layerTreeHost->GetLayerTree()->device_scale_factor();
+}
+
void WebLayerTreeViewImplForTesting::setBackgroundColor(WebColor color)
{
m_layerTreeHost->GetLayerTree()->set_background_color(color);

Powered by Google App Engine
This is Rietveld 408576698