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

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

Issue 180243014: Revert "Revert 253606 "Revert 251238 "cc: Clean up iterator template to ..."" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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_host_impl.cc ('k') | cc/trees/occlusion_tracker_perftest.cc » ('j') | 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/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after
475 { 475 {
476 TRACE_EVENT2("cc", 476 TRACE_EVENT2("cc",
477 "LayerTreeImpl::UpdateTilePriorities", 477 "LayerTreeImpl::UpdateTilePriorities",
478 "IsActive", 478 "IsActive",
479 IsActiveTree(), 479 IsActiveTree(),
480 "SourceFrameNumber", 480 "SourceFrameNumber",
481 source_frame_number_); 481 source_frame_number_);
482 // LayerIterator is used here instead of CallFunctionForSubtree to only 482 // LayerIterator is used here instead of CallFunctionForSubtree to only
483 // UpdateTilePriorities on layers that will be visible (and thus have valid 483 // UpdateTilePriorities on layers that will be visible (and thus have valid
484 // draw properties) and not because any ordering is required. 484 // draw properties) and not because any ordering is required.
485 typedef LayerIterator<LayerImpl> LayerIteratorType; 485 typedef LayerIterator<LayerImpl,
486 LayerImplList,
487 RenderSurfaceImpl,
488 LayerIteratorActions::FrontToBack> 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;
493 LayerImpl* layer = *it; 496 LayerImpl* layer = *it;
494 497
495 layer->UpdateTilePriorities(); 498 layer->UpdateTilePriorities();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 } 732 }
730 733
731 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { 734 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const {
732 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 735 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
733 TracedValue::MakeDictIntoImplicitSnapshot( 736 TracedValue::MakeDictIntoImplicitSnapshot(
734 state.get(), "cc::LayerTreeImpl", this); 737 state.get(), "cc::LayerTreeImpl", this);
735 738
736 state->Set("root_layer", root_layer_->AsValue().release()); 739 state->Set("root_layer", root_layer_->AsValue().release());
737 740
738 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); 741 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue());
739 typedef LayerIterator<LayerImpl> LayerIteratorType; 742 typedef LayerIterator<LayerImpl,
743 LayerImplList,
744 RenderSurfaceImpl,
745 LayerIteratorActions::FrontToBack> LayerIteratorType;
740 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); 746 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
741 for (LayerIteratorType it = LayerIteratorType::Begin( 747 for (LayerIteratorType it = LayerIteratorType::Begin(
742 &render_surface_layer_list_); it != end; ++it) { 748 &render_surface_layer_list_); it != end; ++it) {
743 if (!it.represents_itself()) 749 if (!it.represents_itself())
744 continue; 750 continue;
745 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); 751 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release());
746 } 752 }
747 753
748 state->Set("render_surface_layer_list", 754 state->Set("render_surface_layer_list",
749 render_surface_layer_list.release()); 755 render_surface_layer_list.release());
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() 989 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest()
984 const { 990 const {
985 // Only the active tree needs to know about layers with copy requests, as 991 // Only the active tree needs to know about layers with copy requests, as
986 // they are aborted if not serviced during draw. 992 // they are aborted if not serviced during draw.
987 DCHECK(IsActiveTree()); 993 DCHECK(IsActiveTree());
988 994
989 return layers_with_copy_output_request_; 995 return layers_with_copy_output_request_;
990 } 996 }
991 997
992 } // namespace cc 998 } // namespace cc
OLDNEW
« no previous file with comments | « cc/trees/layer_tree_host_impl.cc ('k') | cc/trees/occlusion_tracker_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698