Index: cc/layers/layer.cc |
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc |
index dd150e38598fbe6c739644929154ebf8d83d8e13..107f9b5cc2b531e66fd9051e6a556228cbc9ab8c 100644 |
--- a/cc/layers/layer.cc |
+++ b/cc/layers/layer.cc |
@@ -6,6 +6,7 @@ |
#include <algorithm> |
+#include "base/debug/trace_event.h" |
#include "base/location.h" |
#include "base/metrics/histogram.h" |
#include "base/single_thread_task_runner.h" |
@@ -843,6 +844,12 @@ void Layer::SavePaintProperties() { |
bool Layer::Update(ResourceUpdateQueue* queue, |
const OcclusionTracker* occlusion) { |
+ bool is_tracing; |
enne (OOO)
2013/08/01 22:12:59
Could you do this during Layer::PushPropertiesTo i
qiankun
2013/08/02 17:50:26
Done.
|
+ TRACE_EVENT_CATEGORY_GROUP_ENABLED("cc", &is_tracing); |
+ if (is_tracing) |
+ SetDebugName(DebugName()); |
+ else |
+ SetDebugName(std::string()); |
return false; |
} |
@@ -855,6 +862,12 @@ void Layer::SetDebugName(const std::string& debug_name) { |
SetNeedsCommit(); |
} |
+std::string Layer::DebugName() { |
+ if (!client_) |
+ return std::string(); |
+ return client_->DebugName(); |
+} |
+ |
void Layer::SetCompositingReasons(CompositingReasons reasons) { |
compositing_reasons_ = reasons; |
} |