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

Side by Side Diff: chrome/browser/ui/views/omnibox/omnibox_result_view.cc

Issue 916203002: Reduce the number of text reshaping in RenderText (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/gfx/canvas_skia.cc » ('j') | ui/gfx/render_text.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // For WinDDK ATL compatibility, these ATL headers must come first. 5 // For WinDDK ATL compatibility, these ATL headers must come first.
6 #include "build/build_config.h" 6 #include "build/build_config.h"
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <atlbase.h> // NOLINT 8 #include <atlbase.h> // NOLINT
9 #include <atlwin.h> // NOLINT 9 #include <atlwin.h> // NOLINT
10 #endif 10 #endif
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 int right_x = x + max_width; 271 int right_x = x + max_width;
272 272
273 // Infinite suggestions should appear with the leading ellipses vertically 273 // Infinite suggestions should appear with the leading ellipses vertically
274 // stacked. 274 // stacked.
275 if (contents && 275 if (contents &&
276 (match.type == AutocompleteMatchType::SEARCH_SUGGEST_TAIL)) { 276 (match.type == AutocompleteMatchType::SEARCH_SUGGEST_TAIL)) {
277 // When the directionality of suggestion doesn't match the UI, we try to 277 // When the directionality of suggestion doesn't match the UI, we try to
278 // vertically stack the ellipsis by restricting the end edge (right_x). 278 // vertically stack the ellipsis by restricting the end edge (right_x).
279 const bool is_ui_rtl = base::i18n::IsRTL(); 279 const bool is_ui_rtl = base::i18n::IsRTL();
280 const bool is_match_contents_rtl = 280 const bool is_match_contents_rtl =
281 (render_text->GetTextDirection() == base::i18n::RIGHT_TO_LEFT); 281 (render_text->GetDisplayTextDirection() == base::i18n::RIGHT_TO_LEFT);
282 const int offset = 282 const int offset =
283 GetDisplayOffset(match, is_ui_rtl, is_match_contents_rtl); 283 GetDisplayOffset(match, is_ui_rtl, is_match_contents_rtl);
284 284
285 scoped_ptr<gfx::RenderText> prefix_render_text( 285 scoped_ptr<gfx::RenderText> prefix_render_text(
286 CreateRenderText(base::UTF8ToUTF16( 286 CreateRenderText(base::UTF8ToUTF16(
287 match.GetAdditionalInfo(kACMatchPropertyContentsPrefix)))); 287 match.GetAdditionalInfo(kACMatchPropertyContentsPrefix))));
288 const int prefix_width = prefix_render_text->GetContentWidth(); 288 const int prefix_width = prefix_render_text->GetContentWidth();
289 int prefix_x = x; 289 int prefix_x = x;
290 290
291 const int max_match_contents_width = model_->max_match_contents_width(); 291 const int max_match_contents_width = model_->max_match_contents_width();
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 } 560 }
561 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(), 561 PaintMatch(*keyword_match, keyword_contents_rendertext_.get(),
562 keyword_description_rendertext_.get(), canvas, x); 562 keyword_description_rendertext_.get(), canvas, x);
563 } 563 }
564 } 564 }
565 565
566 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) { 566 void OmniboxResultView::AnimationProgressed(const gfx::Animation* animation) {
567 Layout(); 567 Layout();
568 SchedulePaint(); 568 SchedulePaint();
569 } 569 }
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/canvas_skia.cc » ('j') | ui/gfx/render_text.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698