OLD | NEW |
---|---|
1 // Copyright 2010 The Chromium Authors. All rights reserved. | 1 // Copyright 2010 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/layers/layer.h" | 5 #include "cc/layers/layer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 911 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
922 | 922 |
923 layer_animation_controller_->PushAnimationUpdatesTo( | 923 layer_animation_controller_->PushAnimationUpdatesTo( |
924 layer->layer_animation_controller()); | 924 layer->layer_animation_controller()); |
925 | 925 |
926 // Reset any state that should be cleared for the next update. | 926 // Reset any state that should be cleared for the next update. |
927 stacking_order_changed_ = false; | 927 stacking_order_changed_ = false; |
928 update_rect_ = gfx::RectF(); | 928 update_rect_ = gfx::RectF(); |
929 | 929 |
930 needs_push_properties_ = false; | 930 needs_push_properties_ = false; |
931 num_dependents_need_push_properties_ = 0; | 931 num_dependents_need_push_properties_ = 0; |
932 | |
933 layer->SetDebugInfo(debug_info_); | |
enne (OOO)
2013/11/25 20:16:45
ConvertableToTraceFormat is not thread-safe refcou
chrishtr_gmail.com
2013/11/25 22:48:25
Good catch. I'll try the approach we discussed off
chrishtr_gmail.com
2013/11/26 21:49:04
Updated to not store the debug_Info_ object at all
| |
932 } | 934 } |
933 | 935 |
934 scoped_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 936 scoped_ptr<LayerImpl> Layer::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
935 return LayerImpl::Create(tree_impl, layer_id_); | 937 return LayerImpl::Create(tree_impl, layer_id_); |
936 } | 938 } |
937 | 939 |
938 bool Layer::DrawsContent() const { | 940 bool Layer::DrawsContent() const { |
939 return is_drawable_; | 941 return is_drawable_; |
940 } | 942 } |
941 | 943 |
942 void Layer::SavePaintProperties() { | 944 void Layer::SavePaintProperties() { |
943 DCHECK(layer_tree_host_); | 945 DCHECK(layer_tree_host_); |
944 | 946 |
945 // TODO(reveman): Save all layer properties that we depend on not | 947 // TODO(reveman): Save all layer properties that we depend on not |
946 // changing until PushProperties() has been called. crbug.com/231016 | 948 // changing until PushProperties() has been called. crbug.com/231016 |
947 paint_properties_.bounds = bounds_; | 949 paint_properties_.bounds = bounds_; |
948 paint_properties_.source_frame_number = | 950 paint_properties_.source_frame_number = |
949 layer_tree_host_->source_frame_number(); | 951 layer_tree_host_->source_frame_number(); |
950 } | 952 } |
951 | 953 |
952 bool Layer::Update(ResourceUpdateQueue* queue, | 954 bool Layer::Update(ResourceUpdateQueue* queue, |
953 const OcclusionTracker* occlusion) { | 955 const OcclusionTracker* occlusion) { |
954 DCHECK(layer_tree_host_); | 956 DCHECK(layer_tree_host_); |
955 DCHECK_EQ(layer_tree_host_->source_frame_number(), | 957 DCHECK_EQ(layer_tree_host_->source_frame_number(), |
956 paint_properties_.source_frame_number) << | 958 paint_properties_.source_frame_number) << |
957 "SavePaintProperties must be called for any layer that is painted."; | 959 "SavePaintProperties must be called for any layer that is painted."; |
958 return false; | 960 return false; |
959 } | 961 } |
960 | 962 |
963 void Layer::SetDebugInfo(base::debug::ConvertableToTraceFormat* debug_info) { | |
964 debug_info_ = debug_info; | |
965 } | |
966 | |
961 bool Layer::NeedMoreUpdates() { | 967 bool Layer::NeedMoreUpdates() { |
962 return false; | 968 return false; |
963 } | 969 } |
964 | 970 |
965 std::string Layer::DebugName() { | 971 std::string Layer::DebugName() { |
966 return client_ ? client_->DebugName() : std::string(); | 972 return client_ ? client_->DebugName() : std::string(); |
967 } | 973 } |
968 | 974 |
969 void Layer::SetCompositingReasons(CompositingReasons reasons) { | 975 void Layer::SetCompositingReasons(CompositingReasons reasons) { |
970 compositing_reasons_ = reasons; | 976 compositing_reasons_ = reasons; |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1090 clip_parent_->RemoveClipChild(this); | 1096 clip_parent_->RemoveClipChild(this); |
1091 | 1097 |
1092 clip_parent_ = NULL; | 1098 clip_parent_ = NULL; |
1093 } | 1099 } |
1094 | 1100 |
1095 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { | 1101 void Layer::RunMicroBenchmark(MicroBenchmark* benchmark) { |
1096 benchmark->RunOnLayer(this); | 1102 benchmark->RunOnLayer(this); |
1097 } | 1103 } |
1098 | 1104 |
1099 } // namespace cc | 1105 } // namespace cc |
OLD | NEW |