aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm/showmiplevels.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2017-06-07 10:01:48 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-07 14:33:26 +0000
commit7785dd235d50e51f80bc4bb82639b0ffb29540b5 (patch)
treedcb2b9cd6fa2ffdcc92814d6da20f0edd6d211a4 /gm/showmiplevels.cpp
parentb53f48cfec64830fa506267487a1037d27acb474 (diff)
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>
Diffstat (limited to 'gm/showmiplevels.cpp')
-rw-r--r--gm/showmiplevels.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/gm/showmiplevels.cpp b/gm/showmiplevels.cpp
index 3e2091fd6b..57df948536 100644
--- a/gm/showmiplevels.cpp
+++ b/gm/showmiplevels.cpp
@@ -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));
}
}