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

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
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 <limits>
8
7 #include "base/debug/trace_event.h" 9 #include "base/debug/trace_event.h"
8 #include "cc/animation/keyframed_animation_curve.h" 10 #include "cc/animation/keyframed_animation_curve.h"
9 #include "cc/animation/scrollbar_animation_controller.h" 11 #include "cc/animation/scrollbar_animation_controller.h"
10 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" 12 #include "cc/animation/scrollbar_animation_controller_linear_fade.h"
11 #include "cc/animation/scrollbar_animation_controller_thinning.h" 13 #include "cc/animation/scrollbar_animation_controller_thinning.h"
12 #include "cc/base/math_util.h" 14 #include "cc/base/math_util.h"
13 #include "cc/base/util.h" 15 #include "cc/base/util.h"
14 #include "cc/debug/traced_value.h" 16 #include "cc/debug/traced_value.h"
15 #include "cc/layers/heads_up_display_layer_impl.h" 17 #include "cc/layers/heads_up_display_layer_impl.h"
16 #include "cc/layers/layer.h" 18 #include "cc/layers/layer.h"
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 page_scale_delta_(1), 92 page_scale_delta_(1),
91 sent_page_scale_delta_(1), 93 sent_page_scale_delta_(1),
92 min_page_scale_factor_(0), 94 min_page_scale_factor_(0),
93 max_page_scale_factor_(0), 95 max_page_scale_factor_(0),
94 scrolling_layer_id_from_previous_tree_(0), 96 scrolling_layer_id_from_previous_tree_(0),
95 contents_textures_purged_(false), 97 contents_textures_purged_(false),
96 requires_high_res_to_draw_(false), 98 requires_high_res_to_draw_(false),
97 viewport_size_invalid_(false), 99 viewport_size_invalid_(false),
98 needs_update_draw_properties_(true), 100 needs_update_draw_properties_(true),
99 needs_full_tree_sync_(true), 101 needs_full_tree_sync_(true),
100 next_activation_forces_redraw_(false) {} 102 next_activation_forces_redraw_(false),
103 render_surface_layer_list_id_(0) {
104 }
101 105
102 LayerTreeImpl::~LayerTreeImpl() { 106 LayerTreeImpl::~LayerTreeImpl() {
103 // Need to explicitly clear the tree prior to destroying this so that 107 // Need to explicitly clear the tree prior to destroying this so that
104 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor. 108 // the LayerTreeImpl pointer is still valid in the LayerImpl dtor.
105 DCHECK(!root_layer_); 109 DCHECK(!root_layer_);
106 DCHECK(layers_with_copy_output_request_.empty()); 110 DCHECK(layers_with_copy_output_request_.empty());
107 } 111 }
108 112
109 void LayerTreeImpl::Shutdown() { root_layer_.reset(); } 113 void LayerTreeImpl::Shutdown() { root_layer_.reset(); }
110 114
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
450 TRACE_EVENT2("cc", 454 TRACE_EVENT2("cc",
451 "LayerTreeImpl::UpdateDrawProperties", 455 "LayerTreeImpl::UpdateDrawProperties",
452 "IsActive", 456 "IsActive",
453 IsActiveTree(), 457 IsActiveTree(),
454 "SourceFrameNumber", 458 "SourceFrameNumber",
455 source_frame_number_); 459 source_frame_number_);
456 LayerImpl* page_scale_layer = 460 LayerImpl* page_scale_layer =
457 page_scale_layer_ ? page_scale_layer_ : InnerViewportContainerLayer(); 461 page_scale_layer_ ? page_scale_layer_ : InnerViewportContainerLayer();
458 bool can_render_to_separate_surface = 462 bool can_render_to_separate_surface =
459 !output_surface()->ForcedDrawToSoftwareDevice(); 463 !output_surface()->ForcedDrawToSoftwareDevice();
464
465 ++render_surface_layer_list_id_;
460 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs( 466 LayerTreeHostCommon::CalcDrawPropsImplInputs inputs(
461 root_layer(), 467 root_layer(),
462 DrawViewportSize(), 468 DrawViewportSize(),
463 layer_tree_host_impl_->DrawTransform(), 469 layer_tree_host_impl_->DrawTransform(),
464 device_scale_factor(), 470 device_scale_factor(),
465 total_page_scale_factor(), 471 total_page_scale_factor(),
466 page_scale_layer, 472 page_scale_layer,
467 MaxTextureSize(), 473 MaxTextureSize(),
468 settings().can_use_lcd_text, 474 settings().can_use_lcd_text,
469 can_render_to_separate_surface, 475 can_render_to_separate_surface,
470 settings().layer_transforms_should_scale_layer_contents, 476 settings().layer_transforms_should_scale_layer_contents,
471 &render_surface_layer_list_); 477 &render_surface_layer_list_,
478 render_surface_layer_list_id_);
472 LayerTreeHostCommon::CalculateDrawProperties(&inputs); 479 LayerTreeHostCommon::CalculateDrawProperties(&inputs);
473 } 480 }
474 481
475 { 482 {
476 TRACE_EVENT2("cc", 483 TRACE_EVENT2("cc",
477 "LayerTreeImpl::UpdateTilePriorities", 484 "LayerTreeImpl::UpdateTilePriorities",
478 "IsActive", 485 "IsActive",
479 IsActiveTree(), 486 IsActiveTree(),
480 "SourceFrameNumber", 487 "SourceFrameNumber",
481 source_frame_number_); 488 source_frame_number_);
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after
978 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() 985 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest()
979 const { 986 const {
980 // Only the active tree needs to know about layers with copy requests, as 987 // Only the active tree needs to know about layers with copy requests, as
981 // they are aborted if not serviced during draw. 988 // they are aborted if not serviced during draw.
982 DCHECK(IsActiveTree()); 989 DCHECK(IsActiveTree());
983 990
984 return layers_with_copy_output_request_; 991 return layers_with_copy_output_request_;
985 } 992 }
986 993
987 } // namespace cc 994 } // namespace cc
OLDNEW
« cc/trees/layer_tree_host_common.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