aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-14 16:33:36 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-05-14 16:33:36 +0000
commit4debcac8c38cae17a01e697578719c60a068052f (patch)
treefe0f4e1b11fa773d8ce0eb446cb5912d8e055eea
parent59bc8d4fa725da2a6cec3526859c488b577d5cce (diff)
Debug Windows compiler complaint fixes
-rw-r--r--bench/InterpBench.cpp19
-rw-r--r--gyp/gpu.gyp2
-rw-r--r--samplecode/SampleRegion.cpp10
-rw-r--r--src/gpu/gl/debug/GrFBBindableObj.cpp9
-rw-r--r--src/gpu/gl/debug/GrRenderBufferObj.cpp9
-rw-r--r--src/pdf/SkPDFDocument.cpp2
-rw-r--r--tests/DrawBitmapRectTest.cpp20
-rw-r--r--tests/MathTest.cpp10
-rw-r--r--tests/PDFPrimitivesTest.cpp8
-rw-r--r--tests/ToUnicode.cpp2
10 files changed, 45 insertions, 46 deletions
diff --git a/bench/InterpBench.cpp b/bench/InterpBench.cpp
index 1db832d5d2..89841f8a69 100644
--- a/bench/InterpBench.cpp
+++ b/bench/InterpBench.cpp
@@ -71,10 +71,21 @@ protected:
int64_t step = (int64_t)(dx * 65536 * 655536);
SkFixed tmp;
for (int i = 0; i < count; i += 4) {
- tmp = curr >> 16; dst[i + 0] = TILE(tmp, count); curr += step;
- tmp = curr >> 16; dst[i + 1] = TILE(tmp, count); curr += step;
- tmp = curr >> 16; dst[i + 2] = TILE(tmp, count); curr += step;
- tmp = curr >> 16; dst[i + 3] = TILE(tmp, count); curr += step;
+ tmp = (SkFixed)(curr >> 16);
+ dst[i + 0] = TILE(tmp, count);
+ curr += step;
+
+ tmp = (SkFixed)(curr >> 16);
+ dst[i + 1] = TILE(tmp, count);
+ curr += step;
+
+ tmp = (SkFixed)(curr >> 16);
+ dst[i + 2] = TILE(tmp, count);
+ curr += step;
+
+ tmp = (SkFixed)(curr >> 16);
+ dst[i + 3] = TILE(tmp, count);
+ curr += step;
}
}
private:
diff --git a/gyp/gpu.gyp b/gyp/gpu.gyp
index 9ca225eb9b..04cb4e3e4f 100644
--- a/gyp/gpu.gyp
+++ b/gyp/gpu.gyp
@@ -320,9 +320,7 @@
'../src/gpu/gl/debug/GrBufferObj.h',
'../src/gpu/gl/debug/GrBufferObj.cpp',
'../src/gpu/gl/debug/GrFBBindableObj.h',
- '../src/gpu/gl/debug/GrFBBindableObj.cpp',
'../src/gpu/gl/debug/GrRenderBufferObj.h',
- '../src/gpu/gl/debug/GrRenderBufferObj.cpp',
'../src/gpu/gl/debug/GrTextureObj.h',
'../src/gpu/gl/debug/GrTextureObj.cpp',
'../src/gpu/gl/debug/GrTextureUnitObj.h',
diff --git a/samplecode/SampleRegion.cpp b/samplecode/SampleRegion.cpp
index a46b488bf8..b4d540ca43 100644
--- a/samplecode/SampleRegion.cpp
+++ b/samplecode/SampleRegion.cpp
@@ -28,8 +28,10 @@ static void test_strokerect(SkCanvas* canvas) {
SkScalar dy = 20;
SkPath path;
- path.addRect(0.0f, 0.0f, width, height, SkPath::kCW_Direction);
- SkRect r = SkRect::MakeWH(width, height);
+ path.addRect(0.0f, 0.0f,
+ SkIntToScalar(width), SkIntToScalar(height),
+ SkPath::kCW_Direction);
+ SkRect r = SkRect::MakeWH(SkIntToScalar(width), SkIntToScalar(height));
SkCanvas c(bitmap);
c.translate(dx, dy);
@@ -46,7 +48,7 @@ static void test_strokerect(SkCanvas* canvas) {
// use the path
c.clear(0);
c.drawPath(path, paint);
- canvas->drawBitmap(bitmap, 2*width, 0, NULL);
+ canvas->drawBitmap(bitmap, SkIntToScalar(2*width), 0, NULL);
}
static void drawFadingText(SkCanvas* canvas,
@@ -74,7 +76,7 @@ static void drawFadingText(SkCanvas* canvas,
// pos[1] value is where we start to fade, relative to the width
// of our pts[] array.
- const SkScalar pos[] = { 0, SkFloatToScalar(0.9), SK_Scalar1 };
+ const SkScalar pos[] = { 0, SkFloatToScalar(0.9f), SK_Scalar1 };
SkShader* s = SkGradientShader::CreateLinear(pts, colors, pos, 3,
SkShader::kClamp_TileMode);
diff --git a/src/gpu/gl/debug/GrFBBindableObj.cpp b/src/gpu/gl/debug/GrFBBindableObj.cpp
deleted file mode 100644
index dbab2d7397..0000000000
--- a/src/gpu/gl/debug/GrFBBindableObj.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "GrFBBindableObj.h" \ No newline at end of file
diff --git a/src/gpu/gl/debug/GrRenderBufferObj.cpp b/src/gpu/gl/debug/GrRenderBufferObj.cpp
deleted file mode 100644
index b7641ca948..0000000000
--- a/src/gpu/gl/debug/GrRenderBufferObj.cpp
+++ /dev/null
@@ -1,9 +0,0 @@
-
-/*
- * Copyright 2012 Google Inc.
- *
- * Use of this source code is governed by a BSD-style license that can be
- * found in the LICENSE file.
- */
-
-#include "GrRenderBufferObj.h"
diff --git a/src/pdf/SkPDFDocument.cpp b/src/pdf/SkPDFDocument.cpp
index 74daf00738..3b9b686ba8 100644
--- a/src/pdf/SkPDFDocument.cpp
+++ b/src/pdf/SkPDFDocument.cpp
@@ -263,7 +263,7 @@ void SkPDFDocument::emitFooter(SkWStream* stream, int64_t objCount) {
// TODO(vandebo): Linearized format will take a Prev entry too.
// TODO(vandebo): PDF/A requires an ID entry.
- fTrailerDict->insertInt("Size", objCount);
+ fTrailerDict->insertInt("Size", int(objCount));
fTrailerDict->insert("Root",
new SkPDFObjRef(fDocCatalog.get()))->unref();
}
diff --git a/tests/DrawBitmapRectTest.cpp b/tests/DrawBitmapRectTest.cpp
index 084bdf290e..e11acbc95e 100644
--- a/tests/DrawBitmapRectTest.cpp
+++ b/tests/DrawBitmapRectTest.cpp
@@ -41,9 +41,13 @@ static void test_wacky_bitmapshader(skiatest::Reporter* reporter,
SkMatrix matrix;
SkCanvas c(dev);
- matrix.setAll(-119.34097, -43.436558, 93489.945,
- 43.436558, -119.34097, 123.98426,
- 0, 0, 1);
+ matrix.setAll(SkFloatToScalar(-119.34097f),
+ SkFloatToScalar(-43.436558f),
+ SkFloatToScalar(93489.945f),
+ SkFloatToScalar(43.436558f),
+ SkFloatToScalar(-119.34097f),
+ SkFloatToScalar(123.98426f),
+ 0, 0, SK_Scalar1);
c.concat(matrix);
SkBitmap bm;
@@ -53,9 +57,13 @@ static void test_wacky_bitmapshader(skiatest::Reporter* reporter,
SkShader* s = SkShader::CreateBitmapShader(bm, SkShader::kRepeat_TileMode,
SkShader::kRepeat_TileMode);
- matrix.setAll(0.0078740157, 0, 249,
- 0, 0.0078740157, 239,
- 0, 0, 1);
+ matrix.setAll(SkFloatToScalar(0.0078740157f),
+ 0,
+ SkIntToScalar(249),
+ 0,
+ SkFloatToScalar(0.0078740157f),
+ SkIntToScalar(239),
+ 0, 0, SK_Scalar1);
s->setLocalMatrix(matrix);
SkPaint paint;
diff --git a/tests/MathTest.cpp b/tests/MathTest.cpp
index fe162b114f..eec9dbe826 100644
--- a/tests/MathTest.cpp
+++ b/tests/MathTest.cpp
@@ -418,11 +418,13 @@ static void TestMath(skiatest::Reporter* reporter) {
// These random values are being treated as 32-bit-patterns, not as
// ints; calling SkIntToScalar() here produces crashes.
- p.setLength(rand.nextS(),
- rand.nextS(), SK_Scalar1);
+ p.setLength((SkScalar) rand.nextS(),
+ (SkScalar) rand.nextS(),
+ SK_Scalar1);
check_length(reporter, p, SK_Scalar1);
- p.setLength(rand.nextS() >> 13,
- rand.nextS() >> 13, SK_Scalar1);
+ p.setLength((SkScalar) (rand.nextS() >> 13),
+ (SkScalar) (rand.nextS() >> 13),
+ SK_Scalar1);
check_length(reporter, p, SK_Scalar1);
}
diff --git a/tests/PDFPrimitivesTest.cpp b/tests/PDFPrimitivesTest.cpp
index d1ed217c54..000ebea690 100644
--- a/tests/PDFPrimitivesTest.cpp
+++ b/tests/PDFPrimitivesTest.cpp
@@ -7,8 +7,6 @@
*/
-#include <string>
-
#include "Test.h"
#include "SkData.h"
#include "SkFlate.h"
@@ -89,9 +87,9 @@ static void CheckObjectOutput(skiatest::Reporter* reporter, SkPDFObject* obj,
static void SimpleCheckObjectOutput(skiatest::Reporter* reporter,
SkPDFObject* obj,
- const std::string& expectedResult) {
- CheckObjectOutput(reporter, obj, expectedResult.c_str(),
- expectedResult.length(), true, false);
+ const char* expectedResult) {
+ CheckObjectOutput(reporter, obj, expectedResult,
+ strlen(expectedResult), true, false);
}
static void TestPDFStream(skiatest::Reporter* reporter) {
diff --git a/tests/ToUnicode.cpp b/tests/ToUnicode.cpp
index c0a945a5e7..99e9ef6ed5 100644
--- a/tests/ToUnicode.cpp
+++ b/tests/ToUnicode.cpp
@@ -7,8 +7,6 @@
*/
-#include <string>
-
#include "Test.h"
#include "SkData.h"
#include "SkPDFTypes.h"