| 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 #include "ui/gfx/render_text.h" | 5 #include "ui/gfx/render_text.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/i18n/break_iterator.h" | 10 #include "base/i18n/break_iterator.h" |
| (...skipping 2708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2719 kTestSize + string_size.height(), | 2719 kTestSize + string_size.height(), |
| 2720 kCanvasSize.width(), kTestSize); | 2720 kCanvasSize.width(), kTestSize); |
| 2721 } | 2721 } |
| 2722 { | 2722 { |
| 2723 SCOPED_TRACE("TextDoesntClip Left Side"); | 2723 SCOPED_TRACE("TextDoesntClip Left Side"); |
| 2724 #if defined(OS_WIN) | 2724 #if defined(OS_WIN) |
| 2725 // TODO(dschuyler): On Windows XP the Unicode test draws to the left edge | 2725 // TODO(dschuyler): On Windows XP the Unicode test draws to the left edge |
| 2726 // as if it is ignoring the SetDisplayRect shift by kTestSize. This | 2726 // as if it is ignoring the SetDisplayRect shift by kTestSize. This |
| 2727 // appears to be a preexisting issue that wasn't revealed by the prior | 2727 // appears to be a preexisting issue that wasn't revealed by the prior |
| 2728 // unit tests. | 2728 // unit tests. |
| 2729 #elif defined(OS_MACOSX) | 2729 #elif defined(OS_MACOSX) || defined(OS_CHROMEOS) |
| 2730 // TODO(dschuyler): On Windows (non-XP) and Mac smoothing draws left of | 2730 // TODO(dschuyler): On Windows (non-XP), Chrome OS and Mac smoothing draws |
| 2731 // text. This appears to be a preexisting issue that wasn't revealed by | 2731 // left of text. This appears to be a preexisting issue that wasn't |
| 2732 // the prior unit tests. | 2732 // revealed by the prior unit tests. |
| 2733 rect_buffer.EnsureSolidRect(SK_ColorWHITE, 0, kTestSize, kTestSize - 1, | 2733 rect_buffer.EnsureSolidRect(SK_ColorWHITE, 0, kTestSize, kTestSize - 1, |
| 2734 string_size.height()); | 2734 string_size.height()); |
| 2735 #else | 2735 #else |
| 2736 rect_buffer.EnsureSolidRect(SK_ColorWHITE, 0, kTestSize, kTestSize, | 2736 rect_buffer.EnsureSolidRect(SK_ColorWHITE, 0, kTestSize, kTestSize, |
| 2737 string_size.height()); | 2737 string_size.height()); |
| 2738 #endif | 2738 #endif |
| 2739 } | 2739 } |
| 2740 { | 2740 { |
| 2741 SCOPED_TRACE("TextDoesntClip Right Side"); | 2741 SCOPED_TRACE("TextDoesntClip Right Side"); |
| 2742 #if !defined(OS_MACOSX) | 2742 #if !defined(OS_MACOSX) |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2822 string_size.set_width(string_size.width() / 2); | 2822 string_size.set_width(string_size.width() / 2); |
| 2823 render_text.SetDisplayRect(gfx::Rect(string_size)); | 2823 render_text.SetDisplayRect(gfx::Rect(string_size)); |
| 2824 render_text.EnsureLayout(); | 2824 render_text.EnsureLayout(); |
| 2825 CFIndex glyph_count = CTLineGetGlyphCount(render_text.line_); | 2825 CFIndex glyph_count = CTLineGetGlyphCount(render_text.line_); |
| 2826 EXPECT_GT(text.size(), static_cast<size_t>(glyph_count)); | 2826 EXPECT_GT(text.size(), static_cast<size_t>(glyph_count)); |
| 2827 EXPECT_NE(0, glyph_count); | 2827 EXPECT_NE(0, glyph_count); |
| 2828 } | 2828 } |
| 2829 #endif | 2829 #endif |
| 2830 | 2830 |
| 2831 } // namespace gfx | 2831 } // namespace gfx |
| OLD | NEW |