aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-07 20:03:39 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-10-07 20:03:39 +0000
commit8e06dabfe643b483fd59eb0a511b4b23ba640ba7 (patch)
treeffdf559b6d7a3c2f4a055b31c325023e8bc7f70b
parent6150c2051e7cff869284de8d18928b070bf01096 (diff)
Fix more VS2010 warnings.
Review URL: http://codereview.appspot.com/5169053/ git-svn-id: http://skia.googlecode.com/svn/trunk@2432 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--experimental/Debugger/DebuggerStateView.cpp2
-rw-r--r--experimental/SkSetPoly3To3_D.cpp2
-rw-r--r--tools/skdiff_main.cpp26
3 files changed, 15 insertions, 15 deletions
diff --git a/experimental/Debugger/DebuggerStateView.cpp b/experimental/Debugger/DebuggerStateView.cpp
index dd65c5581a..fdf2af7273 100644
--- a/experimental/Debugger/DebuggerStateView.cpp
+++ b/experimental/Debugger/DebuggerStateView.cpp
@@ -40,7 +40,7 @@ void DebuggerStateView::onDraw(SkCanvas* canvas) {
SkPaint p;
p.setTextSize(SKDEBUGGER_TEXTSIZE);
p.setAntiAlias(true);
- int x = 50;
+ SkScalar x = 50 * SK_Scalar1;
canvas->drawText(fPaintInfo.c_str(), fPaintInfo.size(), x, 30, p);
canvas->drawText(fMatrix.c_str(), fMatrix.size(), x, 60, p);
canvas->drawText(fClip.c_str(), fClip.size(), x, 90, p);
diff --git a/experimental/SkSetPoly3To3_D.cpp b/experimental/SkSetPoly3To3_D.cpp
index 29526c9dc0..810e6b21d0 100644
--- a/experimental/SkSetPoly3To3_D.cpp
+++ b/experimental/SkSetPoly3To3_D.cpp
@@ -11,7 +11,7 @@ typedef int64_t SkDScalar;
static SkScalar SkDScalar_toScalar(SkDScalar value) {
SkDScalar result = (value + (1 << 15)) >> 16;
- int top = result >> 31;
+ SkDEBUGCODE(int top = static_cast<int>(result >> 31);)
SkASSERT(top == 0 || top == -1);
return (SkScalar)result;
}
diff --git a/tools/skdiff_main.cpp b/tools/skdiff_main.cpp
index 04b0dc01fb..6d202a726f 100644
--- a/tools/skdiff_main.cpp
+++ b/tools/skdiff_main.cpp
@@ -179,12 +179,12 @@ static int compare_diff_mean_mismatches (DiffRecord** lhs, DiffRecord** rhs) {
/// Comparison routine for qsort; sorts by max(fMaxMismatch{RGB})
/// from largest to smallest.
static int compare_diff_max_mismatches (DiffRecord** lhs, DiffRecord** rhs) {
- float leftValue = MAX3((*lhs)->fMaxMismatchR,
- (*lhs)->fMaxMismatchG,
- (*lhs)->fMaxMismatchB);
- float rightValue = MAX3((*rhs)->fMaxMismatchR,
- (*rhs)->fMaxMismatchG,
- (*rhs)->fMaxMismatchB);
+ uint32_t leftValue = MAX3((*lhs)->fMaxMismatchR,
+ (*lhs)->fMaxMismatchG,
+ (*lhs)->fMaxMismatchB);
+ uint32_t rightValue = MAX3((*rhs)->fMaxMismatchR,
+ (*rhs)->fMaxMismatchG,
+ (*rhs)->fMaxMismatchB);
if (leftValue < rightValue) {
return 1;
}
@@ -507,7 +507,7 @@ static int compute_image_height (int height, int width) {
float scale = (float) retval / height;
if (width * scale > 360) {
scale = (float) 360 / width;
- retval = height * scale;
+ retval = static_cast<int>(height * scale);
}
return retval;
}
@@ -549,9 +549,9 @@ static void print_page_header (SkFILEWStream* stream,
static void print_pixel_count (SkFILEWStream* stream,
const DiffRecord& diff) {
stream->writeText("<br>(");
- stream->writeDecAsText(diff.fFractionDifference *
- diff.fBaseWidth *
- diff.fBaseHeight);
+ stream->writeDecAsText(static_cast<int>(diff.fFractionDifference *
+ diff.fBaseWidth *
+ diff.fBaseHeight));
stream->writeText(" pixels)");
/*
stream->writeDecAsText(diff.fWeightedFraction *
@@ -579,9 +579,9 @@ static void print_label_cell (SkFILEWStream* stream,
print_pixel_count(stream, diff);
}
stream->writeText("<br>Average color mismatch ");
- stream->writeDecAsText(MAX3(diff.fAverageMismatchR,
- diff.fAverageMismatchG,
- diff.fAverageMismatchB));
+ stream->writeDecAsText(static_cast<int>(MAX3(diff.fAverageMismatchR,
+ diff.fAverageMismatchG,
+ diff.fAverageMismatchB)));
stream->writeText("<br>Max color mismatch ");
stream->writeDecAsText(MAX3(diff.fMaxMismatchR,
diff.fMaxMismatchG,