Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: cc/trees/layer_tree_impl.cc

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Fixed nits and bugs, removed cruft, added test for Create/DeleteUIResource in LTHI Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
275 IsActiveTree() && 275 IsActiveTree() &&
276 RootScrollLayer()) { 276 RootScrollLayer()) {
277 UpdateSolidColorScrollbars(); 277 UpdateSolidColorScrollbars();
278 } 278 }
279 279
280 needs_update_draw_properties_ = false; 280 needs_update_draw_properties_ = false;
281 render_surface_layer_list_.clear(); 281 render_surface_layer_list_.clear();
282 282
283 // For max_texture_size. 283 // For max_texture_size.
284 if (!layer_tree_host_impl_->renderer()) 284 if (!layer_tree_host_impl_->renderer())
285 return; 285 return;
286 286
287 if (!root_layer()) 287 if (!root_layer())
288 return; 288 return;
289 289
290 { 290 {
291 TRACE_EVENT2("cc", 291 TRACE_EVENT2("cc",
292 "LayerTreeImpl::UpdateDrawProperties", 292 "LayerTreeImpl::UpdateDrawProperties",
293 "IsActive", 293 "IsActive",
294 IsActiveTree(), 294 IsActiveTree(),
295 "SourceFrameNumber", 295 "SourceFrameNumber",
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 continue; 522 continue;
523 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); 523 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release());
524 } 524 }
525 525
526 state->Set("render_surface_layer_list", 526 state->Set("render_surface_layer_list",
527 render_surface_layer_list.release()); 527 render_surface_layer_list.release());
528 return state.PassAs<base::Value>(); 528 return state.PassAs<base::Value>();
529 } 529 }
530 530
531 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( 531 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate(
532 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { 532 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) {
533 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate; 533 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate;
534 if (root_scroll_layer_) { 534 if (root_scroll_layer_) {
535 root_scroll_layer_->SetScrollOffsetDelegate( 535 root_scroll_layer_->SetScrollOffsetDelegate(
536 root_layer_scroll_offset_delegate_); 536 root_layer_scroll_offset_delegate_);
537 } 537 }
538 } 538 }
539 539
540 void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() { 540 void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() {
541 LayerImpl* root_scroll = RootScrollLayer(); 541 LayerImpl* root_scroll = RootScrollLayer();
542 LayerImpl* root_container = RootContainerLayer(); 542 LayerImpl* root_container = RootContainerLayer();
(...skipping 22 matching lines...) Expand all
565 } 565 }
566 566
567 void LayerTreeImpl::ClearLatencyInfo() { 567 void LayerTreeImpl::ClearLatencyInfo() {
568 latency_info_.Clear(); 568 latency_info_.Clear();
569 } 569 }
570 570
571 void LayerTreeImpl::WillModifyTilePriorities() { 571 void LayerTreeImpl::WillModifyTilePriorities() {
572 layer_tree_host_impl_->SetNeedsManageTiles(); 572 layer_tree_host_impl_->SetNeedsManageTiles();
573 } 573 }
574 574
575 void LayerTreeImpl::set_ui_resource_request_queue(
576 const UIResourceRequestQueue& queue) {
577 ui_resource_request_queue_ = queue;
578 }
579
580 ResourceProvider::ResourceId LayerTreeImpl::ResourceIdForUIResource(
581 UIResourceId uid) const {
582 return layer_tree_host_impl_->ResourceIdForUIResource(uid);
583 }
584
585 void LayerTreeImpl::ProcessUIResourceRequestQueue() {
586 while (ui_resource_request_queue_.size() > 0) {
587 UIResourceRequest req = ui_resource_request_queue_.front();
588 ui_resource_request_queue_.pop_front();
589
590 switch (req.type) {
591 case UIResourceRequest::UIResourceCreate:
592 layer_tree_host_impl_->CreateUIResource(req.id, req.bitmap);
593 break;
594 case UIResourceRequest::UIResourceDelete:
595 layer_tree_host_impl_->DeleteUIResource(req.id);
596 break;
597 default:
598 NOTREACHED();
599 break;
600 }
601 }
602 }
603
575 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) { 604 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) {
576 // Only the active tree needs to know about layers with copy requests, as 605 // Only the active tree needs to know about layers with copy requests, as
577 // they are aborted if not serviced during draw. 606 // they are aborted if not serviced during draw.
578 DCHECK(IsActiveTree()); 607 DCHECK(IsActiveTree());
579 608
580 DCHECK(std::find(layers_with_copy_output_request_.begin(), 609 DCHECK(std::find(layers_with_copy_output_request_.begin(),
581 layers_with_copy_output_request_.end(), 610 layers_with_copy_output_request_.end(),
582 layer) == layers_with_copy_output_request_.end()); 611 layer) == layers_with_copy_output_request_.end());
583 layers_with_copy_output_request_.push_back(layer); 612 layers_with_copy_output_request_.push_back(layer);
584 } 613 }
(...skipping 14 matching lines...) Expand all
599 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() 628 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest()
600 const { 629 const {
601 // Only the active tree needs to know about layers with copy requests, as 630 // Only the active tree needs to know about layers with copy requests, as
602 // they are aborted if not serviced during draw. 631 // they are aborted if not serviced during draw.
603 DCHECK(IsActiveTree()); 632 DCHECK(IsActiveTree());
604 633
605 return layers_with_copy_output_request_; 634 return layers_with_copy_output_request_;
606 } 635 }
607 636
608 } // namespace cc 637 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_impl.cc ('K') | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698