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_impl.h" | 5 #include "cc/trees/layer_tree_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/animation/keyframed_animation_curve.h" | 8 #include "cc/animation/keyframed_animation_curve.h" |
9 #include "cc/animation/scrollbar_animation_controller.h" | 9 #include "cc/animation/scrollbar_animation_controller.h" |
10 #include "cc/debug/traced_value.h" | 10 #include "cc/debug/traced_value.h" |
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 | 558 |
559 void LayerTreeImpl::WillModifyTilePriorities() { | 559 void LayerTreeImpl::WillModifyTilePriorities() { |
560 layer_tree_host_impl_->SetNeedsManageTiles(); | 560 layer_tree_host_impl_->SetNeedsManageTiles(); |
561 } | 561 } |
562 | 562 |
563 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) { | 563 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) { |
564 // Only the active tree needs to know about layers with copy requests, as | 564 // Only the active tree needs to know about layers with copy requests, as |
565 // they are aborted if not serviced during draw. | 565 // they are aborted if not serviced during draw. |
566 DCHECK(IsActiveTree()); | 566 DCHECK(IsActiveTree()); |
567 | 567 |
568 DCHECK(std::find(layers_with_copy_output_request_.begin(), | 568 if (std::find(layers_with_copy_output_request_.begin(), |
569 layers_with_copy_output_request_.end(), | 569 layers_with_copy_output_request_.end(), |
570 layer) == layers_with_copy_output_request_.end()); | 570 layer) != layers_with_copy_output_request_.end()) |
| 571 return; |
571 layers_with_copy_output_request_.push_back(layer); | 572 layers_with_copy_output_request_.push_back(layer); |
572 } | 573 } |
573 | 574 |
574 void LayerTreeImpl::RemoveLayerWithCopyOutputRequest(LayerImpl* layer) { | 575 void LayerTreeImpl::RemoveLayerWithCopyOutputRequest(LayerImpl* layer) { |
575 // Only the active tree needs to know about layers with copy requests, as | 576 // Only the active tree needs to know about layers with copy requests, as |
576 // they are aborted if not serviced during draw. | 577 // they are aborted if not serviced during draw. |
577 DCHECK(IsActiveTree()); | 578 DCHECK(IsActiveTree()); |
578 | 579 |
579 std::vector<LayerImpl*>::iterator it = std::find( | 580 std::vector<LayerImpl*>::iterator it = std::find( |
580 layers_with_copy_output_request_.begin(), | 581 layers_with_copy_output_request_.begin(), |
581 layers_with_copy_output_request_.end(), | 582 layers_with_copy_output_request_.end(), |
582 layer); | 583 layer); |
583 DCHECK(it != layers_with_copy_output_request_.end()); | 584 DCHECK(it != layers_with_copy_output_request_.end()); |
584 if (it != layers_with_copy_output_request_.end()) | 585 if (it != layers_with_copy_output_request_.end()) |
585 layers_with_copy_output_request_.erase(it); | 586 layers_with_copy_output_request_.erase(it); |
586 } | 587 } |
587 | 588 |
588 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() | 589 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() |
589 const { | 590 const { |
590 // Only the active tree needs to know about layers with copy requests, as | 591 // Only the active tree needs to know about layers with copy requests, as |
591 // they are aborted if not serviced during draw. | 592 // they are aborted if not serviced during draw. |
592 DCHECK(IsActiveTree()); | 593 DCHECK(IsActiveTree()); |
593 | 594 |
594 return layers_with_copy_output_request_; | 595 return layers_with_copy_output_request_; |
595 } | 596 } |
596 | 597 |
597 } // namespace cc | 598 } // namespace cc |
OLD | NEW |