Update showmiplevel gm to round coords the same for both variations of the GM

The versions of showmiplevel that take both a width and height, round the
coords of draws to integers. The basic version did not do this which caused
sampling bugs on adreno when using nearest neighbor at half pixel coords.

Since this GM isn't testing the GPU rendering of the mips, this workaround is
okay.


Bug: skia:5905
Change-Id: I4080532e8c1f37d74c60089970c5d0fc83cd5373
Reviewed-on: https://skia-review.googlesource.com/18939
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
This commit is contained in:
Greg Daniel 2017-06-07 10:01:48 -04:00 committed by Skia Commit-Bot
parent b53f48cfec
commit 7785dd235d

View File

@ -201,7 +201,10 @@ protected:
canvas->translate(4, 4);
for (const auto& bm : fBM) {
this->drawSet(canvas, bm);
canvas->translate(0, bm.height() * 0.85f);
// round so we always produce an integral translate, so the GOLD tool won't show
// unimportant diffs if this is drawn on a GPU with different rounding rules
// since we draw the bitmaps using nearest-neighbor
canvas->translate(0, SkScalarRoundToScalar(bm.height() * 0.85f));
}
}