aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/gpu/gl/GrGpuGL.cpp6
-rw-r--r--src/images/SkImageDecoder_libico.cpp2
-rw-r--r--src/opts/SkTextureCompression_opts_neon.cpp4
-rw-r--r--src/opts/SkTextureCompression_opts_neon.h2
-rw-r--r--src/pdf/SkPDFFont.cpp4
-rw-r--r--src/utils/SkTextureCompressor.cpp6
-rw-r--r--src/utils/SkTextureCompressor.h4
-rw-r--r--src/utils/SkTextureCompressor_ASTC.cpp10
-rw-r--r--src/utils/SkTextureCompressor_ASTC.h2
-rw-r--r--src/utils/SkTextureCompressor_LATC.cpp14
-rw-r--r--src/utils/SkTextureCompressor_LATC.h2
-rw-r--r--src/utils/SkTextureCompressor_R11EAC.cpp8
-rw-r--r--src/utils/SkTextureCompressor_R11EAC.h2
-rw-r--r--tests/ImageCacheTest.cpp2
-rw-r--r--tests/PackBitsTest.cpp10
-rw-r--r--tests/PathTest.cpp30
-rw-r--r--tests/ScalarTest.cpp2
-rw-r--r--tests/ToUnicodeTest.cpp2
18 files changed, 56 insertions, 56 deletions
diff --git a/src/gpu/gl/GrGpuGL.cpp b/src/gpu/gl/GrGpuGL.cpp
index c6cdbfab84..a22988b01b 100644
--- a/src/gpu/gl/GrGpuGL.cpp
+++ b/src/gpu/gl/GrGpuGL.cpp
@@ -718,7 +718,7 @@ bool GrGpuGL::uploadCompressedTexData(const GrSurfaceDesc& desc,
// Make sure that the width and height that we pass to OpenGL
// is a multiple of the block size.
- int dataSize = GrCompressedFormatDataSize(desc.fConfig, width, height);
+ size_t dataSize = GrCompressedFormatDataSize(desc.fConfig, width, height);
// We only need the internal format for compressed 2D textures.
GrGLenum internalFormat = 0;
@@ -734,7 +734,7 @@ bool GrGpuGL::uploadCompressedTexData(const GrSurfaceDesc& desc,
internalFormat,
width, height,
0, // border
- dataSize,
+ SkToInt(dataSize),
data));
GrGLenum error = check_alloc_error(desc, this->glInterface());
if (error != GR_GL_NO_ERROR) {
@@ -750,7 +750,7 @@ bool GrGpuGL::uploadCompressedTexData(const GrSurfaceDesc& desc,
left, top,
width, height,
internalFormat,
- dataSize,
+ SkToInt(dataSize),
data));
}
diff --git a/src/images/SkImageDecoder_libico.cpp b/src/images/SkImageDecoder_libico.cpp
index 5240d09b86..b9b5c6a453 100644
--- a/src/images/SkImageDecoder_libico.cpp
+++ b/src/images/SkImageDecoder_libico.cpp
@@ -229,7 +229,7 @@ SkImageDecoder::Result SkICOImageDecoder::onDecode(SkStream* stream, SkBitmap* b
//int colorsUsed = read4Bytes(buf, offset+32) //0 - might have an actual value though
//int colorsImportant = read4Bytes(buf, offset+36); //0
- int begin = offset + 40;
+ int begin = SkToInt(offset + 40);
//this array represents the colortable
//if i allow other types of bitmaps, it may actually be used as a part of the bitmap
SkPMColor* colors = NULL;
diff --git a/src/opts/SkTextureCompression_opts_neon.cpp b/src/opts/SkTextureCompression_opts_neon.cpp
index bd7469b84c..b3b5037b8c 100644
--- a/src/opts/SkTextureCompression_opts_neon.cpp
+++ b/src/opts/SkTextureCompression_opts_neon.cpp
@@ -147,7 +147,7 @@ static inline uint64x2_t fix_endianness(uint64x2_t x) {
}
#endif
-static void compress_r11eac_blocks(uint64_t* dst, const uint8_t* src, int rowBytes) {
+static void compress_r11eac_blocks(uint64_t* dst, const uint8_t* src, size_t rowBytes) {
// Try to avoid switching between vector and non-vector ops...
const uint8_t *const src1 = src;
@@ -208,7 +208,7 @@ static void compress_r11eac_blocks(uint64_t* dst, const uint8_t* src, int rowByt
}
bool CompressA8toR11EAC_NEON(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes) {
+ int width, int height, size_t rowBytes) {
// Since we're going to operate on 4 blocks at a time, the src width
// must be a multiple of 16. However, the height only needs to be a
diff --git a/src/opts/SkTextureCompression_opts_neon.h b/src/opts/SkTextureCompression_opts_neon.h
index dd5e75df57..ba66590ca3 100644
--- a/src/opts/SkTextureCompression_opts_neon.h
+++ b/src/opts/SkTextureCompression_opts_neon.h
@@ -9,6 +9,6 @@
#define SkTextureCompression_opts_neon_h_
bool CompressA8toR11EAC_NEON(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes);
+ int width, int height, size_t rowBytes);
#endif // SkTextureCompression_opts_neon_h_
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index 7d8b29bfc5..5d092e5db7 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -234,7 +234,7 @@ static SkData* handle_type1_stream(SkStream* srcStream, size_t* headerLen,
SkAutoTMalloc<uint8_t> buffer(length);
memcpy(buffer.get(), src, *headerLen);
- uint8_t* const resultData = &(buffer[*headerLen]);
+ uint8_t* const resultData = &(buffer[SkToInt(*headerLen)]);
const uint8_t* hexData = src + *headerLen;
const uint8_t* trailer = hexData + hexDataLen;
@@ -260,7 +260,7 @@ static SkData* handle_type1_stream(SkStream* srcStream, size_t* headerLen,
}
SkASSERT(outputOffset == *dataLen);
- uint8_t* const resultTrailer = &(buffer[*headerLen + outputOffset]);
+ uint8_t* const resultTrailer = &(buffer[SkToInt(*headerLen + outputOffset)]);
memcpy(resultTrailer, src + *headerLen + hexDataLen, *trailerLen);
return SkData::NewFromMalloc(buffer.detach(), length);
diff --git a/src/utils/SkTextureCompressor.cpp b/src/utils/SkTextureCompressor.cpp
index 799eadc84b..12621e118f 100644
--- a/src/utils/SkTextureCompressor.cpp
+++ b/src/utils/SkTextureCompressor.cpp
@@ -23,9 +23,9 @@
// Convert ETC1 functions to our function signatures
static bool compress_etc1_565(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes) {
+ int width, int height, size_t rowBytes) {
#ifndef SK_IGNORE_ETC1_SUPPORT
- return 0 == etc1_encode_image(src, width, height, 2, rowBytes, dst);
+ return 0 == etc1_encode_image(src, width, height, 2, SkToInt(rowBytes), dst);
#else
return false;
#endif
@@ -120,7 +120,7 @@ int GetCompressedDataSize(Format fmt, int width, int height) {
}
bool CompressBufferToFormat(uint8_t* dst, const uint8_t* src, SkColorType srcColorType,
- int width, int height, int rowBytes, Format format, bool opt) {
+ int width, int height, size_t rowBytes, Format format, bool opt) {
CompressionProc proc = NULL;
if (opt) {
proc = SkTextureCompressorGetPlatformProc(srcColorType, format);
diff --git a/src/utils/SkTextureCompressor.h b/src/utils/SkTextureCompressor.h
index d5c1d2557e..e35bc957ac 100644
--- a/src/utils/SkTextureCompressor.h
+++ b/src/utils/SkTextureCompressor.h
@@ -64,7 +64,7 @@ namespace SkTextureCompressor {
// large enough to hold width*height pixels. The dst data is expected to
// be large enough to hold the compressed data according to the format.
bool CompressBufferToFormat(uint8_t* dst, const uint8_t* src, SkColorType srcColorType,
- int width, int height, int rowBytes, Format format,
+ int width, int height, size_t rowBytes, Format format,
bool opt = true /* Use optimization if available */);
// Decompresses the given src data from the format specified into the
@@ -85,7 +85,7 @@ namespace SkTextureCompressor {
// are. The typedef is not meant to be used by clients of the API, but rather
// allows SIMD optimized compression functions to be implemented.
typedef bool (*CompressionProc)(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes);
+ int width, int height, size_t rowBytes);
// Returns true if there exists a blitter for the specified format.
inline bool ExistsBlitterForFormat(Format format) {
diff --git a/src/utils/SkTextureCompressor_ASTC.cpp b/src/utils/SkTextureCompressor_ASTC.cpp
index 7c77c6bcd6..7969359e98 100644
--- a/src/utils/SkTextureCompressor_ASTC.cpp
+++ b/src/utils/SkTextureCompressor_ASTC.cpp
@@ -134,14 +134,14 @@ static const int8_t k6x5To12x12Table[30][60] = {
// Returns the alpha value of a texel at position (x, y) from src.
// (x, y) are assumed to be in the range [0, 12).
-inline uint8_t GetAlpha(const uint8_t *src, int rowBytes, int x, int y) {
+inline uint8_t GetAlpha(const uint8_t *src, size_t rowBytes, int x, int y) {
SkASSERT(x >= 0 && x < 12);
SkASSERT(y >= 0 && y < 12);
SkASSERT(rowBytes >= 12);
return *(src + y*rowBytes + x);
}
-inline uint8_t GetAlphaTranspose(const uint8_t *src, int rowBytes, int x, int y) {
+inline uint8_t GetAlphaTranspose(const uint8_t *src, size_t rowBytes, int x, int y) {
return GetAlpha(src, rowBytes, y, x);
}
@@ -157,10 +157,10 @@ static inline void send_packing(uint8_t** dst, const uint64_t top, const uint64_
// Compresses an ASTC block, by looking up the proper contributions from
// k6x5To12x12Table and computing an index from the associated values.
-typedef uint8_t (*GetAlphaProc)(const uint8_t* src, int rowBytes, int x, int y);
+typedef uint8_t (*GetAlphaProc)(const uint8_t* src, size_t rowBytes, int x, int y);
template<GetAlphaProc getAlphaProc>
-static void compress_a8_astc_block(uint8_t** dst, const uint8_t* src, int rowBytes) {
+static void compress_a8_astc_block(uint8_t** dst, const uint8_t* src, size_t rowBytes) {
// Check for single color
bool constant = true;
const uint32_t firstInt = *(reinterpret_cast<const uint32_t*>(src));
@@ -2039,7 +2039,7 @@ struct CompressorASTC {
namespace SkTextureCompressor {
bool CompressA8To12x12ASTC(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes) {
+ int width, int height, size_t rowBytes) {
if (width < 0 || ((width % 12) != 0) || height < 0 || ((height % 12) != 0)) {
return false;
}
diff --git a/src/utils/SkTextureCompressor_ASTC.h b/src/utils/SkTextureCompressor_ASTC.h
index bdbe6305c6..1312ee9c74 100644
--- a/src/utils/SkTextureCompressor_ASTC.h
+++ b/src/utils/SkTextureCompressor_ASTC.h
@@ -15,7 +15,7 @@ class SkBlitter;
namespace SkTextureCompressor {
bool CompressA8To12x12ASTC(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes);
+ int width, int height, size_t rowBytes);
SkBlitter* CreateASTCBlitter(int width, int height, void* outputBuffer,
SkTBlitterAllocator *allocator);
diff --git a/src/utils/SkTextureCompressor_LATC.cpp b/src/utils/SkTextureCompressor_LATC.cpp
index 937aec809e..f0cf4a90ac 100644
--- a/src/utils/SkTextureCompressor_LATC.cpp
+++ b/src/utils/SkTextureCompressor_LATC.cpp
@@ -85,7 +85,7 @@ typedef uint64_t (*A84x4To64BitProc)(const uint8_t block[]);
// src pixels are divisible by 4, and copy 4x4 blocks one at a time
// for compression.
static bool compress_4x4_a8_to_64bit(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes,
+ int width, int height, size_t rowBytes,
A84x4To64BitProc proc) {
// Make sure that our data is well-formed enough to be considered for compression
if (0 == width || 0 == height || (width % 4) != 0 || (height % 4) != 0) {
@@ -350,15 +350,15 @@ static inline uint32_t convert_index(uint32_t x) {
return pack_index(x);
}
-typedef uint64_t (*PackIndicesProc)(const uint8_t* alpha, int rowBytes);
+typedef uint64_t (*PackIndicesProc)(const uint8_t* alpha, size_t rowBytes);
template<PackIndicesProc packIndicesProc>
-static void compress_a8_latc_block(uint8_t** dstPtr, const uint8_t* src, int rowBytes) {
+static void compress_a8_latc_block(uint8_t** dstPtr, const uint8_t* src, size_t rowBytes) {
*(reinterpret_cast<uint64_t*>(*dstPtr)) =
SkEndian_SwapLE64(0xFF | (packIndicesProc(src, rowBytes) << 16));
*dstPtr += 8;
}
-inline uint64_t PackRowMajor(const uint8_t *indices, int rowBytes) {
+inline uint64_t PackRowMajor(const uint8_t *indices, size_t rowBytes) {
uint64_t result = 0;
for (int i = 0; i < 4; ++i) {
const uint32_t idx = *(reinterpret_cast<const uint32_t*>(indices + i*rowBytes));
@@ -367,7 +367,7 @@ inline uint64_t PackRowMajor(const uint8_t *indices, int rowBytes) {
return result;
}
-inline uint64_t PackColumnMajor(const uint8_t *indices, int rowBytes) {
+inline uint64_t PackColumnMajor(const uint8_t *indices, size_t rowBytes) {
// !SPEED! Blarg, this is kind of annoying. SSE4 can make this
// a LOT faster.
uint8_t transposed[16];
@@ -381,7 +381,7 @@ inline uint64_t PackColumnMajor(const uint8_t *indices, int rowBytes) {
}
static bool compress_4x4_a8_latc(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes) {
+ int width, int height, size_t rowBytes) {
if (width < 0 || ((width % 4) != 0) || height < 0 || ((height % 4) != 0)) {
return false;
@@ -472,7 +472,7 @@ struct CompressorLATC {
namespace SkTextureCompressor {
-bool CompressA8ToLATC(uint8_t* dst, const uint8_t* src, int width, int height, int rowBytes) {
+bool CompressA8ToLATC(uint8_t* dst, const uint8_t* src, int width, int height, size_t rowBytes) {
#if COMPRESS_LATC_FAST
return compress_4x4_a8_latc(dst, src, width, height, rowBytes);
#elif COMPRESS_LATC_SLOW
diff --git a/src/utils/SkTextureCompressor_LATC.h b/src/utils/SkTextureCompressor_LATC.h
index e41a249e2a..85647eafcc 100644
--- a/src/utils/SkTextureCompressor_LATC.h
+++ b/src/utils/SkTextureCompressor_LATC.h
@@ -15,7 +15,7 @@ class SkBlitter;
namespace SkTextureCompressor {
bool CompressA8ToLATC(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes);
+ int width, int height, size_t rowBytes);
SkBlitter* CreateLATCBlitter(int width, int height, void* outputBuffer,
SkTBlitterAllocator *allocator);
diff --git a/src/utils/SkTextureCompressor_R11EAC.cpp b/src/utils/SkTextureCompressor_R11EAC.cpp
index 43226e0c99..c7edf37183 100644
--- a/src/utils/SkTextureCompressor_R11EAC.cpp
+++ b/src/utils/SkTextureCompressor_R11EAC.cpp
@@ -275,7 +275,7 @@ static uint64_t compress_r11eac_block(const uint8_t block[16]) {
typedef uint64_t (*A84x4To64BitProc)(const uint8_t block[]);
static bool compress_4x4_a8_to_64bit(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes,
+ int width, int height, size_t rowBytes,
A84x4To64BitProc proc) {
// Make sure that our data is well-formed enough to be considered for compression
if (0 == width || 0 == height || (width % 4) != 0 || (height % 4) != 0) {
@@ -421,7 +421,7 @@ static inline uint64_t interleave6(uint64_t topRows, uint64_t bottomRows) {
// This function follows the same basic procedure as compress_heterogeneous_r11eac_block
// above when COMPRESS_R11_EAC_FAST is defined, but it avoids a few loads/stores and
// tries to optimize where it can using SIMD.
-static uint64_t compress_r11eac_block_fast(const uint8_t* src, int rowBytes) {
+static uint64_t compress_r11eac_block_fast(const uint8_t* src, size_t rowBytes) {
// Store each row of alpha values in an integer
const uint32_t alphaRow1 = *(reinterpret_cast<const uint32_t*>(src));
const uint32_t alphaRow2 = *(reinterpret_cast<const uint32_t*>(src + rowBytes));
@@ -462,7 +462,7 @@ static uint64_t compress_r11eac_block_fast(const uint8_t* src, int rowBytes) {
}
static bool compress_a8_to_r11eac_fast(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes) {
+ int width, int height, size_t rowBytes) {
// Make sure that our data is well-formed enough to be considered for compression
if (0 == width || 0 == height || (width % 4) != 0 || (height % 4) != 0) {
return false;
@@ -619,7 +619,7 @@ struct CompressorR11EAC {
namespace SkTextureCompressor {
-bool CompressA8ToR11EAC(uint8_t* dst, const uint8_t* src, int width, int height, int rowBytes) {
+bool CompressA8ToR11EAC(uint8_t* dst, const uint8_t* src, int width, int height, size_t rowBytes) {
#if (COMPRESS_R11_EAC_SLOW) || (COMPRESS_R11_EAC_FAST)
diff --git a/src/utils/SkTextureCompressor_R11EAC.h b/src/utils/SkTextureCompressor_R11EAC.h
index 6786513b67..abaabfb363 100644
--- a/src/utils/SkTextureCompressor_R11EAC.h
+++ b/src/utils/SkTextureCompressor_R11EAC.h
@@ -15,7 +15,7 @@ class SkBlitter;
namespace SkTextureCompressor {
bool CompressA8ToR11EAC(uint8_t* dst, const uint8_t* src,
- int width, int height, int rowBytes);
+ int width, int height, size_t rowBytes);
SkBlitter* CreateR11EACBlitter(int width, int height, void* outputBuffer,
SkTBlitterAllocator* allocator);
diff --git a/tests/ImageCacheTest.cpp b/tests/ImageCacheTest.cpp
index eaf3f2811f..c34f9d97e9 100644
--- a/tests/ImageCacheTest.cpp
+++ b/tests/ImageCacheTest.cpp
@@ -56,7 +56,7 @@ static void test_cache(skiatest::Reporter* reporter, SkResourceCache& cache, boo
if (testPurge) {
// stress test, should trigger purges
- for (size_t i = 0; i < COUNT * 100; ++i) {
+ for (int i = 0; i < COUNT * 100; ++i) {
TestingKey key(i);
cache.add(SkNEW_ARGS(TestingRec, (key, i)));
}
diff --git a/tests/PackBitsTest.cpp b/tests/PackBitsTest.cpp
index 2af4f1867d..ce4e8be467 100644
--- a/tests/PackBitsTest.cpp
+++ b/tests/PackBitsTest.cpp
@@ -43,7 +43,7 @@ static void test_pack16(skiatest::Reporter* reporter) {
}
for (int n = 1000; n; n--) {
- size_t size = 50;
+ int size = 50;
uint16_t src[100], src2[100];
uint8_t dst[200];
rand_fill(src, size);
@@ -52,7 +52,7 @@ static void test_pack16(skiatest::Reporter* reporter) {
size_t maxSize = SkPackBits::ComputeMaxSize16(size);
REPORTER_ASSERT(reporter, maxSize >= dstSize);
- size_t srcCount = SkPackBits::Unpack16(dst, dstSize, src2);
+ int srcCount = SkPackBits::Unpack16(dst, dstSize, src2);
REPORTER_ASSERT(reporter, size == srcCount);
bool match = memcmp(src, src2, size * sizeof(uint16_t)) == 0;
REPORTER_ASSERT(reporter, match);
@@ -96,7 +96,7 @@ static void test_pack8(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, match);
}
- for (size_t size = 1; size <= 512; size += 1) {
+ for (uint32_t size = 1; size <= 512; size += 1) {
for (int n = 100; n; n--) {
uint8_t src[600], src2[600];
uint8_t dst[600];
@@ -112,8 +112,8 @@ static void test_pack8(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, match);
for (int j = 0; j < 100; j++) {
- size_t skip = gRand.nextU() % size;
- size_t write = gRand.nextU() % size;
+ uint32_t skip = gRand.nextU() % size;
+ uint32_t write = gRand.nextU() % size;
if (skip + write > size) {
write = size - skip;
}
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index d09f8a2b30..1a74682e54 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -787,7 +787,7 @@ static void test_addPoly(skiatest::Reporter* reporter) {
for (int doClose = 0; doClose <= 1; ++doClose) {
for (size_t count = 1; count <= SK_ARRAY_COUNT(pts); ++count) {
SkPath path;
- path.addPoly(pts, count, SkToBool(doClose));
+ path.addPoly(pts, SkToInt(count), SkToBool(doClose));
test_poly(reporter, path, pts, SkToBool(doClose));
}
}
@@ -1706,7 +1706,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
struct IsRectTest {
SkPoint *fPoints;
- size_t fPointCount;
+ int fPointCount;
bool fClose;
bool fIsRect;
} tests[] = {
@@ -1748,7 +1748,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
};
const size_t testCount = SK_ARRAY_COUNT(tests);
- size_t index;
+ int index;
for (size_t testIndex = 0; testIndex < testCount; ++testIndex) {
SkPath path;
path.moveTo(tests[testIndex].fPoints[0].fX, tests[testIndex].fPoints[0].fY);
@@ -1803,7 +1803,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, close then line
SkPath path1;
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.lineTo(r1[index].fX, r1[index].fY);
}
path1.close();
@@ -1813,7 +1813,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, move in the middle
path1.reset();
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.moveTo(1, .5f);
}
@@ -1824,7 +1824,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, move on the edge
path1.reset();
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.moveTo(r1[index - 1].fX, r1[index - 1].fY);
path1.lineTo(r1[index].fX, r1[index].fY);
}
@@ -1834,7 +1834,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, quad
path1.reset();
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.quadTo(1, .5f, 1, .5f);
}
@@ -1846,7 +1846,7 @@ static void test_isRect(skiatest::Reporter* reporter) {
// fail, cubic
path1.reset();
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.cubicTo(1, .5f, 1, .5f, 1, .5f);
}
@@ -1889,7 +1889,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
struct IsNestedRectTest {
SkPoint *fPoints;
- size_t fPointCount;
+ int fPointCount;
SkPath::Direction fDirection;
bool fClose;
bool fIsNestedRect; // nests with path.addRect(-1, -1, 2, 2);
@@ -1923,7 +1923,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
};
const size_t testCount = SK_ARRAY_COUNT(tests);
- size_t index;
+ int index;
for (int rectFirst = 0; rectFirst <= 1; ++rectFirst) {
for (size_t testIndex = 0; testIndex < testCount; ++testIndex) {
SkPath path;
@@ -1968,7 +1968,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.lineTo(r1[index].fX, r1[index].fY);
}
path1.close();
@@ -1984,7 +1984,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.moveTo(1, .5f);
}
@@ -2001,7 +2001,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
if (rectFirst) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
path1.moveTo(r1[index - 1].fX, r1[index - 1].fY);
path1.lineTo(r1[index].fX, r1[index].fY);
}
@@ -2017,7 +2017,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.quadTo(1, .5f, 1, .5f);
}
@@ -2035,7 +2035,7 @@ static void test_isNestedRects(skiatest::Reporter* reporter) {
path1.addRect(-1, -1, 2, 2, SkPath::kCW_Direction);
}
path1.moveTo(r1[0].fX, r1[0].fY);
- for (index = 1; index < SK_ARRAY_COUNT(r1); ++index) {
+ for (index = 1; index < SkToInt(SK_ARRAY_COUNT(r1)); ++index) {
if (index == 2) {
path1.cubicTo(1, .5f, 1, .5f, 1, .5f);
}
diff --git a/tests/ScalarTest.cpp b/tests/ScalarTest.cpp
index b6f71d19bc..f2f924e4ff 100644
--- a/tests/ScalarTest.cpp
+++ b/tests/ScalarTest.cpp
@@ -54,7 +54,7 @@ static void test_isRectFinite(skiatest::Reporter* reporter) {
static const struct {
const SkPoint* fPts;
- size_t fCount;
+ int fCount;
bool fIsFinite;
} gSets[] = {
{ gF0, SK_ARRAY_COUNT(gF0), true },
diff --git a/tests/ToUnicodeTest.cpp b/tests/ToUnicodeTest.cpp
index 919ba11f58..33fcc80ef7 100644
--- a/tests/ToUnicodeTest.cpp
+++ b/tests/ToUnicodeTest.cpp
@@ -149,7 +149,7 @@ endbfrange\n";
// I n s t a l
// Glyph id 2c 51 56 57 44 4f
// Unicode 49 6e 73 74 61 6c
- for (size_t i = 0; i < 100; ++i) {
+ for (SkUnichar i = 0; i < 100; ++i) {
glyphToUnicode.push(i + 29);
}