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

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

Issue 652573002: RenderText: Add a test to ensure strings fit their own widths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 6 years, 2 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
« no previous file with comments | « no previous file | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_H_ 5 #ifndef UI_GFX_RENDER_TEXT_H_
6 #define UI_GFX_RENDER_TEXT_H_ 6 #define UI_GFX_RENDER_TEXT_H_
7 7
8 #include <algorithm> 8 #include <algorithm>
9 #include <cstring> 9 #include <cstring>
10 #include <string> 10 #include <string>
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_SufficientWidth); 574 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_SufficientWidth);
575 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_Newline); 575 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Multiline_Newline);
576 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GlyphBounds); 576 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, GlyphBounds);
577 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_GlyphBounds); 577 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, HarfBuzz_GlyphBounds);
578 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, 578 FRIEND_TEST_ALL_PREFIXES(RenderTextTest,
579 MoveCursorLeftRight_MeiryoUILigatures); 579 MoveCursorLeftRight_MeiryoUILigatures);
580 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters); 580 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, Win_LogicalClusters);
581 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SameFontForParentheses); 581 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, SameFontForParentheses);
582 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks); 582 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, BreakRunsByUnicodeBlocks);
583 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes); 583 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, PangoAttributes);
584 FRIEND_TEST_ALL_PREFIXES(RenderTextTest, StringFitsOwnWidth);
584 585
585 // Creates a platform-specific RenderText instance. 586 // Creates a platform-specific RenderText instance.
586 static RenderText* CreateNativeInstance(); 587 static RenderText* CreateNativeInstance();
587 588
588 // Set the cursor to |position|, with the caret trailing the previous 589 // Set the cursor to |position|, with the caret trailing the previous
589 // grapheme, or if there is no previous grapheme, leading the cursor position. 590 // grapheme, or if there is no previous grapheme, leading the cursor position.
590 // If |select| is false, the selection start is moved to the same position. 591 // If |select| is false, the selection start is moved to the same position.
591 // If the |position| is not a cursorable position (not on grapheme boundary), 592 // If the |position| is not a cursorable position (not on grapheme boundary),
592 // it is a NO-OP. 593 // it is a NO-OP.
593 void MoveCursorTo(size_t position, bool select); 594 void MoveCursorTo(size_t position, bool select);
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 // Lines computed by EnsureLayout. These should be invalidated with 723 // Lines computed by EnsureLayout. These should be invalidated with
723 // ResetLayout and on |display_rect_| changes. 724 // ResetLayout and on |display_rect_| changes.
724 std::vector<internal::Line> lines_; 725 std::vector<internal::Line> lines_;
725 726
726 DISALLOW_COPY_AND_ASSIGN(RenderText); 727 DISALLOW_COPY_AND_ASSIGN(RenderText);
727 }; 728 };
728 729
729 } // namespace gfx 730 } // namespace gfx
730 731
731 #endif // UI_GFX_RENDER_TEXT_H_ 732 #endif // UI_GFX_RENDER_TEXT_H_
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/render_text_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698