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 3369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3380 | 3380 |
3381 virtual void DidCommitAndDrawFrame() override { | 3381 virtual void DidCommitAndDrawFrame() override { |
3382 switch (layer_tree_host()->source_frame_number()) { | 3382 switch (layer_tree_host()->source_frame_number()) { |
3383 case 0: | 3383 case 0: |
3384 break; | 3384 break; |
3385 case 1: { | 3385 case 1: { |
3386 // During update, the ignore_set_needs_commit_ bit is set to true to | 3386 // During update, the ignore_set_needs_commit_ bit is set to true to |
3387 // avoid causing a second commit to be scheduled. If a property change | 3387 // avoid causing a second commit to be scheduled. If a property change |
3388 // is made during this, however, it needs to be pushed in the upcoming | 3388 // is made during this, however, it needs to be pushed in the upcoming |
3389 // commit. | 3389 // commit. |
3390 scoped_ptr<base::AutoReset<bool> > ignore = | 3390 scoped_ptr<base::AutoReset<bool>> ignore = |
3391 scrollbar_layer_->IgnoreSetNeedsCommit(); | 3391 scrollbar_layer_->IgnoreSetNeedsCommit(); |
3392 | 3392 |
3393 scrollbar_layer_->SetBounds(gfx::Size(30, 30)); | 3393 scrollbar_layer_->SetBounds(gfx::Size(30, 30)); |
3394 | 3394 |
3395 EXPECT_TRUE(scrollbar_layer_->needs_push_properties()); | 3395 EXPECT_TRUE(scrollbar_layer_->needs_push_properties()); |
3396 EXPECT_TRUE(root_->descendant_needs_push_properties()); | 3396 EXPECT_TRUE(root_->descendant_needs_push_properties()); |
3397 layer_tree_host()->SetNeedsCommit(); | 3397 layer_tree_host()->SetNeedsCommit(); |
3398 | 3398 |
3399 scrollbar_layer_->reset_push_properties_count(); | 3399 scrollbar_layer_->reset_push_properties_count(); |
3400 EXPECT_EQ(0u, scrollbar_layer_->push_properties_count()); | 3400 EXPECT_EQ(0u, scrollbar_layer_->push_properties_count()); |
(...skipping 1763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5164 } | 5164 } |
5165 | 5165 |
5166 int commit_count_; | 5166 int commit_count_; |
5167 TestSwapPromiseResult swap_promise_result_[3]; | 5167 TestSwapPromiseResult swap_promise_result_[3]; |
5168 }; | 5168 }; |
5169 | 5169 |
5170 // Impl-side painting is not supported for synchronous compositing. | 5170 // Impl-side painting is not supported for synchronous compositing. |
5171 SINGLE_THREAD_NOIMPL_TEST_F(LayerTreeHostTestSynchronousCompositeSwapPromise); | 5171 SINGLE_THREAD_NOIMPL_TEST_F(LayerTreeHostTestSynchronousCompositeSwapPromise); |
5172 | 5172 |
5173 } // namespace cc | 5173 } // namespace cc |
OLD | NEW |