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

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, 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/gfx/harfbuzz_font_skia.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 5a1825351bdf5c8bc97b7b754e1d3be3f7c2b7ea..11f8fb64764a5feec8051ef161c9abb149dd9641 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -52,7 +52,7 @@ class SkiaTextRenderer {
void SetDrawLooper(SkDrawLooper* draw_looper);
void SetFontRenderParams(const FontRenderParams& params,
- bool background_is_transparent);
+ bool subpixel_rendering_enabled);
void SetTypeface(SkTypeface* typeface);
void SetTextSize(SkScalar size);
void SetFontFamilyWithStyle(const std::string& family, int font_style);
@@ -181,7 +181,7 @@ skia::RefPtr<SkTypeface> CreateSkiaTypeface(const std::string& family,
// Applies the given FontRenderParams to a Skia |paint|.
void ApplyRenderParams(const FontRenderParams& params,
- bool background_is_transparent,
+ bool subpixel_rendering_enabled,
SkPaint* paint);
} // namespace internal
@@ -256,6 +256,9 @@ class GFX_EXPORT RenderText {
bool multiline() const { return multiline_; }
void SetMultiline(bool multiline);
+ // Returns true if this 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);
@@ -273,9 +276,11 @@ class GFX_EXPORT RenderText {
const Rect& display_rect() const { return display_rect_; }
void SetDisplayRect(const Rect& r);
- bool background_is_transparent() const { return background_is_transparent_; }
- void set_background_is_transparent(bool transparent) {
- background_is_transparent_ = transparent;
+ bool subpixel_rendering_enabled() const {
+ return subpixel_rendering_enabled_;
+ }
+ void set_subpixel_rendering_enabled(bool enabled) {
+ subpixel_rendering_enabled_ = enabled;
}
const SelectionModel& selection_model() const { return selection_model_; }
@@ -426,7 +431,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
@@ -733,7 +738,7 @@ class GFX_EXPORT RenderText {
bool multiline_;
// Is the background transparent (either partially or fully)?
msw 2015/02/17 22:16:45 nit: update comment.
- bool background_is_transparent_;
+ bool subpixel_rendering_enabled_;
// The local display area for rendering the text.
Rect display_rect_;
« no previous file with comments | « ui/gfx/harfbuzz_font_skia.cc ('k') | ui/gfx/render_text.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698