summaryrefslogtreecommitdiffstats
path: root/skia/ext/skia_utils_unittest.cc
diff options
context:
space:
mode:
authorglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 01:07:42 +0000
committerglen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-09 01:07:42 +0000
commit4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f (patch)
tree69a1e9f78b3a5fa8b909cfab336826b09c44235f /skia/ext/skia_utils_unittest.cc
parent5085ee0b4bfbe4625e63ee6975bb95702e13e0aa (diff)
downloadchromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.zip
chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.gz
chromium_src-4a19063d1459a4c9c8c4c50ed86eb9048f69ea3f.tar.bz2
This is the first pass at themes.
This CL is paired with http://codereview.chromium.org/67284 This CL (for commit purposes) includes http://codereview.chromium.org/67284 BUG=4463,11232,11233,11234,11235 Review URL: http://codereview.chromium.org/99030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15704 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'skia/ext/skia_utils_unittest.cc')
-rw-r--r--skia/ext/skia_utils_unittest.cc22
1 files changed, 9 insertions, 13 deletions
diff --git a/skia/ext/skia_utils_unittest.cc b/skia/ext/skia_utils_unittest.cc
index f7b00b1..444a5fc9 100644
--- a/skia/ext/skia_utils_unittest.cc
+++ b/skia/ext/skia_utils_unittest.cc
@@ -11,20 +11,20 @@
TEST(SkiaUtils, SkColorToHSLRed) {
SkColor red = SkColorSetARGB(255, 255, 0, 0);
- SkScalar hsl[3];
+ skia::HSL hsl = { 0, 0, 0 };
skia::SkColorToHSL(red, hsl);
- EXPECT_EQ(hsl[0], 0);
- EXPECT_EQ(hsl[1], 1);
- EXPECT_EQ(hsl[2], 0.5);
+ EXPECT_EQ(hsl.h, 0);
+ EXPECT_EQ(hsl.s, 1);
+ EXPECT_EQ(hsl.l, 0.5);
}
TEST(SkiaUtils, SkColorToHSLGrey) {
SkColor red = SkColorSetARGB(255, 128, 128, 128);
- SkScalar hsl[3];
+ skia::HSL hsl = { 0, 0, 0 };
skia::SkColorToHSL(red, hsl);
- EXPECT_EQ(hsl[0], 0);
- EXPECT_EQ(hsl[1], 0);
- EXPECT_EQ(static_cast<int>(hsl[2] * 100),
+ EXPECT_EQ(hsl.h, 0);
+ EXPECT_EQ(hsl.s, 0);
+ EXPECT_EQ(static_cast<int>(hsl.l * 100),
static_cast<int>(0.5 * 100)); // Accurate to two decimal places.
}
@@ -32,11 +32,7 @@ TEST(SkiaUtils, HSLToSkColorWithAlpha) {
// Premultiplied alpha - this is full red.
SkColor red = SkColorSetARGB(128, 128, 0, 0);
- SkScalar hsl[3] = {
- SkDoubleToScalar(0),
- SkDoubleToScalar(1),
- SkDoubleToScalar(0.5),
- };
+ skia::HSL hsl = { 0, 1, 0.5 };
SkColor result = skia::HSLToSKColor(128, hsl);
EXPECT_EQ(SkColorGetA(red), SkColorGetA(result));