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

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
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 e75b3e9a2ba4a0324fee2176942bc83c2080f5a7..afe7b99021fa66d78050dfe7cc3076c2665754a1 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -35,6 +35,7 @@
#include "cc/test/fake_display_list_recording_source.h"
#include "cc/test/fake_layer_tree_host_client.h"
#include "cc/test/fake_output_surface.h"
+#include "cc/test/fake_output_surface_client.h"
danakj 2015/10/24 00:08:07 not needed?
oshima 2015/10/27 20:28:09 Done.
#include "cc/test/fake_painted_scrollbar_layer.h"
#include "cc/test/fake_picture_layer.h"
#include "cc/test/fake_picture_layer_impl.h"
@@ -6378,5 +6379,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,
danakj 2015/10/24 00:07:00 Great, thanks. The cc parts LGTM
+ 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 {}
+};
+
+MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
danakj 2015/10/24 00:08:07 Why is it MULTI only and not SINGLE_AND_MULTI?
oshima 2015/10/27 20:28:09 Done.
+
} // namespace
} // namespace cc

Powered by Google App Engine
This is Rietveld 408576698