Don't reset the layout on RenderText display rect width change.

Previously, I thought width was used in layout in render_text_linux.cc,
but it turns out that the width that's passed in to SetupPangoLayout()
gets cleared right after. So the width of the display rect does not
actually affect layout and thus does not need to cause the layout to
be reset.

BUG=137064
TEST=No behavior change.

Review URL: https://chromiumcodereview.appspot.com/10829261

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150908 0039d316-1c4b-4281-b951-d872f2087c98
parent 6d2999d7
...@@ -445,8 +445,6 @@ void RenderText::SetObscured(bool obscured) { ...@@ -445,8 +445,6 @@ void RenderText::SetObscured(bool obscured) {
} }
void RenderText::SetDisplayRect(const Rect& r) { void RenderText::SetDisplayRect(const Rect& r) {
if (r.width() != display_rect_.width())
ResetLayout();
display_rect_ = r; display_rect_ = r;
cached_bounds_and_offset_valid_ = false; cached_bounds_and_offset_valid_ = false;
} }
......
...@@ -283,7 +283,7 @@ void RenderTextLinux::EnsureLayout() { ...@@ -283,7 +283,7 @@ void RenderTextLinux::EnsureLayout() {
SetupPangoLayoutWithFontDescription(layout_, SetupPangoLayoutWithFontDescription(layout_,
GetDisplayText(), GetDisplayText(),
font_list().GetFontDescriptionString(), font_list().GetFontDescriptionString(),
display_rect().width(), 0,
GetTextDirection(), GetTextDirection(),
Canvas::DefaultCanvasTextAlignment()); Canvas::DefaultCanvasTextAlignment());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment