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

Unified Diff: ui/gfx/skbitmap_operations_unittest.cc

Issue 10823012: Fix the errors of ui unittests caused by packing colors for Android (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Rebase Created 8 years, 4 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 | « build/android/gtest_filter/ui_unittests_disabled ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/skbitmap_operations_unittest.cc
diff --git a/ui/gfx/skbitmap_operations_unittest.cc b/ui/gfx/skbitmap_operations_unittest.cc
index f5c89f86fde3c8ee0a86b334490c3158002392d0..b263a6b559cca0790393d0c3ea75900a20b9eebc 100644
--- a/ui/gfx/skbitmap_operations_unittest.cc
+++ b/ui/gfx/skbitmap_operations_unittest.cc
@@ -273,7 +273,7 @@ TEST(SkBitmapOperationsTest, CreateHSLShiftedBitmapHueOnly) {
for (int y = 0, i = 0; y < src_h; y++) {
for (int x = 0; x < src_w; x++) {
- EXPECT_TRUE(ColorsClose(*shifted.getAddr32(x, y),
+ EXPECT_TRUE(ColorsClose(shifted.getColor(x, y),
SkColorSetARGB(255, i % 255, 0, 0)));
i++;
}
@@ -477,10 +477,11 @@ TEST(SkBitmapOperationsTest, UnPreMultiply) {
input.setConfig(SkBitmap::kARGB_8888_Config, 2, 2);
input.allocPixels();
- *input.getAddr32(0, 0) = 0x80000000;
- *input.getAddr32(1, 0) = 0x80808080;
- *input.getAddr32(0, 1) = 0xFF00CC88;
- *input.getAddr32(1, 1) = 0x0000CC88;
+ // Set PMColors into the bitmap
+ *input.getAddr32(0, 0) = SkPackARGB32NoCheck(0x80, 0x00, 0x00, 0x00);
+ *input.getAddr32(1, 0) = SkPackARGB32NoCheck(0x80, 0x80, 0x80, 0x80);
+ *input.getAddr32(0, 1) = SkPackARGB32NoCheck(0xFF, 0x00, 0xCC, 0x88);
+ *input.getAddr32(1, 1) = SkPackARGB32NoCheck(0x00, 0x00, 0xCC, 0x88);
SkBitmap result = SkBitmapOperations::UnPreMultiply(input);
EXPECT_EQ(2, result.width());
« no previous file with comments | « build/android/gtest_filter/ui_unittests_disabled ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698