OLD | NEW |
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 Loading... |
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 } |
OLD | NEW |