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

Side by Side Diff: tests/PremulAlphaRoundTripTest.cpp

Issue 429313002: Add some debugging to PremulAlphaRoundTrip test. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 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 2011 Google Inc. 2 * Copyright 2011 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkConfig8888.h" 10 #include "SkConfig8888.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 canvas.readPixels(&readBmp1, 0, 0); 114 canvas.readPixels(&readBmp1, 0, 0);
115 sk_tool_utils::write_pixels(&canvas, readBmp1, 0, 0, gUnpremul[u pmaIdx].fColorType, 115 sk_tool_utils::write_pixels(&canvas, readBmp1, 0, 0, gUnpremul[u pmaIdx].fColorType,
116 kUnpremul_SkAlphaType); 116 kUnpremul_SkAlphaType);
117 canvas.readPixels(&readBmp2, 0, 0); 117 canvas.readPixels(&readBmp2, 0, 0);
118 118
119 bool success = true; 119 bool success = true;
120 for (int y = 0; y < 256 && success; ++y) { 120 for (int y = 0; y < 256 && success; ++y) {
121 const uint32_t* pixels1 = readBmp1.getAddr32(0, y); 121 const uint32_t* pixels1 = readBmp1.getAddr32(0, y);
122 const uint32_t* pixels2 = readBmp2.getAddr32(0, y); 122 const uint32_t* pixels2 = readBmp2.getAddr32(0, y);
123 for (int x = 0; x < 256 && success; ++x) { 123 for (int x = 0; x < 256 && success; ++x) {
124 // We see sporadic failures here. May help to see where it goes wrong.
125 if (pixels1[x] != pixels2[x]) {
126 SkDebugf("%x != %x, x = %d, y = %d\n", pixels1[x], p ixels2[x], x, y);
127 }
124 REPORTER_ASSERT(reporter, success = pixels1[x] == pixels 2[x]); 128 REPORTER_ASSERT(reporter, success = pixels1[x] == pixels 2[x]);
125 } 129 }
126 } 130 }
127 } 131 }
128 } 132 }
129 } 133 }
130 } 134 }
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