if (!clippedSrcRect.intersect(srcRect)) {
clippedSrcRect.setEmpty();
}
- bool failed = false;
SkAutoLockPixels alp(bitmap);
intptr_t pixels = reinterpret_cast<intptr_t>(bitmap.getPixels());
for (int by = 0; by < bh; ++by) {
bool check;
REPORTER_ASSERT(reporter, check = checkPixel(pmPixel, canvasPixel, didPremul));
if (!check) {
- failed = true;
+ return false;
}
}
} else if (checkBitmapPixels) {
REPORTER_ASSERT(reporter, getBitmapColor(bx, by, bw, bh) == pixel);
if (getBitmapColor(bx, by, bw, bh) != pixel) {
- failed = true;
+ return false;
}
}
}
}
- return !failed;
+ return true;
}
enum BitmapInit {
intptr_t canvasPixels = reinterpret_cast<intptr_t>(devBmp.getPixels());
size_t canvasRowBytes = devBmp.rowBytes();
SkIRect writeRect = SkIRect::MakeXYWH(writeX, writeY, bitmap.width(), bitmap.height());
- bool success = true;
for (int cy = 0; cy < DEV_H; ++cy) {
const SkPMColor* canvasRow = reinterpret_cast<const SkPMColor*>(canvasPixels);
for (int cx = 0; cx < DEV_W; ++cx) {
bool check;
REPORTER_ASSERT(reporter, check = checkPixel(bmpPMColor, canvasPixel, mul));
if (!check) {
- success = false;
+ return false;
}
} else {
bool check;
SkPMColor testColor = getCanvasColor(cx, cy);
REPORTER_ASSERT(reporter, check = (canvasPixel == testColor));
if (!check) {
- success = false;
+ return false;
}
}
}
bool check;
REPORTER_ASSERT(reporter, check = (pad[px] == static_cast<char>(DEV_PAD)));
if (!check) {
- success = false;
+ return false;
}
}
}
canvasPixels += canvasRowBytes;
}
- return success;
+ return true;
}
enum DevType {