aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-22 15:21:23 +0000
committerGravatar bungeman@google.com <bungeman@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-07-22 15:21:23 +0000
commit4b18f5767ab1df7fedf0ff2e3a9eac7f7c500c36 (patch)
treefab816c0bc89fb5c2901ba17d623c75980d30f3d /src
parentb8f3655d492fc602c252f6fcc9aba3d37d8d59f4 (diff)
Clean up a few warnings on Windows x64.
git-svn-id: http://skia.googlecode.com/svn/trunk@10233 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rw-r--r--src/device/xps/SkXPSDevice.cpp2
-rwxr-xr-xsrc/ports/SkFontHost_win.cpp9
-rw-r--r--src/ports/SkImageDecoder_WIC.cpp7
-rw-r--r--src/utils/SkThreadUtils_win.cpp2
-rw-r--r--src/utils/win/SkIStream.cpp2
5 files changed, 11 insertions, 11 deletions
diff --git a/src/device/xps/SkXPSDevice.cpp b/src/device/xps/SkXPSDevice.cpp
index bfae6de2af..30e81bf386 100644
--- a/src/device/xps/SkXPSDevice.cpp
+++ b/src/device/xps/SkXPSDevice.cpp
@@ -2245,7 +2245,7 @@ static void text_draw_init(const SkPaint& paint,
SkBitSet& glyphsUsed,
SkDraw& myDraw, SkXPSDrawProcs& procs) {
procs.fD1GProc = xps_draw_1_glyph;
- int numGlyphGuess;
+ size_t numGlyphGuess;
switch (paint.getTextEncoding()) {
case SkPaint::kUTF8_TextEncoding:
numGlyphGuess = SkUTF8_CountUnichars(
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index 22385934ed..31ecdffce6 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1075,7 +1075,7 @@ static int is_not_black_or_white(SkGdiRGB c) {
return (c + (c & 1)) & 0x00FFFFFF;
}
-static bool is_rgb_really_bw(const SkGdiRGB* src, int width, int height, int srcRB) {
+static bool is_rgb_really_bw(const SkGdiRGB* src, int width, int height, size_t srcRB) {
for (int y = 0; y < height; ++y) {
for (int x = 0; x < width; ++x) {
if (is_not_black_or_white(src[x])) {
@@ -1634,7 +1634,7 @@ static HANDLE activate_font(SkData* fontData) {
DWORD numFonts = 0;
//AddFontMemResourceEx just copies the data, but does not specify const.
HANDLE fontHandle = AddFontMemResourceEx(const_cast<void*>(fontData->data()),
- fontData->size(),
+ static_cast<DWORD>(fontData->size()),
0,
&numFonts);
@@ -1692,15 +1692,14 @@ SkStream* LogFontTypeface::onOpenStream(int* ttcIndex) const {
SkMemoryStream* stream = NULL;
DWORD tables[2] = {kTTCTag, 0};
for (int i = 0; i < SK_ARRAY_COUNT(tables); i++) {
- size_t bufferSize = GetFontData(hdc, tables[i], 0, NULL, 0);
+ DWORD bufferSize = GetFontData(hdc, tables[i], 0, NULL, 0);
if (bufferSize == GDI_ERROR) {
call_ensure_accessible(lf);
bufferSize = GetFontData(hdc, tables[i], 0, NULL, 0);
}
if (bufferSize != GDI_ERROR) {
stream = new SkMemoryStream(bufferSize);
- if (GetFontData(hdc, tables[i], 0, (void*)stream->getMemoryBase(),
- bufferSize)) {
+ if (GetFontData(hdc, tables[i], 0, (void*)stream->getMemoryBase(), bufferSize)) {
break;
} else {
delete stream;
diff --git a/src/ports/SkImageDecoder_WIC.cpp b/src/ports/SkImageDecoder_WIC.cpp
index e02ac316d5..77f4b95276 100644
--- a/src/ports/SkImageDecoder_WIC.cpp
+++ b/src/ports/SkImageDecoder_WIC.cpp
@@ -213,7 +213,7 @@ bool SkImageDecoder_WIC::decodeStream(SkStream* stream, SkBitmap* bm, WICModes w
if (SUCCEEDED(hr)) {
SkAutoLockPixels alp(*bm);
bm->eraseColor(SK_ColorTRANSPARENT);
- const int stride = bm->rowBytes();
+ const UINT stride = bm->rowBytes();
hr = piBitmapSourceConverted->CopyPixels(
NULL, //Get all the pixels
stride,
@@ -396,10 +396,11 @@ bool SkImageEncoder_WIC::onEncode(SkWStream* stream
//Write the pixels into the frame.
if (SUCCEEDED(hr)) {
SkAutoLockPixels alp(*bitmap);
+ const UINT stride = bitmap->rowBytes();
hr = piBitmapFrameEncode->WritePixels(
height
- , bitmap->rowBytes()
- , bitmap->rowBytes()*height
+ , stride
+ , stride * height
, reinterpret_cast<BYTE*>(bitmap->getPixels()));
}
diff --git a/src/utils/SkThreadUtils_win.cpp b/src/utils/SkThreadUtils_win.cpp
index 208ffded1b..a064d3b6b3 100644
--- a/src/utils/SkThreadUtils_win.cpp
+++ b/src/utils/SkThreadUtils_win.cpp
@@ -108,7 +108,7 @@ static unsigned int num_bits_set(DWORD_PTR mask) {
static unsigned int nth_set_bit(unsigned int n, DWORD_PTR mask) {
n %= num_bits_set(mask);
for (unsigned int setBitsSeen = 0, currentBit = 0; true; ++currentBit) {
- if (mask & (1 << currentBit)) {
+ if (mask & (static_cast<DWORD_PTR>(1) << currentBit)) {
++setBitsSeen;
if (setBitsSeen > n) {
return currentBit;
diff --git a/src/utils/win/SkIStream.cpp b/src/utils/win/SkIStream.cpp
index 1d00611f79..7880fa0790 100644
--- a/src/utils/win/SkIStream.cpp
+++ b/src/utils/win/SkIStream.cpp
@@ -128,7 +128,7 @@ HRESULT SkIStream::CreateFromSkStream(SkStream* stream
// ISequentialStream Interface
HRESULT STDMETHODCALLTYPE SkIStream::Read(void* pv, ULONG cb, ULONG* pcbRead) {
- *pcbRead = this->fSkStream->read(pv, cb);
+ *pcbRead = static_cast<ULONG>(this->fSkStream->read(pv, cb));
this->fLocation.QuadPart += *pcbRead;
return (*pcbRead == cb) ? S_OK : S_FALSE;
}