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

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

Issue 265883013: cc: Add a flag to layers that returns true if the layer is in RSLL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « 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/animation/scrollbar_animation_controller_linear_fade.h" 10 #include "cc/animation/scrollbar_animation_controller_linear_fade.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 page_scale_delta_(1), 90 page_scale_delta_(1),
91 sent_page_scale_delta_(1), 91 sent_page_scale_delta_(1),
92 min_page_scale_factor_(0), 92 min_page_scale_factor_(0),
93 max_page_scale_factor_(0), 93 max_page_scale_factor_(0),
94 scrolling_layer_id_from_previous_tree_(0), 94 scrolling_layer_id_from_previous_tree_(0),
95 contents_textures_purged_(false), 95 contents_textures_purged_(false),
96 requires_high_res_to_draw_(false), 96 requires_high_res_to_draw_(false),
97 viewport_size_invalid_(false), 97 viewport_size_invalid_(false),
98 needs_update_draw_properties_(true), 98 needs_update_draw_properties_(true),
99 needs_full_tree_sync_(true), 99 needs_full_tree_sync_(true),
100 next_activation_forces_redraw_(false) {} 100 next_activation_forces_redraw_(false),
101 calculate_draw_properties_count_(0u) {
vmpstr 2014/05/02 23:06:27 There is a SourceAnimationFrameNumber, which happe
102 }
101 103
102 LayerTreeImpl::~LayerTreeImpl() { 104 LayerTreeImpl::~LayerTreeImpl() {
103 // Need to explicitly clear the tree prior to destroying this so that 105 // Need to explicitly clear the tree prior to destroying this so that
104 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. 106 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor.
105 DCHECK(!root_layer_); 107 DCHECK(!root_layer_);
106 DCHECK(layers_with_copy_output_request_.empty()); 108 DCHECK(layers_with_copy_output_request_.empty());
107 } 109 }
108 110
109 void LayerTreeImpl::Shutdown() { root_layer_.reset(); } 111 void LayerTreeImpl::Shutdown() { root_layer_.reset(); }
110 112
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 TRACE_EVENT2("cc", 452 TRACE_EVENT2("cc",
451 "LayerTreeImpl::UpdateDrawProperties", 453 "LayerTreeImpl::UpdateDrawProperties",
452 "IsActive", 454 "IsActive",
453 IsActiveTree(), 455 IsActiveTree(),
454 "SourceFrameNumber", 456 "SourceFrameNumber",
455 source_frame_number_); 457 source_frame_number_);
456 LayerImpl* page_scale_layer = 458 LayerImpl* page_scale_layer =
457 page_scale_layer_ ? page_scale_layer_ : InnerViewportContainerLayer(); 459 page_scale_layer_ ? page_scale_layer_ : InnerViewportContainerLayer();
458 bool can_render_to_separate_surface = 460 bool can_render_to_separate_surface =
459 !output_surface()->ForcedDrawToSoftwareDevice(); 461 !output_surface()->ForcedDrawToSoftwareDevice();
462 ++calculate_draw_properties_count_;
460 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( 463 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs(
461 root_layer(), 464 root_layer(),
462 DrawViewportSize(), 465 DrawViewportSize(),
463 layer_tree_host_impl_->DrawTransform(), 466 layer_tree_host_impl_->DrawTransform(),
464 device_scale_factor(), 467 device_scale_factor(),
465 total_page_scale_factor(), 468 total_page_scale_factor(),
466 page_scale_layer, 469 page_scale_layer,
467 MaxTextureSize(), 470 MaxTextureSize(),
468 settings().can_use_lcd_text, 471 settings().can_use_lcd_text,
469 can_render_to_separate_surface, 472 can_render_to_separate_surface,
(...skipping 13 matching lines...) Expand all
483 // UpdateTilePriorities on layers that will be visible (and thus have valid 486 // UpdateTilePriorities on layers that will be visible (and thus have valid
484 // draw properties) and not because any ordering is required. 487 // draw properties) and not because any ordering is required.
485 typedef LayerIterator<LayerImpl> LayerIteratorType; 488 typedef LayerIterator<LayerImpl> LayerIteratorType;
486 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); 489 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
487 for (LayerIteratorType it = 490 for (LayerIteratorType it =
488 LayerIteratorType::Begin(&render_surface_layer_list_); 491 LayerIteratorType::Begin(&render_surface_layer_list_);
489 it != end; 492 it != end;
490 ++it) { 493 ++it) {
491 if (!it.represents_itself()) 494 if (!it.represents_itself())
492 continue; 495 continue;
496
493 LayerImpl* layer = *it; 497 LayerImpl* layer = *it;
498 layer->draw_properties().last_render_surface_list_membership_index =
vmpstr 2014/05/02 23:06:27 I suspect this should happen in LayerTreeHostCommo
danakj 2014/05/02 23:09:24 Right, the output of CalcDrawProps is the RSLL. If
499 calculate_draw_properties_count_;
494 500
495 layer->UpdateTilePriorities(); 501 layer->UpdateTilePriorities();
496 if (layer->mask_layer()) 502 if (layer->mask_layer()) {
503 layer->mask_layer()
504 ->draw_properties()
505 .last_render_surface_list_membership_index =
506 calculate_draw_properties_count_;
497 layer->mask_layer()->UpdateTilePriorities(); 507 layer->mask_layer()->UpdateTilePriorities();
498 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) 508 }
509 if (layer->replica_layer() && layer->replica_layer()->mask_layer()) {
510 layer->replica_layer()
511 ->mask_layer()
512 ->draw_properties()
513 .last_render_surface_list_membership_index =
514 calculate_draw_properties_count_;
499 layer->replica_layer()->mask_layer()->UpdateTilePriorities(); 515 layer->replica_layer()->mask_layer()->UpdateTilePriorities();
516 }
500 } 517 }
501 } 518 }
502 519
503 DCHECK(!needs_update_draw_properties_) << 520 DCHECK(!needs_update_draw_properties_) <<
504 "CalcDrawProperties should not set_needs_update_draw_properties()"; 521 "CalcDrawProperties should not set_needs_update_draw_properties()";
505 } 522 }
506 523
507 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const { 524 const LayerImplList& LayerTreeImpl::RenderSurfaceLayerList() const {
508 // If this assert triggers, then the list is dirty. 525 // If this assert triggers, then the list is dirty.
509 DCHECK(!needs_update_draw_properties_); 526 DCHECK(!needs_update_draw_properties_);
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() 995 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest()
979 const { 996 const {
980 // Only the active tree needs to know about layers with copy requests, as 997 // Only the active tree needs to know about layers with copy requests, as
981 // they are aborted if not serviced during draw. 998 // they are aborted if not serviced during draw.
982 DCHECK(IsActiveTree()); 999 DCHECK(IsActiveTree());
983 1000
984 return layers_with_copy_output_request_; 1001 return layers_with_copy_output_request_;
985 } 1002 }
986 1003
987 } // namespace cc 1004 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698