aboutsummaryrefslogtreecommitdiffhomepage
path: root/gm
diff options
context:
space:
mode:
authorGravatar Chris Dalton <csmartdalton@google.com>2017-06-06 17:20:43 -0600
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-06-07 16:41:37 +0000
commitb246b9407f9d95ff125086a622ad3dc705beb450 (patch)
treebbaa988dd072767bc1479ba846ee5f6256936a0a /gm
parent91f0f7332f37de42ee2fc417fb401af3a4e9dfde (diff)
Fix croppedrects GM
The stroke-to-rect test was accidentally doing both non-aa draws and non-filtered texture sampling on exact half pixel boundaries. So sometimes the CPU and GPU rounded in different directions. This CL updates the draws and sampling to fall on integer boundaries. Bug: skia:5522 Change-Id: If968bcbb327106eba8919e4abf3a7211c5326daf Reviewed-on: https://skia-review.googlesource.com/18960 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Chris Dalton <csmartdalton@google.com>
Diffstat (limited to 'gm')
-rw-r--r--gm/croppedrects.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/gm/croppedrects.cpp b/gm/croppedrects.cpp
index 006e3d3dec..d6002d39f5 100644
--- a/gm/croppedrects.cpp
+++ b/gm/croppedrects.cpp
@@ -88,8 +88,9 @@ private:
paint.setStrokeWidth(2 * kSrcImageClip.height());
paint.setShader(fSrcImageShader);
paint.setFilterQuality(kNone_SkFilterQuality);
- canvas->translate(-90, 263);
+ canvas->translate(23, 301);
canvas->scale(300 / kSrcImageClip.width(), 100 / kSrcImageClip.height());
+ canvas->translate(-kSrcImageClip.left(), -kSrcImageClip.top());
canvas->clipRect(kSrcImageClip);
canvas->drawPath(path, paint);
}