Index: src/effects/SkPackBits.cpp |
diff --git a/src/core/SkPackBits.cpp b/src/effects/SkPackBits.cpp |
similarity index 93% |
rename from src/core/SkPackBits.cpp |
rename to src/effects/SkPackBits.cpp |
index a3424e2bdcbe5cd13b0816d07869ad1c2af24b27..286d9d140c23635f3fcf4cbe241a93e2dc40f1a1 100644 |
--- a/src/core/SkPackBits.cpp |
+++ b/src/effects/SkPackBits.cpp |
@@ -6,14 +6,14 @@ |
*/ |
#include "SkPackBits.h" |
-size_t SkPackBits::ComputeMaxSize8(int count) { |
+size_t SkPackBits::ComputeMaxSize8(size_t srcSize) { |
// worst case is the number of 8bit values + 1 byte per (up to) 128 entries. |
- return ((count + 127) >> 7) + count; |
+ return ((srcSize + 127) >> 7) + srcSize; |
} |
static uint8_t* flush_same8(uint8_t dst[], uint8_t value, size_t count) { |
while (count > 0) { |
- int n = count > 128 ? 128 : count; |
+ size_t n = count > 128 ? 128 : count; |
*dst++ = (uint8_t)(n - 1); |
*dst++ = (uint8_t)value; |
count -= n; |
@@ -24,7 +24,7 @@ static uint8_t* flush_same8(uint8_t dst[], uint8_t value, size_t count) { |
static uint8_t* flush_diff8(uint8_t* SK_RESTRICT dst, |
const uint8_t* SK_RESTRICT src, size_t count) { |
while (count > 0) { |
- int n = count > 128 ? 128 : count; |
+ size_t n = count > 128 ? 128 : count; |
*dst++ = (uint8_t)(n + 127); |
memcpy(dst, src, n); |
src += n; |
@@ -78,8 +78,6 @@ size_t SkPackBits::Pack8(const uint8_t* SK_RESTRICT src, size_t srcSize, |
return dst - origDst; |
} |
-#include "SkUtils.h" |
- |
int SkPackBits::Unpack8(const uint8_t* SK_RESTRICT src, size_t srcSize, |
uint8_t* SK_RESTRICT dst, size_t dstSize) { |
uint8_t* const origDst = dst; |