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

Unified Diff: tests/ReadPixelsTest.cpp

Issue 1255483005: Attempt to somewhat simplify GrContext::readSurfacePixels interaction with GrGpu. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Address comments Created 5 years, 5 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 | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/ReadPixelsTest.cpp
diff --git a/tests/ReadPixelsTest.cpp b/tests/ReadPixelsTest.cpp
index 9e9f53c7992995875900e956ba93cca989450421..b94be0eba88f939e6f0f3bcf2ab3596b6d3c7d2b 100644
--- a/tests/ReadPixelsTest.cpp
+++ b/tests/ReadPixelsTest.cpp
@@ -198,15 +198,17 @@ static bool check_read(skiatest::Reporter* reporter,
SkPMColor canvasPixel = get_src_color(devx, devy);
bool didPremul;
SkPMColor pmPixel = convert_to_pmcolor(ct, at, pixel, &didPremul);
- bool check = check_read_pixel(pmPixel, canvasPixel, didPremul);
- REPORTER_ASSERT(reporter, check);
- if (!check) {
+ if (!check_read_pixel(pmPixel, canvasPixel, didPremul)) {
+ ERRORF(reporter, "Expected readback pixel value 0x%08x, got 0x%08x. "
+ "Readback was unpremul: %d", canvasPixel, pmPixel, didPremul);
return false;
}
}
} else if (checkBitmapPixels) {
- REPORTER_ASSERT(reporter, get_dst_bmp_init_color(bx, by, bw) == *pixel);
- if (get_dst_bmp_init_color(bx, by, bw) != *pixel) {
+ uint32_t origDstPixel = get_dst_bmp_init_color(bx, by, bw);
+ if (origDstPixel != *pixel) {
+ ERRORF(reporter, "Expected clipped out area of readback to be unchanged. "
+ "Expected 0x%08x, got 0x%08x", origDstPixel, *pixel);
return false;
}
}
« no previous file with comments | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698