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

Unified Diff: skia/ext/skia_utils_unittest.cc

Issue 100097: Reverting 14712. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 8 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 | « skia/ext/skia_utils.cc ('k') | webkit/tools/test_shell/test_shell.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: skia/ext/skia_utils_unittest.cc
===================================================================
--- skia/ext/skia_utils_unittest.cc (revision 14712)
+++ skia/ext/skia_utils_unittest.cc (working copy)
@@ -1,47 +0,0 @@
-// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include <stdlib.h>
-
-#include "skia/ext/skia_utils.h"
-#include "skia/include/SkColorPriv.h"
-#include "testing/gtest/include/gtest/gtest.h"
-#include "SkBitmap.h"
-
-TEST(SkiaUtils, SkColorToHSLRed) {
- SkColor red = SkColorSetARGB(255, 255, 0, 0);
- SkScalar hsl[3];
- skia::SkColorToHSL(red, hsl);
- EXPECT_EQ(hsl[0], 0);
- EXPECT_EQ(hsl[1], 1);
- EXPECT_EQ(hsl[2], 0.5);
-}
-
-TEST(SkiaUtils, SkColorToHSLGrey) {
- SkColor red = SkColorSetARGB(255, 128, 128, 128);
- SkScalar hsl[3];
- skia::SkColorToHSL(red, hsl);
- EXPECT_EQ(hsl[0], 0);
- EXPECT_EQ(hsl[1], 0);
- EXPECT_EQ(static_cast<int>(hsl[2] * 100),
- static_cast<int>(0.5 * 100)); // Accurate to two decimal places.
-}
-
-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),
- };
-
- SkColor result = skia::HSLToSKColor(128, hsl);
- EXPECT_EQ(SkColorGetA(red), SkColorGetA(result));
- EXPECT_EQ(SkColorGetR(red), SkColorGetR(result));
- EXPECT_EQ(SkColorGetG(red), SkColorGetG(result));
- EXPECT_EQ(SkColorGetB(red), SkColorGetB(result));
-}
-
« no previous file with comments | « skia/ext/skia_utils.cc ('k') | webkit/tools/test_shell/test_shell.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698