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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/label.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/label_unittest.cc
diff --git a/ui/views/controls/label_unittest.cc b/ui/views/controls/label_unittest.cc
index 97c7f9902c6ea69dc67da542887ed7c21e6b550a..fb6b6d6a0719c5fe18e242491c684810e55de57e 100644
--- a/ui/views/controls/label_unittest.cc
+++ b/ui/views/controls/label_unittest.cc
@@ -841,4 +841,18 @@ TEST(LabelTest, DrawMultiLineStringInRTL) {
base::i18n::SetICUDefaultLocale(locale);
}
+// Check that we disable subpixel rendering when a transparent background is
+// being used.
+TEST(LabelTest, DisableSubpixelRendering) {
+ Label label;
+ label.SetBackgroundColor(SK_ColorWHITE);
+ EXPECT_EQ(
+ 0, label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING);
+
+ label.SetBackgroundColor(SkColorSetARGB(64, 255, 255, 255));
+ EXPECT_EQ(
+ gfx::Canvas::NO_SUBPIXEL_RENDERING,
+ label.ComputeDrawStringFlags() & gfx::Canvas::NO_SUBPIXEL_RENDERING);
+}
+
} // namespace views
« 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