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

Side by Side Diff: cc/trees/layer_tree_host_unittest.cc

Issue 2096493002: Make cc::CompositorFrames movable [Part 1 of 2] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed Dana's nits Created 4 years, 6 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 unified diff | Download patch
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 <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 6644 matching lines...) Expand 10 before | Expand all | Expand 10 after
6655 // frame's metadata. 6655 // frame's metadata.
6656 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest { 6656 class LayerTreeHostTestPaintedDeviceScaleFactor : public LayerTreeHostTest {
6657 protected: 6657 protected:
6658 void BeginTest() override { 6658 void BeginTest() override {
6659 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f); 6659 layer_tree_host()->SetPaintedDeviceScaleFactor(2.0f);
6660 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor()); 6660 EXPECT_EQ(1.0f, layer_tree_host()->device_scale_factor());
6661 PostSetNeedsCommitToMainThread(); 6661 PostSetNeedsCommitToMainThread();
6662 } 6662 }
6663 6663
6664 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override { 6664 void SwapBuffersOnThread(LayerTreeHostImpl* host_impl, bool result) override {
6665 EXPECT_EQ(2.0f, 6665 EXPECT_EQ(
6666 output_surface()->last_sent_frame().metadata.device_scale_factor); 6666 2.0f,
6667 output_surface()->last_sent_frame()->metadata.device_scale_factor);
6667 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor()); 6668 EXPECT_EQ(2.0f, host_impl->active_tree()->painted_device_scale_factor());
6668 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor()); 6669 EXPECT_EQ(1.0f, host_impl->active_tree()->device_scale_factor());
6669 EndTest(); 6670 EndTest();
6670 } 6671 }
6671 6672
6672 void AfterTest() override {} 6673 void AfterTest() override {}
6673 }; 6674 };
6674 6675
6675 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor); 6676 SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestPaintedDeviceScaleFactor);
6676 6677
6677 } // namespace 6678 } // namespace
6678 } // namespace cc 6679 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl_unittest.cc ('k') | components/mus/public/cpp/lib/output_surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698