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

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: 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
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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 IsActiveTree() && 284 IsActiveTree() &&
285 RootScrollLayer()) { 285 RootScrollLayer()) {
286 UpdateSolidColorScrollbars(); 286 UpdateSolidColorScrollbars();
287 } 287 }
288 288
289 needs_update_draw_properties_ = false; 289 needs_update_draw_properties_ = false;
290 render_surface_layer_list_.clear(); 290 render_surface_layer_list_.clear();
291 291
292 // For max_texture_size. 292 // For max_texture_size.
293 if (!layer_tree_host_impl_->renderer()) 293 if (!layer_tree_host_impl_->renderer())
294 return; 294 return;
295 295
296 if (!root_layer()) 296 if (!root_layer())
297 return; 297 return;
298 298
299 { 299 {
300 TRACE_EVENT2("cc", 300 TRACE_EVENT2("cc",
301 "LayerTreeImpl::UpdateDrawProperties", 301 "LayerTreeImpl::UpdateDrawProperties",
302 "IsActive", 302 "IsActive",
303 IsActiveTree(), 303 IsActiveTree(),
304 "SourceFrameNumber", 304 "SourceFrameNumber",
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 continue; 531 continue;
532 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); 532 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release());
533 } 533 }
534 534
535 state->Set("render_surface_layer_list", 535 state->Set("render_surface_layer_list",
536 render_surface_layer_list.release()); 536 render_surface_layer_list.release());
537 return state.PassAs<base::Value>(); 537 return state.PassAs<base::Value>();
538 } 538 }
539 539
540 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( 540 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate(
541 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { 541 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) {
542 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate; 542 root_layer_scroll_offset_delegate_ = root_layer_scroll_offset_delegate;
543 if (root_scroll_layer_) { 543 if (root_scroll_layer_) {
544 root_scroll_layer_->SetScrollOffsetDelegate( 544 root_scroll_layer_->SetScrollOffsetDelegate(
545 root_layer_scroll_offset_delegate_); 545 root_layer_scroll_offset_delegate_);
546 } 546 }
547 } 547 }
548 548
549 void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() { 549 void LayerTreeImpl::UpdateRootScrollLayerSizeDelta() {
550 LayerImpl* root_scroll = RootScrollLayer(); 550 LayerImpl* root_scroll = RootScrollLayer();
551 LayerImpl* root_container = RootContainerLayer(); 551 LayerImpl* root_container = RootContainerLayer();
(...skipping 22 matching lines...) Expand all
574 } 574 }
575 575
576 void LayerTreeImpl::ClearLatencyInfo() { 576 void LayerTreeImpl::ClearLatencyInfo() {
577 latency_info_.Clear(); 577 latency_info_.Clear();
578 } 578 }
579 579
580 void LayerTreeImpl::WillModifyTilePriorities() { 580 void LayerTreeImpl::WillModifyTilePriorities() {
581 layer_tree_host_impl_->SetNeedsManageTiles(); 581 layer_tree_host_impl_->SetNeedsManageTiles();
582 } 582 }
583 583
584 void LayerTreeImpl::set_ui_resource_request_queue(
585 const UIResourceRequestQueue& queue) {
586 ui_resource_request_queue_ = queue;
587 }
588
589 ResourceProvider::ResourceId LayerTreeImpl::ResourceIdForUIResource(
590 UIResourceId uid) const {
591 return layer_tree_host_impl_->ResourceIdForUIResource(uid);
592 }
593
594 void LayerTreeImpl::ProcessUIResourceRequestQueue() {
595 while (ui_resource_request_queue_.size() > 0) {
596 UIResourceRequest req = ui_resource_request_queue_.front();
597 ui_resource_request_queue_.pop_front();
598
599 switch (req.type) {
600 case UIResourceCreate:
601 layer_tree_host_impl_->CreateUIResource(req.id, req.bitmap);
602 break;
603 case UIResourceDelete:
604 layer_tree_host_impl_->DeleteUIResource(req.id);
605 break;
606 default:
607 NOTREACHED();
608 break;
609 }
610 }
611 }
612
584 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) { 613 void LayerTreeImpl::AddLayerWithCopyOutputRequest(LayerImpl* layer) {
585 // Only the active tree needs to know about layers with copy requests, as 614 // Only the active tree needs to know about layers with copy requests, as
586 // they are aborted if not serviced during draw. 615 // they are aborted if not serviced during draw.
587 DCHECK(IsActiveTree()); 616 DCHECK(IsActiveTree());
588 617
589 DCHECK(std::find(layers_with_copy_output_request_.begin(), 618 DCHECK(std::find(layers_with_copy_output_request_.begin(),
590 layers_with_copy_output_request_.end(), 619 layers_with_copy_output_request_.end(),
591 layer) == layers_with_copy_output_request_.end()); 620 layer) == layers_with_copy_output_request_.end());
592 layers_with_copy_output_request_.push_back(layer); 621 layers_with_copy_output_request_.push_back(layer);
593 } 622 }
(...skipping 14 matching lines...) Expand all
608 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest() 637 const std::vector<LayerImpl*> LayerTreeImpl::LayersWithCopyOutputRequest()
609 const { 638 const {
610 // Only the active tree needs to know about layers with copy requests, as 639 // Only the active tree needs to know about layers with copy requests, as
611 // they are aborted if not serviced during draw. 640 // they are aborted if not serviced during draw.
612 DCHECK(IsActiveTree()); 641 DCHECK(IsActiveTree());
613 642
614 return layers_with_copy_output_request_; 643 return layers_with_copy_output_request_;
615 } 644 }
616 645
617 } // namespace cc 646 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_unittest.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