Index: src/effects/gradients/SkGradientShader.cpp |
diff --git a/src/effects/gradients/SkGradientShader.cpp b/src/effects/gradients/SkGradientShader.cpp |
index ada98590176dad65420c58b5cdf19f5107e6c36d..38e9210cb34c2addbf73f82e359c0dd290f07d6b 100644 |
--- a/src/effects/gradients/SkGradientShader.cpp |
+++ b/src/effects/gradients/SkGradientShader.cpp |
@@ -484,6 +484,18 @@ |
return x - (x >> 16); |
} |
+static inline U16CPU bitsTo16(unsigned x, const unsigned bits) { |
+ SkASSERT(x < (1U << bits)); |
+ if (6 == bits) { |
+ return (x << 10) | (x << 4) | (x >> 2); |
+ } |
+ if (8 == bits) { |
+ return (x << 8) | x; |
+ } |
+ sk_throw(); |
+ return 0; |
+} |
+ |
const uint16_t* SkGradientShaderBase::GradientShaderCache::getCache16() { |
SkOnce(&fCache16Inited, &fCache16Mutex, SkGradientShaderBase::GradientShaderCache::initCache16, |
this); |