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

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

Issue 156603005: cc: Clean up iterator template to only take 1 parameter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: iteratorcleanup: 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 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
472 { 472 {
473 TRACE_EVENT2("cc", 473 TRACE_EVENT2("cc",
474 "LayerTreeImpl::UpdateTilePriorities", 474 "LayerTreeImpl::UpdateTilePriorities",
475 "IsActive", 475 "IsActive",
476 IsActiveTree(), 476 IsActiveTree(),
477 "SourceFrameNumber", 477 "SourceFrameNumber",
478 source_frame_number_); 478 source_frame_number_);
479 // LayerIterator is used here instead of CallFunctionForSubtree to only 479 // LayerIterator is used here instead of CallFunctionForSubtree to only
480 // UpdateTilePriorities on layers that will be visible (and thus have valid 480 // UpdateTilePriorities on layers that will be visible (and thus have valid
481 // draw properties) and not because any ordering is required. 481 // draw properties) and not because any ordering is required.
482 typedef LayerIterator<LayerImpl, 482 typedef LayerIterator<LayerImpl> LayerIteratorType;
483 LayerImplList,
484 RenderSurfaceImpl,
485 LayerIteratorActions::FrontToBack> LayerIteratorType;
486 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); 483 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
487 for (LayerIteratorType it = 484 for (LayerIteratorType it =
488 LayerIteratorType::Begin(&render_surface_layer_list_); 485 LayerIteratorType::Begin(&render_surface_layer_list_);
489 it != end; 486 it != end;
490 ++it) { 487 ++it) {
491 if (!it.represents_itself()) 488 if (!it.represents_itself())
492 continue; 489 continue;
493 LayerImpl* layer = *it; 490 LayerImpl* layer = *it;
494 491
495 layer->UpdateTilePriorities(); 492 layer->UpdateTilePriorities();
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
729 } 726 }
730 727
731 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { 728 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const {
732 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); 729 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue());
733 TracedValue::MakeDictIntoImplicitSnapshot( 730 TracedValue::MakeDictIntoImplicitSnapshot(
734 state.get(), "cc::LayerTreeImpl", this); 731 state.get(), "cc::LayerTreeImpl", this);
735 732
736 state->Set("root_layer", root_layer_->AsValue().release()); 733 state->Set("root_layer", root_layer_->AsValue().release());
737 734
738 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); 735 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue());
739 typedef LayerIterator<LayerImpl, 736 typedef LayerIterator<LayerImpl> LayerIteratorType;
740 LayerImplList,
741 RenderSurfaceImpl,
742 LayerIteratorActions::FrontToBack> LayerIteratorType;
743 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); 737 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_);
744 for (LayerIteratorType it = LayerIteratorType::Begin( 738 for (LayerIteratorType it = LayerIteratorType::Begin(
745 &render_surface_layer_list_); it != end; ++it) { 739 &render_surface_layer_list_); it != end; ++it) {
746 if (!it.represents_itself()) 740 if (!it.represents_itself())
747 continue; 741 continue;
748 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); 742 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release());
749 } 743 }
750 744
751 state->Set("render_surface_layer_list", 745 state->Set("render_surface_layer_list",
752 render_surface_layer_list.release()); 746 render_surface_layer_list.release());
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() 957 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest()
964 const { 958 const {
965 // Only the active tree needs to know about layers with copy requests, as 959 // Only the active tree needs to know about layers with copy requests, as
966 // they are aborted if not serviced during draw. 960 // they are aborted if not serviced during draw.
967 DCHECK(IsActiveTree()); 961 DCHECK(IsActiveTree());
968 962
969 return layers_with_copy_output_request_; 963 return layers_with_copy_output_request_;
970 } 964 }
971 965
972 } // namespace cc 966 } // 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