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> |
11 | 11 |
12 #include <string> | 12 #include <string> |
13 #include <vector> | 13 #include <vector> |
14 | 14 |
15 #include "base/gtest_prod_util.h" | 15 #include "base/gtest_prod_util.h" |
msw
2016/09/15 18:19:37
ditto nit: remove?
karandeepb
2016/09/16 01:08:55
Done.
| |
16 #include "base/mac/scoped_cftyperef.h" | 16 #include "base/mac/scoped_cftyperef.h" |
17 #include "base/macros.h" | 17 #include "base/macros.h" |
18 #include "ui/gfx/gfx_export.h" | 18 #include "ui/gfx/gfx_export.h" |
19 #include "ui/gfx/render_text.h" | 19 #include "ui/gfx/render_text.h" |
20 | 20 |
21 namespace gfx { | 21 namespace gfx { |
22 | 22 |
23 // RenderTextMac is the Mac implementation of RenderText that uses CoreText for | 23 // RenderTextMac is the Mac implementation of RenderText that uses CoreText for |
24 // layout and Skia for drawing. | 24 // layout and Skia for drawing. |
25 // | 25 // |
(...skipping 27 matching lines...) Expand all Loading... | |
53 size_t TextIndexToDisplayIndex(size_t index) override; | 53 size_t TextIndexToDisplayIndex(size_t index) override; |
54 size_t DisplayIndexToTextIndex(size_t index) override; | 54 size_t DisplayIndexToTextIndex(size_t index) override; |
55 bool IsValidCursorIndex(size_t index) override; | 55 bool IsValidCursorIndex(size_t index) override; |
56 void OnLayoutTextAttributeChanged(bool text_changed) override; | 56 void OnLayoutTextAttributeChanged(bool text_changed) override; |
57 void OnDisplayTextAttributeChanged() override; | 57 void OnDisplayTextAttributeChanged() override; |
58 void OnTextColorChanged() override; | 58 void OnTextColorChanged() override; |
59 void EnsureLayout() override; | 59 void EnsureLayout() override; |
60 void DrawVisualText(internal::SkiaTextRenderer* renderer) override; | 60 void DrawVisualText(internal::SkiaTextRenderer* renderer) override; |
61 | 61 |
62 private: | 62 private: |
63 FRIEND_TEST_ALL_PREFIXES(RenderTextMacTest, Mac_ElidedText); | 63 friend class RenderTextMacTest; |
64 | 64 |
65 struct TextRun { | 65 struct TextRun { |
66 CTRunRef ct_run; | 66 CTRunRef ct_run; |
67 SkPoint origin; | 67 SkPoint origin; |
68 std::vector<uint16_t> glyphs; | 68 std::vector<uint16_t> glyphs; |
69 std::vector<SkPoint> glyph_positions; | 69 std::vector<SkPoint> glyph_positions; |
70 SkScalar width; | 70 SkScalar width; |
71 base::ScopedCFTypeRef<CTFontRef> ct_font; | 71 base::ScopedCFTypeRef<CTFontRef> ct_font; |
72 sk_sp<SkTypeface> typeface; | 72 sk_sp<SkTypeface> typeface; |
73 SkColor foreground; | 73 SkColor foreground; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 | 128 |
129 // Indicates that |runs_| are valid, set by |ComputeRuns()|. | 129 // Indicates that |runs_| are valid, set by |ComputeRuns()|. |
130 bool runs_valid_; | 130 bool runs_valid_; |
131 | 131 |
132 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); | 132 DISALLOW_COPY_AND_ASSIGN(RenderTextMac); |
133 }; | 133 }; |
134 | 134 |
135 } // namespace gfx | 135 } // namespace gfx |
136 | 136 |
137 #endif // UI_GFX_RENDER_TEXT_MAC_H_ | 137 #endif // UI_GFX_RENDER_TEXT_MAC_H_ |
OLD | NEW |