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

Unified Diff: ui/gfx/render_text.h

Issue 867003002: Cache gfx::RenderText instances in views::Label. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 9 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/views/app_list_item_view.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index c7dec6f385671725766b3cde2eff7e49118c2ebd..e201c1d6ee59ce105af617d611989b8b7222146f 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -256,6 +256,12 @@ class GFX_EXPORT RenderText {
bool multiline() const { return multiline_; }
void SetMultiline(bool multiline);
+ // Set whether newline characters should be replaced with newline symbols.
+ void SetReplaceNewlineCharsWithSymbols(bool replace);
+
+ // Returns true if this instance supports multiline rendering.
+ virtual bool MultilineSupported() const = 0;
+
// TODO(ckocagil): Add vertical alignment and line spacing support instead.
int min_line_height() const { return min_line_height_; }
void SetMinLineHeight(int line_height);
@@ -266,7 +272,7 @@ class GFX_EXPORT RenderText {
// WARNING: Only use this for system limits, it lacks complex text support.
void set_truncate_length(size_t length) { truncate_length_ = length; }
- // The layout text will be elided to fit |display_rect| using this behavior.
+ // The display text will be elided to fit |display_rect| using this behavior.
void SetElideBehavior(ElideBehavior elide_behavior);
ElideBehavior elide_behavior() const { return elide_behavior_; }
@@ -428,7 +434,7 @@ class GFX_EXPORT RenderText {
// Sets shadows to drawn with text.
void set_shadows(const ShadowValues& shadows) { shadows_ = shadows; }
- const ShadowValues& shadows() { return shadows_; }
+ const ShadowValues& shadows() const { return shadows_; }
typedef std::pair<Font, Range> FontSpan;
// For testing purposes, returns which fonts were chosen for which parts of
@@ -740,6 +746,9 @@ class GFX_EXPORT RenderText {
// |display_rect_| as the width cap.
bool multiline_;
+ // Whether newline characters should be replaced with newline symbols.
+ bool replace_newline_chars_with_symbols_;
+
// Set to true to suppress subpixel rendering due to non-font reasons (eg.
// if the background is transparent). The default value is false.
bool subpixel_rendering_suppressed_;
« no previous file with comments | « ui/app_list/views/app_list_item_view.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698