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

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, 5 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.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 254 matching lines...) Expand 10 before | Expand all | Expand 10 after
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",
286 source_frame_number_); 286 source_frame_number_);
287 LayerTreeHostCommon::CalculateDrawProperties( 287 LayerTreeHostCommon::CalculateDrawProperties(
288 root_layer(), 288 root_layer(),
289 layer_tree_host_impl_->DeviceViewport().size(), 289 layer_tree_host_impl_->DeviceViewport().size(),
290 layer_tree_host_impl_->DeviceTransform(), 290 layer_tree_host_impl_->DeviceTransform(),
291 device_scale_factor(), 291 device_scale_factor(),
292 total_page_scale_factor(), 292 total_page_scale_factor(),
293 root_scroll_layer_ ? root_scroll_layer_->parent() : NULL, 293 root_scroll_layer_ ? root_scroll_layer_->parent() : NULL,
294 MaxTextureSize(), 294 MaxTextureSize(),
295 settings().can_use_lcd_text, 295 settings().can_use_lcd_text,
296 settings().layer_transforms_should_scale_layer_contents, 296 settings().layer_transforms_should_scale_layer_contents,
297 &render_surface_layer_list_); 297 &render_surface_layer_list_);
298 } 298 }
299 299
300 DCHECK(!needs_update_draw_properties_) << 300 DCHECK(!needs_update_draw_properties_) <<
301 "CalcDrawProperties should not set_needs_update_draw_properties()"; 301 "CalcdrawProperties should not set_needs_update_draw_properties()";
302 } 302 }
303 303
304 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { 304 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const {
305 // If this assert triggers, then the list is dirty. 305 // If this assert triggers, then the list is dirty.
306 DCHECK(!needs_update_draw_properties_); 306 DCHECK(!needs_update_draw_properties_);
307 return render_surface_layer_list_; 307 return render_surface_layer_list_;
308 } 308 }
309 309
310 gfx::Size LayerTreeImpl::ScrollableSize() const { 310 gfx::Size LayerTreeImpl::ScrollableSize() const {
311 if (!root_scroll_layer_ || root_scroll_layer_->children().empty()) 311 if (!root_scroll_layer_ || root_scroll_layer_->children().empty())
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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
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
OLDNEW
« cc/trees/layer_tree_host.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