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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 IsActiveTree() && | 265 IsActiveTree() && |
266 RootScrollLayer()) { | 266 RootScrollLayer()) { |
267 UpdateSolidColorScrollbars(); | 267 UpdateSolidColorScrollbars(); |
268 } | 268 } |
269 | 269 |
270 needs_update_draw_properties_ = false; | 270 needs_update_draw_properties_ = false; |
271 render_surface_layer_list_.clear(); | 271 render_surface_layer_list_.clear(); |
272 | 272 |
273 // For max_texture_size. | 273 // For max_texture_size. |
274 if (!layer_tree_host_impl_->renderer()) | 274 if (!layer_tree_host_impl_->renderer()) |
275 return; | 275 return; |
276 | 276 |
277 if (!root_layer()) | 277 if (!root_layer()) |
278 return; | 278 return; |
279 | 279 |
280 { | 280 { |
281 TRACE_EVENT2("cc", | 281 TRACE_EVENT2("cc", |
282 "LayerTreeImpl::UpdateDrawProperties", | 282 "LayerTreeImpl::UpdateDrawProperties", |
283 "IsActive", | 283 "IsActive", |
284 IsActiveTree(), | 284 IsActiveTree(), |
285 "SourceFrameNumber", | 285 "SourceFrameNumber", |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 continue; | 510 continue; |
511 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); | 511 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); |
512 } | 512 } |
513 | 513 |
514 state->Set("render_surface_layer_list", | 514 state->Set("render_surface_layer_list", |
515 render_surface_layer_list.release()); | 515 render_surface_layer_list.release()); |
516 return state.PassAs<base::Value>(); | 516 return state.PassAs<base::Value>(); |
517 } | 517 } |
518 | 518 |
519 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( | 519 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( |
520 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { | 520 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { |
521 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate; | 521 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate; |
522 if (root_scroll_layer_) { | 522 if (root_scroll_layer_) { |
523 root_scroll_layer_->SetScrollOffsetDelegate( | 523 root_scroll_layer_->SetScrollOffsetDelegate( |
524 root_layer_scroll_offset_delegate_); | 524 root_layer_scroll_offset_delegate_); |
525 } | 525 } |
526 } | 526 } |
527 | 527 |
528 void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() { | 528 void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() { |
529 LayerImpl* root_scroll = RootScrollLayer(); | 529 LayerImpl* root_scroll = RootScrollLayer(); |
530 LayerImpl* root_container = RootContainerLayer(); | 530 LayerImpl* root_container = RootContainerLayer(); |
(...skipping 22 matching lines...) Expand all Loading... |
553 } | 553 } |
554 | 554 |
555 void LayerTreeImpl::ClearLatencyInfo() { | 555 void LayerTreeImpl::ClearLatencyInfo() { |
556 latency_info_.Clear(); | 556 latency_info_.Clear(); |
557 } | 557 } |
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::set_ui_resource_request_queue( |
| 564 const UIResourceRequestQueue& queue) { |
| 565 ui_resource_request_queue_ = queue; |
| 566 } |
| 567 |
| 568 ResourceProvider::ResourceId LayerTreeImpl::ResourceIdForUIResource( |
| 569 UIResourceId uid) const { |
| 570 return layer_tree_host_impl_->ResourceIdForUIResource(uid); |
| 571 } |
| 572 |
| 573 void LayerTreeImpl::ProcessUIResourceRequestQueue() { |
| 574 while (ui_resource_request_queue_.size() > 0) { |
| 575 UIResourceRequest req = ui_resource_request_queue_.front(); |
| 576 ui_resource_request_queue_.pop_front(); |
| 577 |
| 578 switch (req.type) { |
| 579 case UIResourceCreate: |
| 580 layer_tree_host_impl_->CreateUIResource(req.id, req.bitmap); |
| 581 break; |
| 582 case UIResourceDelete: |
| 583 layer_tree_host_impl_->DeleteUIResource(req.id); |
| 584 break; |
| 585 } |
| 586 } |
| 587 } |
| 588 |
563 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) { | 589 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) { |
564 // Only the active tree needs to know about layers with copy requests, as | 590 // Only the active tree needs to know about layers with copy requests, as |
565 // they are aborted if not serviced during draw. | 591 // they are aborted if not serviced during draw. |
566 DCHECK(IsActiveTree()); | 592 DCHECK(IsActiveTree()); |
567 | 593 |
568 if (std::find(layers_with_copy_output_request_.begin(), | 594 if (std::find(layers_with_copy_output_request_.begin(), |
569 layers_with_copy_output_request_.end(), | 595 layers_with_copy_output_request_.end(), |
570 layer) != layers_with_copy_output_request_.end()) | 596 layer) != layers_with_copy_output_request_.end()) |
571 return; | 597 return; |
572 layers_with_copy_output_request_.push_back(layer); | 598 layers_with_copy_output_request_.push_back(layer); |
(...skipping 16 matching lines...) Expand all Loading... |
589 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() | 615 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() |
590 const { | 616 const { |
591 // Only the active tree needs to know about layers with copy requests, as | 617 // Only the active tree needs to know about layers with copy requests, as |
592 // they are aborted if not serviced during draw. | 618 // they are aborted if not serviced during draw. |
593 DCHECK(IsActiveTree()); | 619 DCHECK(IsActiveTree()); |
594 | 620 |
595 return layers_with_copy_output_request_; | 621 return layers_with_copy_output_request_; |
596 } | 622 } |
597 | 623 |
598 } // namespace cc | 624 } // namespace cc |
OLD | NEW |