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

Unified Diff: ui/gfx/render_text_mac.h

Issue 968923004: Use GetDisplayText() instead of text() for rendering text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix 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
Index: ui/gfx/render_text_mac.h
diff --git a/ui/gfx/render_text_mac.h b/ui/gfx/render_text_mac.h
index 737207fe19af6060b893b4b38a0cfb582e1f847a..e20544370cfe146e62e5abbe456c924976f82651 100644
--- a/ui/gfx/render_text_mac.h
+++ b/ui/gfx/render_text_mac.h
@@ -53,6 +53,8 @@ class RenderTextMac : public RenderText {
void DrawVisualText(Canvas* canvas) override;
private:
+ FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Mac_ElidedText);
+
struct TextRun {
CTRunRef ct_run;
SkPoint origin;
@@ -71,8 +73,20 @@ class RenderTextMac : public RenderText {
~TextRun();
};
+ // Update |string_size_| based on the |layout_text()|.
+ void EnsureStringSize();
+
+ // Creates Core Text line object and its attributes for the given text.
+ void EnsureLayoutInternal(
+ const base::string16& text,
+ base::ScopedCFTypeRef<CTLineRef>* line,
+ base::ScopedCFTypeRef<CFMutableArrayRef>* attributes);
+
// Applies RenderText styles to |attr_string| with the given |ct_font|.
- void ApplyStyles(CFMutableAttributedStringRef attr_string, CTFontRef ct_font);
+ // The computed attributes are stored into |attributes_owner|.
+ void ApplyStyles(CFMutableAttributedStringRef attr_string,
tapted 2015/03/05 06:32:49 declare this as a const function? That would be a
Jun Mukai 2015/03/05 18:01:38 Done.
Jun Mukai 2015/03/05 18:41:38 Oops, this and EnsureLayoutInternal() can't be con
+ CTFontRef ct_font,
+ base::ScopedCFTypeRef<CFMutableArrayRef>* attributes_owner);
tapted 2015/03/05 06:32:49 It should be fine to return a base::ScopedCFTypeRe
Jun Mukai 2015/03/05 18:01:38 Done, but I think EnsureLayoutInternal should sema
// Updates |runs_| based on |line_| and sets |runs_valid_| to true.
void ComputeRuns();
@@ -85,7 +99,7 @@ class RenderTextMac : public RenderText {
base::ScopedCFTypeRef<CFMutableArrayRef> attributes_;
// Visual dimensions of the text. Computed by |EnsureLayout()|.
- SizeF string_size_;
+ scoped_ptr<SizeF> string_size_;
// Common baseline for this line of text. Computed by |EnsureLayout()|.
SkScalar common_baseline_;
« no previous file with comments | « ui/gfx/render_text.cc ('k') | ui/gfx/render_text_mac.cc » ('j') | ui/gfx/render_text_mac.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698