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 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1070 | 1070 |
1071 if (reasons & kCompositingReasonLayerForMask) | 1071 if (reasons & kCompositingReasonLayerForMask) |
1072 reason_list->AppendString("Is a mask layer"); | 1072 reason_list->AppendString("Is a mask layer"); |
1073 | 1073 |
1074 return reason_list.PassAs<base::Value>(); | 1074 return reason_list.PassAs<base::Value>(); |
1075 } | 1075 } |
1076 | 1076 |
1077 void LayerImpl::AsValueInto(base::DictionaryValue* state) const { | 1077 void LayerImpl::AsValueInto(base::DictionaryValue* state) const { |
1078 TracedValue::MakeDictIntoImplicitSnapshot(state, LayerTypeAsString(), this); | 1078 TracedValue::MakeDictIntoImplicitSnapshot(state, LayerTypeAsString(), this); |
1079 state->SetInteger("layer_id", id()); | 1079 state->SetInteger("layer_id", id()); |
1080 #ifndef NDEBUG | |
enne (OOO)
2013/07/03 17:40:43
Can you remove the #ifdefs?
qiankun
2013/07/04 04:34:04
OK.
| |
1081 state->SetString("layer_name", debug_name()); | |
1082 #endif | |
1080 state->Set("bounds", MathUtil::AsValue(bounds()).release()); | 1083 state->Set("bounds", MathUtil::AsValue(bounds()).release()); |
1081 state->SetInteger("draws_content", DrawsContent()); | 1084 state->SetInteger("draws_content", DrawsContent()); |
1082 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 1085 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
1083 state->Set("compositing_reasons", | 1086 state->Set("compositing_reasons", |
1084 CompositingReasonsAsValue(compositing_reasons_).release()); | 1087 CompositingReasonsAsValue(compositing_reasons_).release()); |
1085 | 1088 |
1086 bool clipped; | 1089 bool clipped; |
1087 gfx::QuadF layer_quad = MathUtil::MapQuad( | 1090 gfx::QuadF layer_quad = MathUtil::MapQuad( |
1088 screen_space_transform(), | 1091 screen_space_transform(), |
1089 gfx::QuadF(gfx::Rect(content_bounds())), | 1092 gfx::QuadF(gfx::Rect(content_bounds())), |
(...skipping 13 matching lines...) Expand all Loading... | |
1103 | 1106 |
1104 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 1107 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
1105 | 1108 |
1106 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1109 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1107 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1110 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1108 AsValueInto(state.get()); | 1111 AsValueInto(state.get()); |
1109 return state.PassAs<base::Value>(); | 1112 return state.PassAs<base::Value>(); |
1110 } | 1113 } |
1111 | 1114 |
1112 } // namespace cc | 1115 } // namespace cc |
OLD | NEW |