diff options
author | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 05:57:53 +0000 |
---|---|---|
committer | piman@chromium.org <piman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-12-14 05:57:53 +0000 |
commit | 592a7adf75c1ad54c34229db642775dedeeab339 (patch) | |
tree | b9c443d8edfb24cbb2fff410c08c8c6910c25baf /ui/gfx/render_text.cc | |
parent | 75c7f909b2fa6f008996fb56d1fabe6087d60b06 (diff) | |
download | chromium_src-592a7adf75c1ad54c34229db642775dedeeab339.zip chromium_src-592a7adf75c1ad54c34229db642775dedeeab339.tar.gz chromium_src-592a7adf75c1ad54c34229db642775dedeeab339.tar.bz2 |
Add traces in text code
BUG=None
TEST=about:tracing
Review URL: http://codereview.chromium.org/8895020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@114366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text.cc')
-rw-r--r-- | ui/gfx/render_text.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc index e4427d2..fc7faa8 100644 --- a/ui/gfx/render_text.cc +++ b/ui/gfx/render_text.cc @@ -6,6 +6,7 @@ #include <algorithm> +#include "base/debug/trace_event.h" #include "base/i18n/break_iterator.h" #include "base/logging.h" #include "base/stl_util.h" @@ -421,9 +422,14 @@ int RenderText::GetStringWidth() { } void RenderText::Draw(Canvas* canvas) { - EnsureLayout(); + TRACE_EVENT0("gfx", "RenderText::Draw"); + { + TRACE_EVENT0("gfx", "RenderText::EnsureLayout"); + EnsureLayout(); + } if (!text().empty()) { + TRACE_EVENT0("gfx", "RenderText::Draw draw text"); DrawSelection(canvas); DrawVisualText(canvas); } @@ -686,6 +692,7 @@ void RenderText::UpdateCachedBoundsAndOffset() { } void RenderText::DrawSelection(Canvas* canvas) { + TRACE_EVENT0("gfx", "RenderText::DrawSelection"); std::vector<Rect> sel; GetSubstringBounds(GetSelectionStart(), GetCursorPosition(), &sel); SkColor color = focused() ? kFocusedSelectionColor : kUnfocusedSelectionColor; @@ -694,6 +701,7 @@ void RenderText::DrawSelection(Canvas* canvas) { } void RenderText::DrawCursor(Canvas* canvas) { + TRACE_EVENT0("gfx", "RenderText::DrawCursor"); // Paint cursor. Replace cursor is drawn as rectangle for now. // TODO(msw): Draw a better cursor with a better indication of association. if (cursor_visible() && focused()) { |