OLD | NEW |
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/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
(...skipping 4736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4747 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( | 4747 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( |
4748 new SimpleSwapPromiseMonitor(layer_tree_host(), | 4748 new SimpleSwapPromiseMonitor(layer_tree_host(), |
4749 NULL, | 4749 NULL, |
4750 &set_needs_commit_count, | 4750 &set_needs_commit_count, |
4751 &set_needs_redraw_count)); | 4751 &set_needs_redraw_count)); |
4752 layer_tree_host()->SetNeedsUpdateLayers(); | 4752 layer_tree_host()->SetNeedsUpdateLayers(); |
4753 EXPECT_EQ(2, set_needs_commit_count); | 4753 EXPECT_EQ(2, set_needs_commit_count); |
4754 EXPECT_EQ(0, set_needs_redraw_count); | 4754 EXPECT_EQ(0, set_needs_redraw_count); |
4755 } | 4755 } |
4756 | 4756 |
4757 { | |
4758 scoped_ptr<SimpleSwapPromiseMonitor> swap_promise_monitor( | |
4759 new SimpleSwapPromiseMonitor(layer_tree_host(), | |
4760 NULL, | |
4761 &set_needs_commit_count, | |
4762 &set_needs_redraw_count)); | |
4763 layer_tree_host()->SetNeedsAnimate(); | |
4764 EXPECT_EQ(3, set_needs_commit_count); | |
4765 EXPECT_EQ(0, set_needs_redraw_count); | |
4766 } | |
4767 | |
4768 EndTest(); | 4757 EndTest(); |
4769 } | 4758 } |
4770 | 4759 |
4771 virtual void AfterTest() OVERRIDE {} | 4760 virtual void AfterTest() OVERRIDE {} |
4772 }; | 4761 }; |
4773 | 4762 |
4774 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); | 4763 MULTI_THREAD_TEST_F(LayerTreeHostTestSimpleSwapPromiseMonitor); |
4775 | 4764 |
4776 } // namespace cc | 4765 } // namespace cc |
OLD | NEW |