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

Unified Diff: src/effects/gradients/SkLinearGradient.cpp

Issue 113873008: remove unused SkFixed and SkFract functions (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 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/effects/gradients/SkLinearGradient.cpp
diff --git a/src/effects/gradients/SkLinearGradient.cpp b/src/effects/gradients/SkLinearGradient.cpp
index 5563a03f7e1d6ad5db84024396749568d4b22b01..70452962acb4a24425f15f708768d7a44a086193 100644
--- a/src/effects/gradients/SkLinearGradient.cpp
+++ b/src/effects/gradients/SkLinearGradient.cpp
@@ -377,6 +377,10 @@ void shadeSpan16_linear_repeat(TileProc proc, SkFixed dx, SkFixed fx,
}
}
+static bool fixed_nearly_zero(SkFixed x) {
+ return SkAbs32(x) < (SK_Fixed1 >> 12);
+}
+
void SkLinearGradient::shadeSpan16(int x, int y,
uint16_t* SK_RESTRICT dstC, int count) {
SkASSERT(count > 0);
@@ -402,7 +406,7 @@ void SkLinearGradient::shadeSpan16(int x, int y,
}
LinearShade16Proc shadeProc = shadeSpan16_linear_repeat;
- if (SkFixedNearlyZero(dx)) {
+ if (fixed_nearly_zero(dx)) {
shadeProc = shadeSpan16_linear_vertical;
} else if (SkShader::kClamp_TileMode == fTileMode) {
shadeProc = shadeSpan16_linear_clamp;

Powered by Google App Engine
This is Rietveld 408576698