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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
347 } | 347 } |
348 | 348 |
349 bool LayerImpl::AreVisibleResourcesReady() const { | 349 bool LayerImpl::AreVisibleResourcesReady() const { |
350 return true; | 350 return true; |
351 } | 351 } |
352 | 352 |
353 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) { | 353 scoped_ptr<LayerImpl> LayerImpl::CreateLayerImpl(LayerTreeImpl* tree_impl) { |
354 return LayerImpl::Create(tree_impl, layer_id_); | 354 return LayerImpl::Create(tree_impl, layer_id_); |
355 } | 355 } |
356 | 356 |
357 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { | 357 void LayerImpl::PushPropertiesTo(LayerImpl* layer) { |
enne (OOO)
2013/07/09 20:15:32
I suspect you need to push the name here too.
qiankun
2013/07/10 04:53:07
Isn't the name pushed here: "layer->SetDebugName(d
enne (OOO)
2013/07/10 16:48:42
Oh, quite right! I missed that entirely.
| |
358 layer->SetAnchorPoint(anchor_point_); | 358 layer->SetAnchorPoint(anchor_point_); |
359 layer->SetAnchorPointZ(anchor_point_z_); | 359 layer->SetAnchorPointZ(anchor_point_z_); |
360 layer->SetBackgroundColor(background_color_); | 360 layer->SetBackgroundColor(background_color_); |
361 layer->SetBounds(bounds_); | 361 layer->SetBounds(bounds_); |
362 layer->SetContentBounds(content_bounds()); | 362 layer->SetContentBounds(content_bounds()); |
363 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); | 363 layer->SetContentsScale(contents_scale_x(), contents_scale_y()); |
364 layer->SetDebugName(debug_name_); | 364 layer->SetDebugName(debug_name_); |
365 layer->SetCompositingReasons(compositing_reasons_); | 365 layer->SetCompositingReasons(compositing_reasons_); |
366 layer->SetDoubleSided(double_sided_); | 366 layer->SetDoubleSided(double_sided_); |
367 layer->SetDrawCheckerboardForMissingTiles( | 367 layer->SetDrawCheckerboardForMissingTiles( |
(...skipping 702 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 state->SetString("layer_name", debug_name()); | |
1080 state->Set("bounds", MathUtil::AsValue(bounds()).release()); | 1081 state->Set("bounds", MathUtil::AsValue(bounds()).release()); |
1081 state->SetInteger("draws_content", DrawsContent()); | 1082 state->SetInteger("draws_content", DrawsContent()); |
1082 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); | 1083 state->SetInteger("gpu_memory_usage", GPUMemoryUsageInBytes()); |
1083 state->Set("compositing_reasons", | 1084 state->Set("compositing_reasons", |
1084 CompositingReasonsAsValue(compositing_reasons_).release()); | 1085 CompositingReasonsAsValue(compositing_reasons_).release()); |
1085 | 1086 |
1086 bool clipped; | 1087 bool clipped; |
1087 gfx::QuadF layer_quad = MathUtil::MapQuad( | 1088 gfx::QuadF layer_quad = MathUtil::MapQuad( |
1088 screen_space_transform(), | 1089 screen_space_transform(), |
1089 gfx::QuadF(gfx::Rect(content_bounds())), | 1090 gfx::QuadF(gfx::Rect(content_bounds())), |
(...skipping 13 matching lines...) Expand all Loading... | |
1103 | 1104 |
1104 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 1105 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
1105 | 1106 |
1106 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1107 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1107 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1108 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1108 AsValueInto(state.get()); | 1109 AsValueInto(state.get()); |
1109 return state.PassAs<base::Value>(); | 1110 return state.PassAs<base::Value>(); |
1110 } | 1111 } |
1111 | 1112 |
1112 } // namespace cc | 1113 } // namespace cc |
OLD | NEW |