From 70039d8c96085001ac59ff28c4bde476c8fd30cf Mon Sep 17 00:00:00 2001 From: Nigel Tao Date: Sat, 28 Jul 2018 17:12:35 +1000 Subject: Remove SkFastMin32 SkFastMin32 has been the same as SkMin32 since commit 38bad32cf52 "fold SK_CPU_HAS_CONDITION_INSTR through as always defined" was submitted in July 2013 as per https://chromiumcodereview.appspot.com/21122005 TBR=hcm@google.com The only change to the public API is removing a redundant helper from SkTypes.h Bug: skia: Change-Id: Ic6f7c7dc5612e8b7b1be3923f572ffcc13555d75 Reviewed-on: https://skia-review.googlesource.com/144242 Commit-Queue: Leon Scroggins Reviewed-by: Leon Scroggins --- include/core/SkTypes.h | 7 ------- src/core/SkBlitter.cpp | 12 ++++++------ src/core/SkRegion_path.cpp | 2 +- src/core/SkScalerContext.cpp | 4 ++-- src/effects/SkEmbossMask.cpp | 2 +- 5 files changed, 10 insertions(+), 17 deletions(-) diff --git a/include/core/SkTypes.h b/include/core/SkTypes.h index 515aaabac5..95ee208ed6 100644 --- a/include/core/SkTypes.h +++ b/include/core/SkTypes.h @@ -207,13 +207,6 @@ template constexpr const T& SkTClamp(const T& x, const T& lo, const return (x < lo) ? lo : SkTMin(x, hi); } -static inline int32_t SkFastMin32(int32_t value, int32_t max) { - if (value > max) { - value = max; - } - return value; -} - /** @return value pinned (clamped) between min and max, inclusively. */ template static constexpr const T& SkTPin(const T& value, const T& min, const T& max) { diff --git a/src/core/SkBlitter.cpp b/src/core/SkBlitter.cpp index 7a45981b80..52c2370ae7 100644 --- a/src/core/SkBlitter.cpp +++ b/src/core/SkBlitter.cpp @@ -822,9 +822,9 @@ public: unsigned mul = SkAlpha255To256(mulp[i]); unsigned add = addp[i]; - r = SkFastMin32(SkAlphaMul(r, mul) + add, a); - g = SkFastMin32(SkAlphaMul(g, mul) + add, a); - b = SkFastMin32(SkAlphaMul(b, mul) + add, a); + r = SkMin32(SkAlphaMul(r, mul) + add, a); + g = SkMin32(SkAlphaMul(g, mul) + add, a); + b = SkMin32(SkAlphaMul(b, mul) + add, a); span[i] = SkPackARGB32(a, r, g, b); } @@ -843,9 +843,9 @@ public: unsigned add = addp[i]; span[i] = SkPackARGB32( a, - SkFastMin32(SkAlphaMul(r, mul) + add, a), - SkFastMin32(SkAlphaMul(g, mul) + add, a), - SkFastMin32(SkAlphaMul(b, mul) + add, a)); + SkMin32(SkAlphaMul(r, mul) + add, a), + SkMin32(SkAlphaMul(g, mul) + add, a), + SkMin32(SkAlphaMul(b, mul) + add, a)); } else { span[i] = 0; } diff --git a/src/core/SkRegion_path.cpp b/src/core/SkRegion_path.cpp index e54e251fa9..346a37dcc8 100644 --- a/src/core/SkRegion_path.cpp +++ b/src/core/SkRegion_path.cpp @@ -413,7 +413,7 @@ struct Edge { } int top() const { - return SkFastMin32(fY0, fY1); + return SkMin32(fY0, fY1); } }; diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 3089ee9755..872d3a5cc9 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -515,8 +515,8 @@ void SkScalerContext::getImage(const SkGlyph& origGlyph) { fRec.getMatrixFrom2x2(&matrix); if (as_MFB(fMaskFilter)->filterMask(&dstM, srcM, matrix, nullptr)) { - int width = SkFastMin32(origGlyph.fWidth, dstM.fBounds.width()); - int height = SkFastMin32(origGlyph.fHeight, dstM.fBounds.height()); + int width = SkMin32(origGlyph.fWidth, dstM.fBounds.width()); + int height = SkMin32(origGlyph.fHeight, dstM.fBounds.height()); int dstRB = origGlyph.rowBytes(); int srcRB = dstM.fRowBytes; diff --git a/src/effects/SkEmbossMask.cpp b/src/effects/SkEmbossMask.cpp index d4e3741392..c45745db57 100644 --- a/src/effects/SkEmbossMask.cpp +++ b/src/effects/SkEmbossMask.cpp @@ -80,7 +80,7 @@ void SkEmbossMask::Emboss(SkMask* mask, const SkEmbossMaskFilter::Light& light) int denom = SkSqrt32(nx * nx + ny * ny + kDelta*kDelta); SkFixed dot = numer / denom; dot >>= 8; // now dot is 2^8 instead of 2^16 - mul = SkFastMin32(mul + dot, 255); + mul = SkMin32(mul + dot, 255); // now for the reflection -- cgit v1.2.3