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 | |
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
-rw-r--r-- | ui/gfx/render_text.cc | 10 | ||||
-rw-r--r-- | ui/gfx/render_text_linux.cc | 7 | ||||
-rw-r--r-- | ui/views/controls/textfield/native_textfield_views.cc | 2 |
3 files changed, 17 insertions, 2 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()) { diff --git a/ui/gfx/render_text_linux.cc b/ui/gfx/render_text_linux.cc index dc4b951..0232143 100644 --- a/ui/gfx/render_text_linux.cc +++ b/ui/gfx/render_text_linux.cc @@ -8,6 +8,7 @@ #include <algorithm> #include <vector> +#include "base/debug/trace_event.h" #include "base/i18n/break_iterator.h" #include "base/logging.h" #include "ui/gfx/canvas_skia.h" @@ -268,6 +269,7 @@ void RenderTextLinux::EnsureLayout() { } void RenderTextLinux::DrawVisualText(Canvas* canvas) { + TRACE_EVENT0("gfx", "RenderTextLinux::DrawVisualText"); DCHECK(layout_); Point offset(GetOriginForSkiaDrawing()); @@ -315,7 +317,10 @@ void RenderTextLinux::DrawVisualText(Canvas* canvas) { PangoFontDescription* native_font = pango_font_describe(run->item->analysis.font); - renderer.SetFont(gfx::Font(native_font)); + { + TRACE_EVENT0("gfx", "RenderTextLinux::DrawVisualText SetFont"); + renderer.SetFont(gfx::Font(native_font)); + } pango_font_description_free(native_font); SkScalar glyph_x = x; diff --git a/ui/views/controls/textfield/native_textfield_views.cc b/ui/views/controls/textfield/native_textfield_views.cc index 0791cef..677c458 100644 --- a/ui/views/controls/textfield/native_textfield_views.cc +++ b/ui/views/controls/textfield/native_textfield_views.cc @@ -8,6 +8,7 @@ #include "base/bind.h" #include "base/command_line.h" +#include "base/debug/trace_event.h" #include "base/logging.h" #include "base/message_loop.h" #include "base/utf_string_conversions.h" @@ -802,6 +803,7 @@ void NativeTextfieldViews::RepaintCursor() { } void NativeTextfieldViews::PaintTextAndCursor(gfx::Canvas* canvas) { + TRACE_EVENT0("views", "NativeTextfieldViews::PaintTextAndCursor"); canvas->Save(); GetRenderText()->set_cursor_visible(is_drop_cursor_visible_ || (is_cursor_visible_ && !model_->HasSelection())); |