| 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 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 | 68 |
| 69 // Applies RenderText styles to |attr_string| with the given |ct_font|. | 69 // Applies RenderText styles to |attr_string| with the given |ct_font|. |
| 70 void ApplyStyles(CFMutableAttributedStringRef attr_string, CTFontRef ct_font); | 70 void ApplyStyles(CFMutableAttributedStringRef attr_string, CTFontRef ct_font); |
| 71 | 71 |
| 72 // Updates |runs_| based on |line_| and sets |runs_valid_| to true. | 72 // Updates |runs_| based on |line_| and sets |runs_valid_| to true. |
| 73 void ComputeRuns(); | 73 void ComputeRuns(); |
| 74 | 74 |
| 75 // The Core Text line of text. Created by |EnsureLayout()|. | 75 // The Core Text line of text. Created by |EnsureLayout()|. |
| 76 base::mac::ScopedCFTypeRef<CTLineRef> line_; | 76 base::mac::ScopedCFTypeRef<CTLineRef> line_; |
| 77 | 77 |
| 78 // Array to hold CFAttributedString attributes that allows Core Text to hold |
| 79 // weak references to them without leaking. |
| 80 base::mac::ScopedCFTypeRef<CFMutableArrayRef> attributes_; |
| 81 |
| 78 // Visual dimensions of the text. Computed by |EnsureLayout()|. | 82 // Visual dimensions of the text. Computed by |EnsureLayout()|. |
| 79 Size string_size_; | 83 Size string_size_; |
| 80 | 84 |
| 81 // Common baseline for this line of text. Computed by |EnsureLayout()|. | 85 // Common baseline for this line of text. Computed by |EnsureLayout()|. |
| 82 SkScalar common_baseline_; | 86 SkScalar common_baseline_; |
| 83 | 87 |
| 84 // Visual text runs. Only valid if |runs_valid_| is true. Computed by | 88 // Visual text runs. Only valid if |runs_valid_| is true. Computed by |
| 85 // |ComputeRuns()|. | 89 // |ComputeRuns()|. |
| 86 std::vector<TextRun> runs_; | 90 std::vector<TextRun> runs_; |
| 87 | 91 |
| 88 // Indicates that |runs_| are valid, set by |ComputeRuns()|. | 92 // Indicates that |runs_| are valid, set by |ComputeRuns()|. |
| 89 bool runs_valid_; | 93 bool runs_valid_; |
| 90 | 94 |
| 91 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); | 95 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); |
| 92 }; | 96 }; |
| 93 | 97 |
| 94 } // namespace gfx | 98 } // namespace gfx |
| 95 | 99 |
| 96 #endif // UI_GFX_RENDER_TEXT_MAC_H_ | 100 #endif // UI_GFX_RENDER_TEXT_MAC_H_ |
| OLD | NEW |