Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(287)

Side by Side Diff: cc/layers/layer_impl.cc

Issue 16903005: Add layer name into frame viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: pulling name when tracing Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698