Fixing Windows compiler complaints
authorrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 6 Apr 2012 20:01:46 +0000 (20:01 +0000)
committerrobertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 6 Apr 2012 20:01:46 +0000 (20:01 +0000)
http://codereview.appspot.com/5991056/

git-svn-id: http://skia.googlecode.com/svn/trunk@3626 2bbb7eff-a529-9590-31e7-b0007b416f81

bench/InterpBench.cpp
gm/gm.h
gm/gmmain.cpp
gm/gradients.cpp
include/gpu/GrTexture.h
samplecode/SampleFontScalerTest.cpp
samplecode/TransitionView.cpp
src/core/SkDeviceProfile.cpp
tests/Matrix44Test.cpp
tests/PathTest.cpp

index 69fbd9bb49cdb15ba7dd4ad3ca68e206dec68b62..1db832d5d2fd7b543125a2ffcb24069ce99ca04d 100644 (file)
@@ -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 bec29bfa5f7c6b236d99522fecd3ee3dde2adb10..97b21d97b817ae04db3e2b62f31316dbd6c7819a 100644 (file)
--- 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"
index 76bd4914b136d74781af072c8643f1f7b28de0f4..def00948f909768bf96c1da2911d9ff1358c794b 100644 (file)
@@ -29,7 +29,6 @@
 #include "gl/SkDebugGLContext.h"
 #include "SkPicture.h"
 #include "SkStream.h"
-#include "SkRefCnt.h"
 
 static bool gForceBWtext;
 
index 3eb5633c2174beb24e042d26c9271ea3a020accb..ad745df8c123912ab8e808a6eccd00377ef1dfd2 100644 (file)
@@ -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),
index 8e39fb55b59c3f965fb01bf106d27b90eda988e4..a57ac0072e576b520788161df009515aedaa7971 100644 (file)
@@ -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,
index 062eca3386c15b9a77a256477758949a0dfb2e76..83f962ecaca2db107cf686838046e4852a0cca86 100644 (file)
@@ -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;
index 99d1275fd9036afdf31d7638576004cba7b251ed..76e18b6a30f258b6eafb4a327f42991473bfc2dd 100644 (file)
@@ -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);
     }
index 2c2cb885e625cec003c3994bc9d19bf742c42cca..c5abc8eb756d8c150e8c4a752a6228bc72fc224b 100644 (file)
@@ -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
 
index 485b38bc49e744a9f582470c94d726e356e4a01f..9846e7df07d2e0decb90b150bbf24c69ed61524b 100644 (file)
@@ -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());
index 868ce318b1e45b8d54d63442abb7ceed0d33cca8..c4ad0a6eb3a33dbb3961436a3c4b8a950b111333 100644 (file)
@@ -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];