| 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/test/layer_tree_test.h" | 5 #include "cc/test/layer_tree_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/location.h" | 8 #include "base/location.h" |
| 9 #include "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 base::BindOnce(&LayerTreeHostImplForTesting::NotifyReadyToActivate, | 223 base::BindOnce(&LayerTreeHostImplForTesting::NotifyReadyToActivate, |
| 224 base::Unretained(this))); | 224 base::Unretained(this))); |
| 225 notify_ready_to_activate_was_blocked_ = false; | 225 notify_ready_to_activate_was_blocked_ = false; |
| 226 } | 226 } |
| 227 } | 227 } |
| 228 | 228 |
| 229 void BlockImplSideInvalidationRequestsForTesting(bool block) override { | 229 void BlockImplSideInvalidationRequestsForTesting(bool block) override { |
| 230 block_impl_side_invalidation_ = block; | 230 block_impl_side_invalidation_ = block; |
| 231 if (!block_impl_side_invalidation_ && impl_side_invalidation_was_blocked_) { | 231 if (!block_impl_side_invalidation_ && impl_side_invalidation_was_blocked_) { |
| 232 RequestImplSideInvalidation(); | 232 RequestImplSideInvalidation(); |
| 233 impl_side_invalidation_was_blocked_ = false; |
| 233 } | 234 } |
| 234 } | 235 } |
| 235 | 236 |
| 236 void ActivateSyncTree() override { | 237 void ActivateSyncTree() override { |
| 237 test_hooks_->WillActivateTreeOnThread(this); | 238 test_hooks_->WillActivateTreeOnThread(this); |
| 238 LayerTreeHostImpl::ActivateSyncTree(); | 239 LayerTreeHostImpl::ActivateSyncTree(); |
| 239 DCHECK(!pending_tree()); | 240 DCHECK(!pending_tree()); |
| 240 test_hooks_->DidActivateTreeOnThread(this); | 241 test_hooks_->DidActivateTreeOnThread(this); |
| 241 } | 242 } |
| 242 | 243 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 LayerTreeHostImpl::NotifyTileStateChanged(tile); | 275 LayerTreeHostImpl::NotifyTileStateChanged(tile); |
| 275 test_hooks_->NotifyTileStateChangedOnThread(this, tile); | 276 test_hooks_->NotifyTileStateChangedOnThread(this, tile); |
| 276 } | 277 } |
| 277 | 278 |
| 278 void InvalidateContentOnImplSide() override { | 279 void InvalidateContentOnImplSide() override { |
| 279 LayerTreeHostImpl::InvalidateContentOnImplSide(); | 280 LayerTreeHostImpl::InvalidateContentOnImplSide(); |
| 280 test_hooks_->DidInvalidateContentOnImplSide(this); | 281 test_hooks_->DidInvalidateContentOnImplSide(this); |
| 281 } | 282 } |
| 282 | 283 |
| 283 void RequestImplSideInvalidation() override { | 284 void RequestImplSideInvalidation() override { |
| 285 test_hooks_->DidReceiveImplSideInvalidationRequest(this); |
| 284 if (block_impl_side_invalidation_) { | 286 if (block_impl_side_invalidation_) { |
| 285 impl_side_invalidation_was_blocked_ = true; | 287 impl_side_invalidation_was_blocked_ = true; |
| 286 return; | 288 return; |
| 287 } | 289 } |
| 288 | 290 |
| 289 impl_side_invalidation_was_blocked_ = false; | 291 impl_side_invalidation_was_blocked_ = false; |
| 290 LayerTreeHostImpl::RequestImplSideInvalidation(); | 292 LayerTreeHostImpl::RequestImplSideInvalidation(); |
| 291 test_hooks_->DidRequestImplSideInvalidation(this); | 293 test_hooks_->DidRequestImplSideInvalidation(this); |
| 292 } | 294 } |
| 293 | 295 |
| (...skipping 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 917 DCHECK(task_runner_provider()->IsMainThread() || | 919 DCHECK(task_runner_provider()->IsMainThread() || |
| 918 task_runner_provider()->IsMainThreadBlocked()); | 920 task_runner_provider()->IsMainThreadBlocked()); |
| 919 return layer_tree_host_.get(); | 921 return layer_tree_host_.get(); |
| 920 } | 922 } |
| 921 | 923 |
| 922 Proxy* LayerTreeTest::proxy() { | 924 Proxy* LayerTreeTest::proxy() { |
| 923 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; | 925 return layer_tree_host() ? layer_tree_host()->proxy() : NULL; |
| 924 } | 926 } |
| 925 | 927 |
| 926 } // namespace cc | 928 } // namespace cc |
| OLD | NEW |