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

Unified Diff: src/core/SkBitmapProcState.h

Issue 1529833003: Repeating SkBitmapProcState rounding bias (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: comments Created 5 years 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
Index: src/core/SkBitmapProcState.h
diff --git a/src/core/SkBitmapProcState.h b/src/core/SkBitmapProcState.h
index e6e7a3f393661ff729a2abecde11d62950b5e6a6..51750baef77ab55ab5d7d2c2edb5236076f069f3 100644
--- a/src/core/SkBitmapProcState.h
+++ b/src/core/SkBitmapProcState.h
@@ -25,17 +25,6 @@ typedef SkFixed3232 SkFractionalInt;
#define SkFixedToFractionalInt(x) SkFixedToFixed3232(x)
#define SkFractionalIntToInt(x) SkFixed3232ToInt(x)
-// Applying a fixed point (SkFixed, SkFractionalInt) epsilon bias ensures that the inverse-mapped
-// bitmap coordinates are rounded consistently WRT geometry. Note that we only have to do this
-// when the scale is positive - for negative scales we're already rounding in the right direction.
-static inline int bitmap_sampler_inv_bias(SkScalar scale) {
-#ifndef SK_SUPPORT_LEGACY_BITMAP_SAMPLER_BIAS
- return -(scale > 0);
-#else
- return 0;
-#endif
-}
-
class SkPaint;
struct SkBitmapProcState {
@@ -87,6 +76,12 @@ struct SkBitmapProcState {
SkPMColor fPaintPMColor; // chooseProcs - A8 config
SkFixed fInvSx; // chooseProcs
SkFixed fInvKy; // chooseProcs
+
+ // Epsilon bias to ensure inverse-mapped bitmap coordinates are rounded consistently WRT
+ // geometry. These are treated as SkFixed, but we only store the fractional part.
reed1 2015/12/16 16:25:03 We just need 0 or 1 for each, right? why using int
f(malita) 2015/12/16 16:45:55 The current impl also expects an explicit sign. W
+ int16_t fInvBiasX; // chooseProcs
+ int16_t fInvBiasY; // chooseProcs
+
uint16_t fAlphaScale; // chooseProcs
uint8_t fInvType; // chooseProcs
uint8_t fTileModeX; // CONSTRUCTOR

Powered by Google App Engine
This is Rietveld 408576698