aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBitmapProcState.h
diff options
context:
space:
mode:
authorGravatar fmalita <fmalita@chromium.org>2016-01-07 07:58:10 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-01-07 07:58:10 -0800
commitc070d1514ace6b672d5dbaaa3090d27698400f1f (patch)
treeffadc48f6afda6d84e97793039e72b1f024919da /src/core/SkBitmapProcState.h
parent247415969a9a5ed6c83cc09395472416c4b7de7f (diff)
Remove SK_SUPPORT_LEGACY_BITMAP_SAMPLER_BIAS
Diffstat (limited to 'src/core/SkBitmapProcState.h')
-rw-r--r--src/core/SkBitmapProcState.h11
1 files changed, 4 insertions, 7 deletions
diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
index 87bee35a25..3f1d699cf2 100644
--- a/src/core/SkBitmapProcState.h
+++ b/src/core/SkBitmapProcState.h
@@ -198,17 +198,14 @@ public:
SkIntToScalar(x) + SK_ScalarHalf,
SkIntToScalar(y) + SK_ScalarHalf, &pt);
-#ifndef SK_SUPPORT_LEGACY_BITMAP_SAMPLER_BIAS
// SkFixed epsilon bias to ensure inverse-mapped bitmap coordinates are rounded
// consistently WRT geometry. Note that we only need the bias for positive scales:
// for negative scales, the rounding is intrinsically correct.
// We scale it to persist SkFractionalInt -> SkFixed conversions.
- fX = SkScalarToFractionalInt(pt.x()) - SkFixedToFractionalInt(s.fInvMatrix.getScaleX() > 0);
- fY = SkScalarToFractionalInt(pt.y()) - SkFixedToFractionalInt(s.fInvMatrix.getScaleY() > 0);
-#else
- fX = SkScalarToFractionalInt(pt.x());
- fY = SkScalarToFractionalInt(pt.y());
-#endif
+ const SkFixed biasX = (s.fInvMatrix.getScaleX() > 0);
+ const SkFixed biasY = (s.fInvMatrix.getScaleY() > 0);
+ fX = SkScalarToFractionalInt(pt.x()) - SkFixedToFractionalInt(biasX);
+ fY = SkScalarToFractionalInt(pt.y()) - SkFixedToFractionalInt(biasY);
}
SkFractionalInt x() const { return fX; }