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

Unified Diff: tests/WritePixelsTest.cpp

Issue 1257073003: Move draw on upload decision in GrGpu (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: more 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
« src/gpu/gl/GrGLGpu.cpp ('K') | « 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/WritePixelsTest.cpp
diff --git a/tests/WritePixelsTest.cpp b/tests/WritePixelsTest.cpp
index fa99d4c9ec025e0e1b23526b1c320640ad9930cb..95f790dec9eefaad80254469b1e5a65adefaa432 100644
--- a/tests/WritePixelsTest.cpp
+++ b/tests/WritePixelsTest.cpp
@@ -224,16 +224,16 @@ static bool check_write(skiatest::Reporter* reporter, SkCanvas* canvas, const Sk
bool mul = (kUnpremul_SkAlphaType == bmInfo.alphaType());
SkPMColor bmpPMColor = convert_to_PMColor(bmInfo.colorType(), bmInfo.alphaType(),
bmpColor8888);
- bool check = checkPixel(bmpPMColor, canvasPixel, mul);
- REPORTER_ASSERT(reporter, check);
- if (!check) {
+ if (!checkPixel(bmpPMColor, canvasPixel, mul)) {
+ ERRORF(reporter, "Expected canvas pixel at %d, %d to be 0x%08x, got 0x%08x. "
+ "Write performed premul: %d", cx, cy, bmpPMColor, canvasPixel, mul);
return false;
}
} else {
- bool check;
SkPMColor testColor = getCanvasColor(cx, cy);
- REPORTER_ASSERT(reporter, check = (canvasPixel == testColor));
- if (!check) {
+ if (canvasPixel != testColor) {
+ ERRORF(reporter, "Canvas pixel outside write rect at %d, %d changed."
+ " Should be 0x%08x, got 0x%08x. ", cx, cy, testColor, canvasPixel);
return false;
}
}
« src/gpu/gl/GrGLGpu.cpp ('K') | « src/gpu/gl/GrGLGpu.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698