aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapProcState.cpp
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2015-12-15 06:48:48 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2015-12-15 06:48:48 -0800
commitaed4d32de937a8f2733924eb848cc287e8d04087 (patch)
tree0c7708b50a7459708dc3f9a9613b6900a292d3b5 /src/core/SkBitmapProcState.cpp
parent11f457e1627be775cfa26d71307dbd6073f9269c (diff)
SkBitmapProcState rounding bias
Epsilon bias to keep bitmap sample rounding consistent with geometry rounding. Also update the GM to draw an outer border + drop uninteresting scales in favor of negative scale variants. BUG=skia:4680,skia:4649 R=reed@google.com,caryclark@google.com,mtklein@google.com Review URL: https://codereview.chromium.org/1527633002
Diffstat (limited to 'src/core/SkBitmapProcState.cpp')
-rw-r--r--src/core/SkBitmapProcState.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 5ec6721436..487bd80402 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -823,10 +823,12 @@ void Clamp_S32_opaque_D32_nofilter_DX_shaderproc(const SkBitmapProcState& s, in
SkPoint pt;
s.fInvProc(s.fInvMatrix, SkIntToScalar(x) + SK_ScalarHalf, SkIntToScalar(y) + SK_ScalarHalf,
&pt);
- fx = SkScalarToFractionalInt(pt.fY);
+ fx = SkScalarToFractionalInt(pt.fY)
+ + bitmap_sampler_inv_bias(s.fInvMatrix.getScaleY());
const unsigned maxY = s.fPixmap.height() - 1;
dstY = SkClampMax(SkFractionalIntToInt(fx), maxY);
- fx = SkScalarToFractionalInt(pt.fX);
+ fx = SkScalarToFractionalInt(pt.fX)
+ + bitmap_sampler_inv_bias(s.fInvMatrix.getScaleX());
}
const SkPMColor* SK_RESTRICT src = s.fPixmap.addr32(0, dstY);