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

Unified Diff: src/effects/SkPackBits.cpp

Issue 1722173003: Move SkPackBits to src/effects. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix win64 warnings. Created 4 years, 10 months 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
« no previous file with comments | « src/effects/SkPackBits.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/effects/SkPackBits.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698