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

Unified Diff: views/view.cc

Issue 8440008: Add traces in compositor, views and skia (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: git try Created 9 years, 2 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
« no previous file with comments | « ui/gfx/compositor/layer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/view.cc
diff --git a/views/view.cc b/views/view.cc
index d9b744a81dba2abd40c6e46308c88b02936596f5..748ac34edac202bbdcf23afc47cc62e5a0a28c36 100644
--- a/views/view.cc
+++ b/views/view.cc
@@ -652,7 +652,7 @@ void View::SchedulePaintInRect(const gfx::Rect& rect) {
}
void View::Paint(gfx::Canvas* canvas) {
- TRACE_EVENT0("View", "Paint");
+ TRACE_EVENT0("views", "View::Paint");
ScopedCanvas scoped_canvas(canvas);
@@ -1044,30 +1044,44 @@ void View::NativeViewHierarchyChanged(bool attached,
// Painting --------------------------------------------------------------------
void View::PaintChildren(gfx::Canvas* canvas) {
+ TRACE_EVENT0("views", "View::PaintChildren");
for (int i = 0, count = child_count(); i < count; ++i)
if (!child_at(i)->layer())
child_at(i)->Paint(canvas);
}
void View::OnPaint(gfx::Canvas* canvas) {
+ TRACE_EVENT0("views", "View::OnPaint");
OnPaintBackground(canvas);
OnPaintFocusBorder(canvas);
OnPaintBorder(canvas);
}
void View::OnPaintBackground(gfx::Canvas* canvas) {
- if (background_.get())
+ if (background_.get()) {
+ TRACE_EVENT2("views", "View::OnPaintBackground",
+ "width", canvas->GetSkCanvas()->getDevice()->width(),
+ "height", canvas->GetSkCanvas()->getDevice()->height());
background_->Paint(canvas, this);
+ }
}
void View::OnPaintBorder(gfx::Canvas* canvas) {
- if (border_.get())
+ if (border_.get()) {
+ TRACE_EVENT2("views", "View::OnPaintBorder",
+ "width", canvas->GetSkCanvas()->getDevice()->width(),
+ "height", canvas->GetSkCanvas()->getDevice()->height());
border_->Paint(*this, canvas);
+ }
}
void View::OnPaintFocusBorder(gfx::Canvas* canvas) {
- if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus())
+ if ((IsFocusable() || IsAccessibilityFocusableInRootView()) && HasFocus()) {
+ TRACE_EVENT2("views", "views::OnPaintFocusBorder",
+ "width", canvas->GetSkCanvas()->getDevice()->width(),
+ "height", canvas->GetSkCanvas()->getDevice()->height());
canvas->DrawFocusRect(GetLocalBounds());
+ }
}
// Accelerated Painting --------------------------------------------------------
« no previous file with comments | « ui/gfx/compositor/layer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698