| Index: src/core/SkBitmapProcState.h
|
| diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
|
| index 87bee35a252fb4b186d4f5fc3d1a5d37e36b6cfa..3f1d699cf22be6203c1430c5b789f1fd1b5806c3 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; }
|
|
|