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

Side by Side Diff: ui/views/controls/label_unittest.cc

Issue 9688020: views: Add subpixel rendering test for views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ui/views/controls/label.h ('k') | no next file » | 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 #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
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
OLDNEW
« no previous file with comments | « ui/views/controls/label.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698