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

Side by Side 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, 1 month 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
« 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 »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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 "cc/trees/layer_tree_host.h" 5 #include "cc/trees/layer_tree_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/location.h" 10 #include "base/location.h"
(...skipping 6363 matching lines...) Expand 10 before | Expand all | Expand 10 after
6374 // that this works correctly and the output surface is destroyed on 6374 // that this works correctly and the output surface is destroyed on
6375 // the correct thread. 6375 // the correct thread.
6376 EndTest(); 6376 EndTest();
6377 } 6377 }
6378 6378
6379 void AfterTest() override {} 6379 void AfterTest() override {}
6380 }; 6380 };
6381 6381
6382 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); 6382 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
6383 6383
6384 // Makes sure that painted_device_scale_factor is propagated to the
6385 // frame's metadata.
6386 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
6387 protected:
6388 void BeginTest() override {
6389 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f);
6390 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor());
6391 PostSetNeedsCommitToMainThread();
6392 }
6393
6394 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
6395 EXPECT_EQ(2.0f,
6396 output_surface()->last_sent_frame().metadata.device_scale_factor);
6397 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor());
6398 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor());
6399 EndTest();
6400 }
6401
6402 void AfterTest() override {}
6403 };
6404
6405 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6406
6384 } // namespace 6407 } // namespace
6385 } // namespace cc 6408 } // namespace cc
OLDNEW
« 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