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

Unified Diff: cc/trees/layer_tree_host_unittest.cc

Issue 1412663005: Introduce painted-device-scale-factor and use it when --enable-use-zoom-for-dsf is specified. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_unittest.cc
diff --git a/cc/trees/layer_tree_host_unittest.cc b/cc/trees/layer_tree_host_unittest.cc
index cad9857dddbd9663e8a1ded819673e0d829fed8e..477f29ab3a1f51836d361fa32e414a0c99158f6a 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -6381,5 +6381,28 @@ class LayerTreeHostTestDestroyWhileInitializingOutputSurface
MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
+// Makes sure that painted_device_scale_factor is propagated to the
+// frame's metadata.
+class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
+ protected:
+ void BeginTest() override {
+ layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f);
+ EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor());
+ PostSetNeedsCommitToMainThread();
+ }
+
+ void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
+ EXPECT_EQ(2.0f,
+ output_surface()->last_sent_frame().metadata.device_scale_factor);
+ EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor());
+ EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor());
+ EndTest();
+ }
+
+ void AfterTest() override {}
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
+
} // namespace
} // namespace cc
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/layer_tree_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698