OLD | NEW |
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 #ifndef UI_GFX_RENDER_TEXT_MAC_H_ | 5 #ifndef UI_GFX_RENDER_TEXT_MAC_H_ |
6 #define UI_GFX_RENDER_TEXT_MAC_H_ | 6 #define UI_GFX_RENDER_TEXT_MAC_H_ |
7 | 7 |
8 #include <ApplicationServices/ApplicationServices.h> | 8 #include <ApplicationServices/ApplicationServices.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 const base::string16& text, | 101 const base::string16& text, |
102 CFMutableAttributedStringRef attr_string, | 102 CFMutableAttributedStringRef attr_string, |
103 CTFontRef ct_font); | 103 CTFontRef ct_font); |
104 | 104 |
105 // Updates |runs_| based on |line_| and sets |runs_valid_| to true. | 105 // Updates |runs_| based on |line_| and sets |runs_valid_| to true. |
106 void ComputeRuns(); | 106 void ComputeRuns(); |
107 | 107 |
108 // Clears cached style. Doesn't update display text (e.g. eliding). | 108 // Clears cached style. Doesn't update display text (e.g. eliding). |
109 void InvalidateStyle(); | 109 void InvalidateStyle(); |
110 | 110 |
| 111 // RenderText: |
| 112 bool GetDecoratedTextForRange(const Range& range, |
| 113 DecoratedText* decorated_text) override; |
| 114 |
111 // The Core Text line of text. Created by |EnsureLayout()|. | 115 // The Core Text line of text. Created by |EnsureLayout()|. |
112 base::ScopedCFTypeRef<CTLineRef> line_; | 116 base::ScopedCFTypeRef<CTLineRef> line_; |
113 | 117 |
114 // Array to hold CFAttributedString attributes that allows Core Text to hold | 118 // Array to hold CFAttributedString attributes that allows Core Text to hold |
115 // weak references to them without leaking. | 119 // weak references to them without leaking. |
116 base::ScopedCFTypeRef<CFMutableArrayRef> attributes_; | 120 base::ScopedCFTypeRef<CFMutableArrayRef> attributes_; |
117 | 121 |
118 // Visual dimensions of the text. Computed by |EnsureLayout()|. | 122 // Visual dimensions of the text. Computed by |EnsureLayout()|. |
119 SizeF string_size_; | 123 SizeF string_size_; |
120 | 124 |
121 // Common baseline for this line of text. Computed by |EnsureLayout()|. | 125 // Common baseline for this line of text. Computed by |EnsureLayout()|. |
122 SkScalar common_baseline_; | 126 SkScalar common_baseline_; |
123 | 127 |
124 // Visual text runs. Only valid if |runs_valid_| is true. Computed by | 128 // Visual text runs. Only valid if |runs_valid_| is true. Computed by |
125 // |ComputeRuns()|. | 129 // |ComputeRuns()|. |
126 std::vector<TextRun> runs_; | 130 std::vector<TextRun> runs_; |
127 | 131 |
128 // Indicates that |runs_| are valid, set by |ComputeRuns()|. | 132 // Indicates that |runs_| are valid, set by |ComputeRuns()|. |
129 bool runs_valid_; | 133 bool runs_valid_; |
130 | 134 |
131 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); | 135 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); |
132 }; | 136 }; |
133 | 137 |
134 } // namespace gfx | 138 } // namespace gfx |
135 | 139 |
136 #endif // UI_GFX_RENDER_TEXT_MAC_H_ | 140 #endif // UI_GFX_RENDER_TEXT_MAC_H_ |
OLD | NEW |