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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/scrollbar_animation_controller.h" | 10 #include "cc/animation/scrollbar_animation_controller.h" |
(...skipping 1097 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1108 | 1108 |
1109 if (reasons & kCompositingReasonLayerForMask) | 1109 if (reasons & kCompositingReasonLayerForMask) |
1110 reason_list->AppendString("Is a mask layer"); | 1110 reason_list->AppendString("Is a mask layer"); |
1111 | 1111 |
1112 return reason_list.PassAs<base::Value>(); | 1112 return reason_list.PassAs<base::Value>(); |
1113 } | 1113 } |
1114 | 1114 |
1115 void LayerImpl::AsValueInto(base::DictionaryValue* state) const { | 1115 void LayerImpl::AsValueInto(base::DictionaryValue* state) const { |
1116 TracedValue::MakeDictIntoImplicitSnapshot(state, LayerTypeAsString(), this); | 1116 TracedValue::MakeDictIntoImplicitSnapshot(state, LayerTypeAsString(), this); |
1117 state->SetInteger("layer_id", id()); | 1117 state->SetInteger("layer_id", id()); |
| 1118 state->SetString("layer_name", debug_name()); |
1118 state->Set("bounds", MathUtil::AsValue(bounds()).release()); | 1119 state->Set("bounds", MathUtil::AsValue(bounds()).release()); |
1119 state->SetInteger("draws_content", DrawsContent()); | 1120 state->SetInteger("draws_content", DrawsContent()); |
1120 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 1121 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
1121 state->Set("compositing_reasons", | 1122 state->Set("compositing_reasons", |
1122 CompositingReasonsAsValue(compositing_reasons_).release()); | 1123 CompositingReasonsAsValue(compositing_reasons_).release()); |
1123 | 1124 |
1124 bool clipped; | 1125 bool clipped; |
1125 gfx::QuadF layer_quad = MathUtil::MapQuad( | 1126 gfx::QuadF layer_quad = MathUtil::MapQuad( |
1126 screen_space_transform(), | 1127 screen_space_transform(), |
1127 gfx::QuadF(gfx::Rect(content_bounds())), | 1128 gfx::QuadF(gfx::Rect(content_bounds())), |
(...skipping 13 matching lines...) Expand all Loading... |
1141 | 1142 |
1142 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 1143 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
1143 | 1144 |
1144 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1145 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1145 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1146 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1146 AsValueInto(state.get()); | 1147 AsValueInto(state.get()); |
1147 return state.PassAs<base::Value>(); | 1148 return state.PassAs<base::Value>(); |
1148 } | 1149 } |
1149 | 1150 |
1150 } // namespace cc | 1151 } // namespace cc |
OLD | NEW |