Rename SkBitmapProcStateAutoMapper methods
x(),y() -> fractionalIntX(), fractionalIntY()
(to clarify the return type)
Also add fixed & int helpers.
R=reed@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1666433003
CQ_EXTRA_TRYBOTS=client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot
Review URL: https://codereview.chromium.org/1666433003
diff --git a/src/core/SkBitmapProcState.cpp b/src/core/SkBitmapProcState.cpp
index 7128242..7c37a15 100644
--- a/src/core/SkBitmapProcState.cpp
+++ b/src/core/SkBitmapProcState.cpp
@@ -500,9 +500,9 @@
// its own tiling and sampling we need to undo that here.
if (SkShader::kClamp_TileMode != s.fTileModeX ||
SkShader::kClamp_TileMode != s.fTileModeY) {
- yTemp = SkFractionalIntToInt(mapper.y() * s.fPixmap.height());
+ yTemp = SkFractionalIntToInt(mapper.fractionalIntY() * s.fPixmap.height());
} else {
- yTemp = SkFractionalIntToInt(mapper.y());
+ yTemp = mapper.intY();
}
} else {
yTemp = s.fFilterOneY + y;
@@ -530,9 +530,9 @@
if (s.fInvType > SkMatrix::kTranslate_Mask &&
(SkShader::kClamp_TileMode != s.fTileModeX ||
SkShader::kClamp_TileMode != s.fTileModeY)) {
- iY2 = SkFractionalIntToInt(mapper.y() * s.fPixmap.height());
+ iY2 = SkFractionalIntToInt(mapper.fractionalIntY() * s.fPixmap.height());
} else {
- iY2 = SkFractionalIntToInt(mapper.y());
+ iY2 = mapper.intY();
}
switch (s.fTileModeY) {
@@ -598,8 +598,8 @@
// Since we know we're not filtered, we re-purpose these fields allow
// us to go from device -> src coordinates w/ just an integer add,
// rather than running through the inverse-matrix
- fFilterOneX = SkFractionalIntToInt(mapper.x());
- fFilterOneY = SkFractionalIntToInt(mapper.y());
+ fFilterOneX = mapper.intX();
+ fFilterOneY = mapper.intY();
return true;
}
@@ -781,8 +781,8 @@
{
const SkBitmapProcStateAutoMapper mapper(s, x, y);
const unsigned maxY = s.fPixmap.height() - 1;
- dstY = SkClampMax(SkFractionalIntToInt(mapper.y()), maxY);
- fx = mapper.x();
+ dstY = SkClampMax(mapper.intY(), maxY);
+ fx = mapper.fractionalIntX();
}
const SkPMColor* SK_RESTRICT src = s.fPixmap.addr32(0, dstY);