| OLD | NEW |
| 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 { | 471 { |
| 472 TRACE_EVENT2("cc", | 472 TRACE_EVENT2("cc", |
| 473 "LayerTreeImpl::UpdateTilePriorities", | 473 "LayerTreeImpl::UpdateTilePriorities", |
| 474 "IsActive", | 474 "IsActive", |
| 475 IsActiveTree(), | 475 IsActiveTree(), |
| 476 "SourceFrameNumber", | 476 "SourceFrameNumber", |
| 477 source_frame_number_); | 477 source_frame_number_); |
| 478 // LayerIterator is used here instead of CallFunctionForSubtree to only | 478 // LayerIterator is used here instead of CallFunctionForSubtree to only |
| 479 // UpdateTilePriorities on layers that will be visible (and thus have valid | 479 // UpdateTilePriorities on layers that will be visible (and thus have valid |
| 480 // draw properties) and not because any ordering is required. | 480 // draw properties) and not because any ordering is required. |
| 481 typedef LayerIterator<LayerImpl, | 481 typedef LayerIterator<LayerImpl> LayerIteratorType; |
| 482 LayerImplList, | |
| 483 RenderSurfaceImpl, | |
| 484 LayerIteratorActions::FrontToBack> LayerIteratorType; | |
| 485 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 482 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
| 486 for (LayerIteratorType it = | 483 for (LayerIteratorType it = |
| 487 LayerIteratorType::Begin(&render_surface_layer_list_); | 484 LayerIteratorType::Begin(&render_surface_layer_list_); |
| 488 it != end; | 485 it != end; |
| 489 ++it) { | 486 ++it) { |
| 490 if (!it.represents_itself()) | 487 if (!it.represents_itself()) |
| 491 continue; | 488 continue; |
| 492 LayerImpl* layer = *it; | 489 LayerImpl* layer = *it; |
| 493 | 490 |
| 494 layer->UpdateTilePriorities(); | 491 layer->UpdateTilePriorities(); |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 728 } | 725 } |
| 729 | 726 |
| 730 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { | 727 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { |
| 731 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 728 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 732 TracedValue::MakeDictIntoImplicitSnapshot( | 729 TracedValue::MakeDictIntoImplicitSnapshot( |
| 733 state.get(), "cc::LayerTreeImpl", this); | 730 state.get(), "cc::LayerTreeImpl", this); |
| 734 | 731 |
| 735 state->Set("root_layer", root_layer_->AsValue().release()); | 732 state->Set("root_layer", root_layer_->AsValue().release()); |
| 736 | 733 |
| 737 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); | 734 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); |
| 738 typedef LayerIterator<LayerImpl, | 735 typedef LayerIterator<LayerImpl> LayerIteratorType; |
| 739 LayerImplList, | |
| 740 RenderSurfaceImpl, | |
| 741 LayerIteratorActions::FrontToBack> LayerIteratorType; | |
| 742 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 736 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
| 743 for (LayerIteratorType it = LayerIteratorType::Begin( | 737 for (LayerIteratorType it = LayerIteratorType::Begin( |
| 744 &render_surface_layer_list_); it != end; ++it) { | 738 &render_surface_layer_list_); it != end; ++it) { |
| 745 if (!it.represents_itself()) | 739 if (!it.represents_itself()) |
| 746 continue; | 740 continue; |
| 747 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); | 741 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); |
| 748 } | 742 } |
| 749 | 743 |
| 750 state->Set("render_surface_layer_list", | 744 state->Set("render_surface_layer_list", |
| 751 render_surface_layer_list.release()); | 745 render_surface_layer_list.release()); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 983 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() | 977 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() |
| 984 const { | 978 const { |
| 985 // Only the active tree needs to know about layers with copy requests, as | 979 // Only the active tree needs to know about layers with copy requests, as |
| 986 // they are aborted if not serviced during draw. | 980 // they are aborted if not serviced during draw. |
| 987 DCHECK(IsActiveTree()); | 981 DCHECK(IsActiveTree()); |
| 988 | 982 |
| 989 return layers_with_copy_output_request_; | 983 return layers_with_copy_output_request_; |
| 990 } | 984 } |
| 991 | 985 |
| 992 } // namespace cc | 986 } // namespace cc |
| OLD | NEW |