summaryrefslogtreecommitdiffstats
path: root/ui/gfx/render_text.cc
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 05:49:58 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-03-30 05:49:58 +0000
commit496de1ac572ffa396acf61606bf0029669e1f718 (patch)
tree6b51756bd179afd00d33db8e590a7f5fe53aae29 /ui/gfx/render_text.cc
parent63767a30826e54c6767d2b2f8db29024684fc11f (diff)
downloadchromium_src-496de1ac572ffa396acf61606bf0029669e1f718.zip
chromium_src-496de1ac572ffa396acf61606bf0029669e1f718.tar.gz
chromium_src-496de1ac572ffa396acf61606bf0029669e1f718.tar.bz2
Avoid resetting the RenderText layout on SetDisplayRect() except when the width changes.
BUG=105550 TEST=existing unit tests Review URL: http://codereview.chromium.org/9923011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@129794 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/render_text.cc')
-rw-r--r--ui/gfx/render_text.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ui/gfx/render_text.cc b/ui/gfx/render_text.cc
index 78a3f07..aad57f4 100644
--- a/ui/gfx/render_text.cc
+++ b/ui/gfx/render_text.cc
@@ -376,9 +376,10 @@ void RenderText::SetObscured(bool obscured) {
}
void RenderText::SetDisplayRect(const Rect& r) {
+ if (r.width() != display_rect_.width())
+ ResetLayout();
display_rect_ = r;
cached_bounds_and_offset_valid_ = false;
- ResetLayout();
}
void RenderText::SetCursorPosition(size_t position) {