Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(276)

Side by Side Diff: ui/gfx/render_text_mac.h

Issue 2251893004: Use parameterized tests to test multiple render text implementations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@selection_direction
Patch Set: Address nits. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
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(RenderTextTest, Mac_ElidedText); 63 FRIEND_TEST_ALL_PREFIXES(RenderTextMacTest, Mac_ElidedText);
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
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698