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

Side by Side Diff: tests/BitmapTest.cpp

Issue 1526943003: Tests: reduce verbosity (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkMallocPixelRef.h" 9 #include "SkMallocPixelRef.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 SkAutoLockPixels autoLockPixels2(source); 144 SkAutoLockPixels autoLockPixels2(source);
145 REPORTER_ASSERT(r, source.getColor(0, 0) == copy.getColor(0, 0)); 145 REPORTER_ASSERT(r, source.getColor(0, 0) == copy.getColor(0, 0));
146 } 146 }
147 } 147 }
148 148
149 static void test_erasecolor_premul(skiatest::Reporter* reporter, SkColorType ct, SkColor input, 149 static void test_erasecolor_premul(skiatest::Reporter* reporter, SkColorType ct, SkColor input,
150 SkColor expected) { 150 SkColor expected) {
151 SkBitmap bm; 151 SkBitmap bm;
152 bm.allocPixels(SkImageInfo::Make(1, 1, ct, kPremul_SkAlphaType)); 152 bm.allocPixels(SkImageInfo::Make(1, 1, ct, kPremul_SkAlphaType));
153 bm.eraseColor(input); 153 bm.eraseColor(input);
154 SkDebugf("expected: %x actual: %x\n", expected, bm.getColor(0, 0)); 154 if (reporter->verbose()) {
155 SkDebugf("expected: %x actual: %x\n", expected, bm.getColor(0, 0));
156 }
155 REPORTER_ASSERT(reporter, bm.getColor(0, 0) == expected); 157 REPORTER_ASSERT(reporter, bm.getColor(0, 0) == expected);
156 } 158 }
157 159
158 /** 160 /**
159 * This test checks that eraseColor premultiplies the color correctly. 161 * This test checks that eraseColor premultiplies the color correctly.
160 */ 162 */
161 DEF_TEST(Bitmap_eraseColor_Premul, r) { 163 DEF_TEST(Bitmap_eraseColor_Premul, r) {
162 SkColor color = 0x80FF0080; 164 SkColor color = 0x80FF0080;
163 test_erasecolor_premul(r, kAlpha_8_SkColorType, color, 0x80000000); 165 test_erasecolor_premul(r, kAlpha_8_SkColorType, color, 0x80000000);
164 test_erasecolor_premul(r, kRGB_565_SkColorType, color, 0xFF840042); 166 test_erasecolor_premul(r, kRGB_565_SkColorType, color, 0xFF840042);
165 test_erasecolor_premul(r, kARGB_4444_SkColorType, color, 0x88FF0080); 167 test_erasecolor_premul(r, kARGB_4444_SkColorType, color, 0x88FF0080);
166 test_erasecolor_premul(r, kRGBA_8888_SkColorType, color, color); 168 test_erasecolor_premul(r, kRGBA_8888_SkColorType, color, color);
167 test_erasecolor_premul(r, kBGRA_8888_SkColorType, color, color); 169 test_erasecolor_premul(r, kBGRA_8888_SkColorType, color, color);
168 } 170 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698