aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--bench/BitmapRectBench.cpp4
-rw-r--r--gm/bitmaprect.cpp6
-rw-r--r--gm/fatpathfill.cpp3
-rw-r--r--gm/modecolorfilters.cpp6
-rw-r--r--gm/tilemodes.cpp2
-rw-r--r--include/utils/SkRunnable.h1
-rw-r--r--src/effects/SkColorMatrixFilter.cpp2
-rw-r--r--src/utils/SkMatrix44.cpp10
-rw-r--r--tests/MatrixTest.cpp3
-rw-r--r--tests/RoundRectTest.cpp10
10 files changed, 26 insertions, 21 deletions
diff --git a/bench/BitmapRectBench.cpp b/bench/BitmapRectBench.cpp
index b9e71f753b..4391626d89 100644
--- a/bench/BitmapRectBench.cpp
+++ b/bench/BitmapRectBench.cpp
@@ -59,8 +59,8 @@ public:
fBitmap.eraseColor(SK_ColorBLACK);
drawIntoBitmap(fBitmap);
- fSrcR.set(0, 0, w, h);
- fDstR.set(0, 0, w, h);
+ fSrcR.iset(0, 0, w, h);
+ fDstR.iset(0, 0, w, h);
}
protected:
diff --git a/gm/bitmaprect.cpp b/gm/bitmaprect.cpp
index 4af6f0bd7d..9c6d472b57 100644
--- a/gm/bitmaprect.cpp
+++ b/gm/bitmaprect.cpp
@@ -94,9 +94,9 @@ static void make_3x3_bitmap(SkBitmap* bitmap) {
static const int gYSize = 3;
SkColor textureData[gXSize][gYSize] = {
- SK_ColorRED, SK_ColorWHITE, SK_ColorBLUE,
- SK_ColorGREEN, SK_ColorBLACK, SK_ColorCYAN,
- SK_ColorYELLOW, SK_ColorGRAY, SK_ColorMAGENTA
+ { SK_ColorRED, SK_ColorWHITE, SK_ColorBLUE },
+ { SK_ColorGREEN, SK_ColorBLACK, SK_ColorCYAN },
+ { SK_ColorYELLOW, SK_ColorGRAY, SK_ColorMAGENTA }
};
diff --git a/gm/fatpathfill.cpp b/gm/fatpathfill.cpp
index c86dfcb6af..c583d64a45 100644
--- a/gm/fatpathfill.cpp
+++ b/gm/fatpathfill.cpp
@@ -81,7 +81,8 @@ protected:
for (int i = 0; i < REPEAT_LOOP; ++i) {
SkPath line, path;
- line.moveTo(1, 2); line.lineTo(4 + i, 1);
+ line.moveTo(SkIntToScalar(1), SkIntToScalar(2));
+ line.lineTo(SkIntToScalar(4 + i), SkIntToScalar(1));
paint.getFillPath(line, &path);
draw_fatpath(canvas, surface, &path, 1);
diff --git a/gm/modecolorfilters.cpp b/gm/modecolorfilters.cpp
index 35150338ae..4f04dd46d3 100644
--- a/gm/modecolorfilters.cpp
+++ b/gm/modecolorfilters.cpp
@@ -123,11 +123,11 @@ protected:
int idx = 0;
static const int kRectsPerRow = SkMax32(this->getISize().fWidth / kRectWidth, 1);
for (size_t cfm = 0; cfm < SK_ARRAY_COUNT(modes); ++cfm) {
- for (int cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
+ for (size_t cfc = 0; cfc < SK_ARRAY_COUNT(colors); ++cfc) {
SkAutoTUnref<SkColorFilter> cf(SkColorFilter::CreateModeFilter(colors[cfc],
modes[cfm]));
paint.setColorFilter(cf);
- for (int s = 0; s < SK_ARRAY_COUNT(shaders); ++s) {
+ for (size_t s = 0; s < SK_ARRAY_COUNT(shaders); ++s) {
paint.setShader(shaders[s]);
bool hasShader = NULL == paint.getShader();
int paintColorCnt = hasShader ? SK_ARRAY_COUNT(alphas) : SK_ARRAY_COUNT(colors);
@@ -146,7 +146,7 @@ protected:
}
}
- for (int i = 0; i < SK_ARRAY_COUNT(shaders); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(shaders); ++i) {
SkSafeUnref(shaders[i]);
}
}
diff --git a/gm/tilemodes.cpp b/gm/tilemodes.cpp
index f2fbe77e21..ab4ea0a2fe 100644
--- a/gm/tilemodes.cpp
+++ b/gm/tilemodes.cpp
@@ -170,6 +170,8 @@ static SkShader* make_grad(SkShader::TileMode tx, SkShader::TileMode ty) {
case 2:
return SkGradientShader::CreateSweep(center.fX, center.fY, colors, NULL, SK_ARRAY_COUNT(colors));
}
+
+ return NULL;
}
static SkShader* make_radial(SkShader::TileMode tx, SkShader::TileMode ty) {
diff --git a/include/utils/SkRunnable.h b/include/utils/SkRunnable.h
index c7bedcc979..84e43750f6 100644
--- a/include/utils/SkRunnable.h
+++ b/include/utils/SkRunnable.h
@@ -10,6 +10,7 @@
class SkRunnable {
public:
+ virtual ~SkRunnable() {};
virtual void run() = 0;
};
diff --git a/src/effects/SkColorMatrixFilter.cpp b/src/effects/SkColorMatrixFilter.cpp
index 435d7ee2f1..1b86d439bf 100644
--- a/src/effects/SkColorMatrixFilter.cpp
+++ b/src/effects/SkColorMatrixFilter.cpp
@@ -417,7 +417,7 @@ GrEffect* ColorMatrixEffect::TestCreate(SkRandom* random,
GrContext*,
GrTexture* dummyTextures[2]) {
SkColorMatrix colorMatrix;
- for (int i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(colorMatrix.fMat); ++i) {
colorMatrix.fMat[i] = random->nextSScalar1();
}
return SkNEW_ARGS(ColorMatrixEffect, (colorMatrix));
diff --git a/src/utils/SkMatrix44.cpp b/src/utils/SkMatrix44.cpp
index a69111c2cd..43caacd552 100644
--- a/src/utils/SkMatrix44.cpp
+++ b/src/utils/SkMatrix44.cpp
@@ -102,7 +102,7 @@ void SkMatrix44::setColMajord(const double src[]) {
memcpy(dst, src, 16 * sizeof(double));
#elif defined SK_MSCALAR_IS_FLOAT
for (int i = 0; i < 16; ++i) {
- dst[i] = SkMScalarToDouble(src[i]);
+ dst[i] = SkDoubleToMScalar(src[i]);
}
#endif
fIdentity = false;
@@ -124,10 +124,10 @@ void SkMatrix44::setRowMajorf(const float src[]) {
void SkMatrix44::setRowMajord(const double src[]) {
SkMScalar* dst = &fMat[0][0];
for (int i = 0; i < 4; ++i) {
- dst[0] = SkMScalarToDouble(src[0]);
- dst[4] = SkMScalarToDouble(src[1]);
- dst[8] = SkMScalarToDouble(src[2]);
- dst[12] = SkMScalarToDouble(src[3]);
+ dst[0] = SkDoubleToMScalar(src[0]);
+ dst[4] = SkDoubleToMScalar(src[1]);
+ dst[8] = SkDoubleToMScalar(src[2]);
+ dst[12] = SkDoubleToMScalar(src[3]);
src += 4;
dst += 1;
}
diff --git a/tests/MatrixTest.cpp b/tests/MatrixTest.cpp
index efbd02d2c6..ed2be1d926 100644
--- a/tests/MatrixTest.cpp
+++ b/tests/MatrixTest.cpp
@@ -98,7 +98,8 @@ static void test_matrix_recttorect(skiatest::Reporter* reporter) {
dst.fRight += SK_Scalar1;
matrix.setRectToRect(src, dst, SkMatrix::kFill_ScaleToFit);
- REPORTER_ASSERT(reporter, SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask == matrix.getType());
+ REPORTER_ASSERT(reporter,
+ (SkMatrix::kTranslate_Mask | SkMatrix::kScale_Mask) == matrix.getType());
REPORTER_ASSERT(reporter, matrix.rectStaysRect());
dst = src;
diff --git a/tests/RoundRectTest.cpp b/tests/RoundRectTest.cpp
index a358c5a66f..e88ed8ad8b 100644
--- a/tests/RoundRectTest.cpp
+++ b/tests/RoundRectTest.cpp
@@ -136,7 +136,7 @@ static void test_round_rect_rects(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr1.type());
r = rr1.rect();
REPORTER_ASSERT(reporter, rect == r);
- for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
}
@@ -149,7 +149,7 @@ static void test_round_rect_rects(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, SkRRect::kRect_Type == rr2.type());
r = rr2.rect();
REPORTER_ASSERT(reporter, rect == r);
- for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr2.contains(pts[i].fX, pts[i].fY));
}
@@ -195,7 +195,7 @@ static void test_round_rect_ovals(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, SkRRect::kOval_Type == rr1.type());
oval = rr1.rect();
REPORTER_ASSERT(reporter, oval == rect);
- for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
}
}
@@ -230,7 +230,7 @@ static void test_round_rect_general(skiatest::Reporter* reporter) {
rr1.setRectXY(rect, 20, 20);
REPORTER_ASSERT(reporter, SkRRect::kSimple_Type == rr1.type());
- for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr1.contains(pts[i].fX, pts[i].fY));
}
@@ -261,7 +261,7 @@ static void test_round_rect_general(skiatest::Reporter* reporter) {
rr2.setRectRadii(rect, radii);
REPORTER_ASSERT(reporter, SkRRect::kComplex_Type == rr2.type());
- for (int i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
+ for (size_t i = 0; i < SK_ARRAY_COUNT(pts); ++i) {
REPORTER_ASSERT(reporter, isIn[i] == rr2.contains(pts2[i].fX, pts2[i].fY));
}
}