Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(128)

Unified Diff: src/core/SkBitmapProcState.h

Issue 1568893002: Remove SK_SUPPORT_LEGACY_BITMAP_SAMPLER_BIAS (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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; }
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698