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

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 6360 matching lines...) Expand 10 before | Expand all | Expand 10 after
6371 // that this works correctly and the output surface is destroyed on 6371 // that this works correctly and the output surface is destroyed on
6372 // the correct thread. 6372 // the correct thread.
6373 EndTest(); 6373 EndTest();
6374 } 6374 }
6375 6375
6376 void AfterTest() override {} 6376 void AfterTest() override {}
6377 }; 6377 };
6378 6378
6379 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface); 6379 MULTI_THREAD_TEST_F(LayerTreeHostTestDestroyWhileInitializingOutputSurface);
6380 6380
6381 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
6382 class PaintedScaleSwapPromise : public SwapPromise {
6383 public:
6384 PaintedScaleSwapPromise() {}
6385 ~PaintedScaleSwapPromise() override {}
6386 void DidActivate() override {}
6387 void DidSwap(CompositorFrameMetadata* metadata) override {
6388 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.
6389 }
6390 void DidNotSwap(DidNotSwapReason reason) override {}
6391 int64 TraceId() const override { return 0; }
6392 };
6393
6394 protected:
6395 void BeginTest() override {
6396 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f);
6397 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor());
6398 PostSetNeedsCommitToMainThread();
6399 }
6400
6401 void CommitCompleteOnThread(LayerTreeHostImpl* host_impl) override {
6402 int frame = host_impl->active_tree()->source_frame_number();
6403 if (frame == -1) {
6404 host_impl->active_tree()->QueuePinnedSwapPromise(
6405 make_scoped_ptr(new PaintedScaleSwapPromise()));
6406 }
6407 }
6408
6409 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
6410 EndTest();
6411 }
6412
6413 void AfterTest() override {}
6414 };
6415
6416 MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6417
6381 } // namespace 6418 } // namespace
6382 } // namespace cc 6419 } // 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