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])) {
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);
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;
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,
//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()));
}
// 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;
}