Reverting r12315 (More Windows 64b compilation warning fixes) due to compilation failures
git-svn-id: http://skia.googlecode.com/svn/trunk/src@12316 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/gpu/SkGpuDevice.cpp b/gpu/SkGpuDevice.cpp
index afdc7e9..747688e 100644
--- a/gpu/SkGpuDevice.cpp
+++ b/gpu/SkGpuDevice.cpp
@@ -571,7 +571,7 @@
fContext->drawVertices(grPaint,
gPointMode2PrimtiveType[mode],
- SkToS32(count),
+ count,
(GrPoint*)pts,
NULL,
NULL,
diff --git a/gpu/gl/GrGLProgramDesc.cpp b/gpu/gl/GrGLProgramDesc.cpp
index e655210..d958742 100644
--- a/gpu/gl/GrGLProgramDesc.cpp
+++ b/gpu/gl/GrGLProgramDesc.cpp
@@ -105,7 +105,7 @@
memset(desc->header(), 0, kHeaderSize);
}
// write the key length
- *desc->atOffset<uint32_t, kLengthOffset>() = SkToU32(newKeyLength);
+ *desc->atOffset<uint32_t, kLengthOffset>() = newKeyLength;
KeyHeader* header = desc->header();
EffectKey* effectKeys = desc->effectKeys();
diff --git a/gpu/gl/GrGpuGL_program.cpp b/gpu/gl/GrGpuGL_program.cpp
index a777e8f..4f9adb7 100644
--- a/gpu/gl/GrGpuGL_program.cpp
+++ b/gpu/gl/GrGpuGL_program.cpp
@@ -291,7 +291,7 @@
void GrGpuGL::setupGeometry(const DrawInfo& info, size_t* indexOffsetInBytes) {
- GrGLsizei stride = static_cast<GrGLsizei>(this->getDrawState().getVertexSize());
+ GrGLsizei stride = this->getDrawState().getVertexSize();
size_t vertexOffsetInBytes = stride * info.startVertex();
diff --git a/images/bmpdecoderhelper.cpp b/images/bmpdecoderhelper.cpp
index 9f0e61b..7749664 100644
--- a/images/bmpdecoderhelper.cpp
+++ b/images/bmpdecoderhelper.cpp
@@ -18,7 +18,7 @@
static const int kMaxDim = SHRT_MAX / 2;
bool BmpDecoderHelper::DecodeImage(const char* p,
- size_t len,
+ int len,
int max_pixels,
BmpDecoderCallback* callback) {
data_ = reinterpret_cast<const uint8*>(p);
@@ -182,7 +182,7 @@
static const uint8 RLE_DELTA = 2;
int x = 0;
int y = height_ - 1;
- while (pos_ + 1 < len_) {
+ while (pos_ < len_ - 1) {
uint8 cmd = GetByte();
if (cmd != RLE_ESCAPE) {
uint8 pixels = GetByte();
@@ -210,7 +210,7 @@
return;
}
} else if (cmd == RLE_DELTA) {
- if (pos_ + 1 < len_) {
+ if (pos_ < len_ - 1) {
uint8 dx = GetByte();
uint8 dy = GetByte();
x += dx;
diff --git a/images/bmpdecoderhelper.h b/images/bmpdecoderhelper.h
index d8bc8c3..f2f4109 100644
--- a/images/bmpdecoderhelper.h
+++ b/images/bmpdecoderhelper.h
@@ -72,7 +72,7 @@
BmpDecoderHelper() { }
~BmpDecoderHelper() { }
bool DecodeImage(const char* data,
- size_t len,
+ int len,
int max_pixels,
BmpDecoderCallback* callback);
@@ -91,7 +91,7 @@
const uint8* data_;
int pos_;
- size_t len_;
+ int len_;
int width_;
int height_;
int bpp_;
diff --git a/pdf/SkPDFDevice.cpp b/pdf/SkPDFDevice.cpp
index 804dc41..0b15d6a 100644
--- a/pdf/SkPDFDevice.cpp
+++ b/pdf/SkPDFDevice.cpp
@@ -123,7 +123,7 @@
*y = *y - yAdj;
}
-static int max_glyphid_for_typeface(SkTypeface* typeface) {
+static size_t max_glyphid_for_typeface(SkTypeface* typeface) {
SkAutoResolveDefaultTypeface autoResolve(typeface);
typeface = autoResolve.get();
return typeface->countGlyphs() - 1;
diff --git a/pdf/SkPDFDeviceFlattener.cpp b/pdf/SkPDFDeviceFlattener.cpp
index 91c9803..9c0bf41 100644
--- a/pdf/SkPDFDeviceFlattener.cpp
+++ b/pdf/SkPDFDeviceFlattener.cpp
@@ -43,7 +43,7 @@
flattenPaint(d, &paintFlatten);
SkPoint* flattenedPoints = SkNEW_ARRAY(SkPoint, count);
- d.fMatrix->mapPoints(flattenedPoints, points, SkToS32(count));
+ d.fMatrix->mapPoints(flattenedPoints, points, count);
SkDraw draw(d);
SkMatrix identity = SkMatrix::I();
draw.fMatrix = &identity;
diff --git a/pdf/SkPDFImage.cpp b/pdf/SkPDFImage.cpp
index f2b105d..c3dc396 100644
--- a/pdf/SkPDFImage.cpp
+++ b/pdf/SkPDFImage.cpp
@@ -426,7 +426,7 @@
SkBitmap outBitmap;
outBitmap.setConfig(bitmap.config(), srcRect.width(), srcRect.height());
outBitmap.allocPixels();
- int dstRow = 0;
+ size_t dstRow = 0;
outBitmap.lockPixels();
bitmap.lockPixels();
diff --git a/utils/debugger/SkObjectParser.cpp b/utils/debugger/SkObjectParser.cpp
index 35cf1b9..107e04a 100644
--- a/utils/debugger/SkObjectParser.cpp
+++ b/utils/debugger/SkObjectParser.cpp
@@ -335,11 +335,9 @@
}
case SkPaint::kUTF16_TextEncoding: {
decodedText->append("UTF-16: ");
- size_t sizeNeeded = SkUTF16_ToUTF8((uint16_t*)text,
- SkToS32(byteLength / 2),
- NULL);
+ size_t sizeNeeded = SkUTF16_ToUTF8((uint16_t*)text, byteLength / 2, NULL);
SkAutoSTMalloc<0x100, char> utf8(sizeNeeded);
- SkUTF16_ToUTF8((uint16_t*)text, SkToS32(byteLength / 2), utf8);
+ SkUTF16_ToUTF8((uint16_t*)text, byteLength / 2, utf8);
decodedText->append(utf8, sizeNeeded);
break;
}
diff --git a/views/win/SkOSWindow_win.cpp b/views/win/SkOSWindow_win.cpp
index 7549ea2..6bedd2d 100644
--- a/views/win/SkOSWindow_win.cpp
+++ b/views/win/SkOSWindow_win.cpp
@@ -130,12 +130,9 @@
this->handleChar(SkUTF8_ToUnichar((char*)&wParam));
return true;
} break;
- case WM_SIZE: {
- INT width = LOWORD(lParam);
- INT height = HIWORD(lParam);
- this->resize(width, height);
+ case WM_SIZE:
+ this->resize(lParam & 0xFFFF, lParam >> 16);
break;
- }
case WM_PAINT: {
PAINTSTRUCT ps;
HDC hdc = BeginPaint(hWnd, &ps);