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 "base/i18n/rtl.h" | 5 #include "base/i18n/rtl.h" |
6 #include "base/utf_string_conversions.h" | 6 #include "base/utf_string_conversions.h" |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 #include "ui/base/accessibility/accessible_view_state.h" | 8 #include "ui/base/accessibility/accessible_view_state.h" |
9 #include "ui/base/l10n/l10n_util.h" | 9 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/gfx/canvas.h" | 10 #include "ui/gfx/canvas.h" |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
834 gfx::Canvas::MULTI_LINE | | 834 gfx::Canvas::MULTI_LINE | |
835 gfx::Canvas::TEXT_ALIGN_LEFT | | 835 gfx::Canvas::TEXT_ALIGN_LEFT | |
836 gfx::Canvas::NO_ELLIPSIS, | 836 gfx::Canvas::NO_ELLIPSIS, |
837 flags); | 837 flags); |
838 #endif | 838 #endif |
839 | 839 |
840 // Reset Locale | 840 // Reset Locale |
841 base::i18n::SetICUDefaultLocale(locale); | 841 base::i18n::SetICUDefaultLocale(locale); |
842 } | 842 } |
843 | 843 |
| 844 // Check that we disable subpixel rendering when a transparent background is |
| 845 // being used. |
| 846 TEST(LabelTest, DisableSubpixelRendering) { |
| 847 Label label; |
| 848 label.SetBackgroundColor(SK_ColorWHITE); |
| 849 EXPECT_EQ( |
| 850 0, label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING); |
| 851 |
| 852 label.SetBackgroundColor(SkColorSetARGB(64, 255, 255, 255)); |
| 853 EXPECT_EQ( |
| 854 gfx::Canvas::NO_SUBPIXEL_RENDERING, |
| 855 label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING); |
| 856 } |
| 857 |
844 } // namespace views | 858 } // namespace views |
OLD | NEW |