aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-06 20:01:46 +0000
committerGravatar robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-04-06 20:01:46 +0000
commit09042b80d22837c760bb530124aaa67469b19b8f (patch)
tree1e4e2a5e1f31c6d4eb83d290f9dec0591d1058e8
parent419400bf6e475dfbaa424ef0155598a3422cfa67 (diff)
Fixing Windows compiler complaints
-rw-r--r--bench/InterpBench.cpp4
-rw-r--r--gm/gm.h1
-rw-r--r--gm/gmmain.cpp1
-rw-r--r--gm/gradients.cpp6
-rw-r--r--include/gpu/GrTexture.h2
-rw-r--r--samplecode/SampleFontScalerTest.cpp2
-rw-r--r--samplecode/TransitionView.cpp2
-rw-r--r--src/core/SkDeviceProfile.cpp4
-rw-r--r--tests/Matrix44Test.cpp2
-rw-r--r--tests/PathTest.cpp3
10 files changed, 12 insertions, 15 deletions
diff --git a/bench/InterpBench.cpp b/bench/InterpBench.cpp
index 69fbd9bb49..1db832d5d2 100644
--- a/bench/InterpBench.cpp
+++ b/bench/InterpBench.cpp
@@ -18,8 +18,8 @@ class InterpBench : public SkBenchmark {
public:
InterpBench(void* param, const char name[]) : INHERITED(param) {
fName.printf("interp_%s", name);
- fFx = 3.3;
- fDx = 0.1257;
+ fFx = 3.3f;
+ fDx = 0.1257f;
}
virtual void performTest(int16_t dst[], float x, float dx, int count) = 0;
diff --git a/gm/gm.h b/gm/gm.h
index bec29bfa5f..97b21d97b8 100644
--- a/gm/gm.h
+++ b/gm/gm.h
@@ -12,7 +12,6 @@
#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkPaint.h"
-#include "SkRefCnt.h"
#include "SkSize.h"
#include "SkString.h"
#include "SkTRegistry.h"
diff --git a/gm/gmmain.cpp b/gm/gmmain.cpp
index 76bd4914b1..def00948f9 100644
--- a/gm/gmmain.cpp
+++ b/gm/gmmain.cpp
@@ -29,7 +29,6 @@
#include "gl/SkDebugGLContext.h"
#include "SkPicture.h"
#include "SkStream.h"
-#include "SkRefCnt.h"
static bool gForceBWtext;
diff --git a/gm/gradients.cpp b/gm/gradients.cpp
index 3eb5633c21..ad745df8c1 100644
--- a/gm/gradients.cpp
+++ b/gm/gradients.cpp
@@ -237,9 +237,9 @@ protected:
center.set(SkIntToScalar(dim.width())/2, SkIntToScalar(dim.height())/2);
SkScalar radius = SkIntToScalar(dim.width())/2;
const SkColor colors[] = { 0x7f7f7f7f, 0x7f7f7f7f, 0xb2000000 };
- const SkScalar pos[] = { SkFloatToScalar(0.0),
- SkFloatToScalar(0.35),
- SkFloatToScalar(1.0) };
+ const SkScalar pos[] = { SkFloatToScalar(0.0f),
+ SkFloatToScalar(0.35f),
+ SkFloatToScalar(1.0f) };
SkShader* shader =
SkGradientShader::CreateRadial(center, radius, colors,
pos, SK_ARRAY_COUNT(pos),
diff --git a/include/gpu/GrTexture.h b/include/gpu/GrTexture.h
index 8e39fb55b5..a57ac0072e 100644
--- a/include/gpu/GrTexture.h
+++ b/include/gpu/GrTexture.h
@@ -79,7 +79,7 @@ public:
* @param height height of rectangle to write in pixels.
* @param config the pixel config of the source buffer
* @param buffer memory to read pixels from
- * @param rowBytes number of bytes bewtween consecutive rows. Zero
+ * @param rowBytes number of bytes between consecutive rows. Zero
* means rows are tightly packed.
*/
void writePixels(int left, int top, int width, int height,
diff --git a/samplecode/SampleFontScalerTest.cpp b/samplecode/SampleFontScalerTest.cpp
index 062eca3386..83f962ecac 100644
--- a/samplecode/SampleFontScalerTest.cpp
+++ b/samplecode/SampleFontScalerTest.cpp
@@ -104,7 +104,7 @@ protected:
SkAutoCanvasRestore acr(canvas, true);
canvas->translate(SkIntToScalar(50 + i * 230),
SkIntToScalar(20));
- rotate_about(canvas, i * 5, x, y * 10);
+ rotate_about(canvas, SkIntToScalar(i * 5), x, y * 10);
{
SkPaint p;
diff --git a/samplecode/TransitionView.cpp b/samplecode/TransitionView.cpp
index 99d1275fd9..76e18b6a30 100644
--- a/samplecode/TransitionView.cpp
+++ b/samplecode/TransitionView.cpp
@@ -146,7 +146,7 @@ protected:
fEnd[kPrevX] = -lr;
fEnd[kPrevY] = -ud;
fEnd[kNextX] = fEnd[kNextY] = 0;
- SkScalar blend[] = {0.8, 0.0, 0.0, 1.0};
+ SkScalar blend[] = {0.8f, 0.0f, 0.0f, 1.0f};
fInterp.setKeyFrame(0, SkTime::GetMSecs(), fBegin, blend);
fInterp.setKeyFrame(1, SkTime::GetMSecs()+500, fEnd, blend);
}
diff --git a/src/core/SkDeviceProfile.cpp b/src/core/SkDeviceProfile.cpp
index 2c2cb885e6..c5abc8eb75 100644
--- a/src/core/SkDeviceProfile.cpp
+++ b/src/core/SkDeviceProfile.cpp
@@ -2,8 +2,8 @@
#include "SkDeviceProfile.h"
-#define DEFAULT_GAMMAEXP 2.2
-#define DEFAULT_CONTRASTSCALE 0.5
+#define DEFAULT_GAMMAEXP 2.2f
+#define DEFAULT_CONTRASTSCALE 0.5f
#define DEFAULT_LCDCONFIG SkDeviceProfile::kNone_LCDConfig
#define DEFAULT_FONTHINTLEVEL SkDeviceProfile::kSlight_FontHintLevel
diff --git a/tests/Matrix44Test.cpp b/tests/Matrix44Test.cpp
index 485b38bc49..9846e7df07 100644
--- a/tests/Matrix44Test.cpp
+++ b/tests/Matrix44Test.cpp
@@ -69,7 +69,7 @@ static void test_common_angles(skiatest::Reporter* reporter) {
// Test precision of rotation in common cases
int common_angles[] = { 0, 90, -90, 180, -180, 270, -270, 360, -360 };
for (int i = 0; i < 9; ++i) {
- rot.setRotateDegreesAbout(0, 0, -1, common_angles[i]);
+ rot.setRotateDegreesAbout(0, 0, -1, SkIntToScalar(common_angles[i]));
SkMatrix rot3x3 = rot;
REPORTER_ASSERT(reporter, rot3x3.rectStaysRect());
diff --git a/tests/PathTest.cpp b/tests/PathTest.cpp
index 868ce318b1..c4ad0a6eb3 100644
--- a/tests/PathTest.cpp
+++ b/tests/PathTest.cpp
@@ -162,7 +162,7 @@ static void stroke_tiny_cubic() {
static void check_close(skiatest::Reporter* reporter, const SkPath& path) {
for (int i = 0; i < 2; ++i) {
- SkPath::Iter iter(path, (bool)i);
+ SkPath::Iter iter(path, SkToBool(i));
SkPoint mv;
SkPoint pts[4];
SkPath::Verb v;
@@ -943,7 +943,6 @@ static void test_raw_iter(skiatest::Reporter* reporter) {
do {
nextVerb = static_cast<SkPath::Verb>((rand.nextU() >> 16) % SkPath::kDone_Verb);
} while (lastWasClose && nextVerb == SkPath::kClose_Verb);
- int numRequiredPts;
switch (nextVerb) {
case SkPath::kMove_Verb:
expectedPts[numPoints] = randomPts[(rand.nextU() >> 16) % 25];