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

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 e75b3e9a2ba4a0324fee2176942bc83c2080f5a7..bf61c14ecf916c9717056dc8acdfc9ceea461d46 100644
--- a/cc/trees/layer_tree_host_unittest.cc
+++ b/cc/trees/layer_tree_host_unittest.cc
@@ -6378,5 +6378,42 @@ class LayerTreeHostTestDestroyWhileInitializingOutputSurface
MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
+class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
+ class PaintedScaleSwapPromise : public SwapPromise {
+ public:
+ PaintedScaleSwapPromise() {}
+ ~PaintedScaleSwapPromise() override {}
+ void DidActivate() override {}
+ void DidSwap(CompositorFrameMetadata* metadata) override {
+ EXPECT_EQ(2.0f, metadata->device_scale_factor);
enne (OOO) 2015/10/23 21:21:25 Maybe include a device scale factor on the composi
oshima 2015/10/23 22:05:02 I added additional check in SwapBuffersOnThread.
+ }
+ void DidNotSwap(DidNotSwapReason reason) override {}
+ int64 TraceId() const override { return 0; }
+ };
+
+ protected:
+ void BeginTest() override {
+ layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f);
+ EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor());
+ PostSetNeedsCommitToMainThread();
+ }
+
+ void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
+ int frame = host_impl->active_tree()->source_frame_number();
+ if (frame == -1) {
+ host_impl->active_tree()->QueuePinnedSwapPromise(
+ make_scoped_ptr(new PaintedScaleSwapPromise()));
+ }
+ }
+
+ void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
+ EndTest();
+ }
+
+ void AfterTest() override {}
+};
+
+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