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

Unified Diff: cc/layers/layer.cc

Issue 16903005: Add layer name into frame viewer (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase code 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 side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698