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