Chromium Code Reviews| Index: ui/gfx/image/image_unittest.cc |
| diff --git a/ui/gfx/image/image_unittest.cc b/ui/gfx/image/image_unittest.cc |
| index 93a8b612c0095ca24acd5d2ee1b84614532986ad..51d5b664735c1d542323fafeebaf0a14e14773f8 100644 |
| --- a/ui/gfx/image/image_unittest.cc |
| +++ b/ui/gfx/image/image_unittest.cc |
| @@ -194,13 +194,19 @@ TEST_F(ImageTest, SkiaToCocoaCopy) { |
| } |
| #endif |
| +inline uint32_t SetPackedColor(uint8_t a, uint8_t r, uint8_t g, uint8_t b) { |
| + return (a << SK_A32_SHIFT) | (r << SK_R32_SHIFT) | |
| + (g << SK_G32_SHIFT) | (b << SK_B32_SHIFT); |
| +} |
| +#define ColorRed SetPackedColor(0xFF, 0xFF, 0x00, 0x00) |
|
Robert Sesek
2012/07/25 15:36:53
Since you only use this once, is there a point to
yongsheng
2012/07/26 01:24:18
ok, got it. thanks.
|
| + |
| TEST_F(ImageTest, CheckSkiaColor) { |
| gfx::Image image(gt::CreatePlatformImage()); |
| const SkBitmap* bitmap = image.ToSkBitmap(); |
| SkAutoLockPixels auto_lock(*bitmap); |
| uint32_t* pixel = bitmap->getAddr32(10, 10); |
| - EXPECT_EQ(SK_ColorRED, *pixel); |
| + EXPECT_EQ(ColorRed, *pixel); |
| } |
| TEST_F(ImageTest, SwapRepresentations) { |