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

Unified Diff: ui/gfx/render_text.cc

Issue 960203004: tracing for RenderTextMac::GetDisplayText() eliding goo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20150129-MacViews-Bringup5-RTHB-in-Label
Patch Set: fix upstream Created 5 years, 10 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/app_list/test/app_list_test_model.cc ('k') | ui/gfx/render_text_mac.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.cc
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index e395a6e006de38097ea3fe041de046c4c75ed810..ac0c7afffb25df4ded9a0b544f991932937deb7d 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -531,6 +531,7 @@ void RenderText::SetElideBehavior(ElideBehavior elide_behavior) {
}
void RenderText::SetDisplayRect(const Rect& r) {
+ DLOG(INFO) << "in SetDisplayRect.";
if (r != display_rect_) {
display_rect_ = r;
baseline_ = kInvalidBaseline;
@@ -538,6 +539,7 @@ void RenderText::SetDisplayRect(const Rect& r) {
lines_.clear();
if (elide_behavior_ != NO_ELIDE &&
elide_behavior_ != FADE_TAIL) {
+ DLOG(INFO) << "via set display rect: " << GetDisplayText();
OnDisplayTextAttributeChanged();
}
}
@@ -751,6 +753,8 @@ int RenderText::GetBaseline() {
void RenderText::Draw(Canvas* canvas) {
EnsureLayout();
+ DLOG(INFO) << "Draw: " << GetDisplayText();
+
if (clip_to_display_rect()) {
Rect clip_rect(display_rect());
clip_rect.Inset(ShadowValue::GetMargin(shadows_));
@@ -1278,6 +1282,7 @@ base::string16 RenderText::Elide(const base::string16& text,
float text_width,
float available_width,
ElideBehavior behavior) {
+ DLOG(INFO) << "Elide: '" << text << "' " << text_width << ", " << available_width << ", " << behavior;
if (available_width <= 0 || text.empty())
return base::string16();
if (behavior == ELIDE_EMAIL)
@@ -1310,6 +1315,7 @@ base::string16 RenderText::Elide(const base::string16& text,
if (insert_ellipsis) {
render_text->SetText(ellipsis);
const float ellipsis_width = render_text->GetContentWidthF();
+ DLOG(INFO) << " added elipsis of width: " << ellipsis_width;
if (ellipsis_width > available_width)
return base::string16();
}
@@ -1345,6 +1351,7 @@ base::string16 RenderText::Elide(const base::string16& text,
new_text += base::i18n::kRightToLeftMark;
}
render_text->SetText(new_text);
+ DLOG(INFO) << "text set to: " << new_text;
}
// Restore styles. Make sure style ranges don't break new text graphemes.
@@ -1381,6 +1388,8 @@ base::string16 RenderText::Elide(const base::string16& text,
}
}
+ DLOG(INFO) << "returning " << render_text->text();
+
return render_text->text();
}
« no previous file with comments | « ui/app_list/test/app_list_test_model.cc ('k') | ui/gfx/render_text_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698