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> |
| 10 #include <stdint.h> |
9 | 11 |
10 #include <string> | 12 #include <string> |
11 #include <vector> | 13 #include <vector> |
12 | 14 |
13 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
14 #include "base/mac/scoped_cftyperef.h" | 16 #include "base/mac/scoped_cftyperef.h" |
| 17 #include "base/macros.h" |
15 #include "ui/gfx/gfx_export.h" | 18 #include "ui/gfx/gfx_export.h" |
16 #include "ui/gfx/render_text.h" | 19 #include "ui/gfx/render_text.h" |
17 | 20 |
18 namespace gfx { | 21 namespace gfx { |
19 | 22 |
20 // RenderTextMac is the Mac implementation of RenderText that uses CoreText for | 23 // RenderTextMac is the Mac implementation of RenderText that uses CoreText for |
21 // layout and Skia for drawing. | 24 // layout and Skia for drawing. |
22 // | 25 // |
23 // Note: The current implementation only supports drawing and sizing the text, | 26 // Note: The current implementation only supports drawing and sizing the text, |
24 // but not text selection or cursor movement. | 27 // but not text selection or cursor movement. |
(...skipping 30 matching lines...) Expand all Loading... |
55 void OnTextColorChanged() override; | 58 void OnTextColorChanged() override; |
56 void EnsureLayout() override; | 59 void EnsureLayout() override; |
57 void DrawVisualText(internal::SkiaTextRenderer* renderer) override; | 60 void DrawVisualText(internal::SkiaTextRenderer* renderer) override; |
58 | 61 |
59 private: | 62 private: |
60 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Mac_ElidedText); | 63 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Mac_ElidedText); |
61 | 64 |
62 struct TextRun { | 65 struct TextRun { |
63 CTRunRef ct_run; | 66 CTRunRef ct_run; |
64 SkPoint origin; | 67 SkPoint origin; |
65 std::vector<uint16> glyphs; | 68 std::vector<uint16_t> glyphs; |
66 std::vector<SkPoint> glyph_positions; | 69 std::vector<SkPoint> glyph_positions; |
67 SkScalar width; | 70 SkScalar width; |
68 Font font; | 71 Font font; |
69 SkColor foreground; | 72 SkColor foreground; |
70 bool underline; | 73 bool underline; |
71 bool strike; | 74 bool strike; |
72 bool diagonal_strike; | 75 bool diagonal_strike; |
73 | 76 |
74 TextRun(); | 77 TextRun(); |
75 ~TextRun(); | 78 ~TextRun(); |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 | 125 |
123 // Indicates that |runs_| are valid, set by |ComputeRuns()|. | 126 // Indicates that |runs_| are valid, set by |ComputeRuns()|. |
124 bool runs_valid_; | 127 bool runs_valid_; |
125 | 128 |
126 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); | 129 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); |
127 }; | 130 }; |
128 | 131 |
129 } // namespace gfx | 132 } // namespace gfx |
130 | 133 |
131 #endif // UI_GFX_RENDER_TEXT_MAC_H_ | 134 #endif // UI_GFX_RENDER_TEXT_MAC_H_ |
OLD | NEW |