From: Jim Van Verth Date: Wed, 26 Oct 2016 13:45:23 +0000 (-0400) Subject: Fix some Windows warnings X-Git-Tag: accepted/tizen/5.0/unified/20181102.025319~73^2~423 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cfdf6c8b1f0c6ebe59ddd0d2750976c2dd1921d;p=platform%2Fupstream%2FlibSkiaSharp.git Fix some Windows warnings BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3980 Change-Id: Icfc5dfb985b966c625d9bc81f61719ac5549085e Reviewed-on: https://skia-review.googlesource.com/3980 Reviewed-by: Matt Sarett Commit-Queue: Jim Van Verth --- diff --git a/gm/animatedGif.cpp b/gm/animatedGif.cpp index 6f7f0dd..03bf66c 100644 --- a/gm/animatedGif.cpp +++ b/gm/animatedGif.cpp @@ -103,7 +103,7 @@ private: SkAutoCanvasRestore acr(canvas, true); for (size_t frameIndex = 0; frameIndex < fTotalFrames; frameIndex++) { this->drawFrame(canvas, frameIndex); - canvas->translate(fCodec->getInfo().width(), 0); + canvas->translate(SkIntToScalar(fCodec->getInfo().width()), 0); } } } @@ -142,7 +142,7 @@ private: } SkAutoCanvasRestore acr(canvas, true); - canvas->translate(0, fCodec->getInfo().height()); + canvas->translate(0, SkIntToScalar(fCodec->getInfo().height())); this->drawFrame(canvas, fFrame); } diff --git a/src/gpu/GrDistanceFieldGenFromVector.cpp b/src/gpu/GrDistanceFieldGenFromVector.cpp index 6fc4d6b..5841dbd 100644 --- a/src/gpu/GrDistanceFieldGenFromVector.cpp +++ b/src/gpu/GrDistanceFieldGenFromVector.cpp @@ -804,7 +804,8 @@ bool GrGenerateDistanceFieldFromPath(unsigned char* distanceField, if (col == width - 1 && windingNumber != 0) { for (int col = 0; col < width; ++col) { int idx = (row * width) + col; - dfSign = workingPath.contains(col + 0.5, row + 0.5) ? kInside : kOutside; + dfSign = workingPath.contains(col + SK_ScalarHalf, + row + SK_ScalarHalf) ? kInside : kOutside; const float miniDist = sqrt(dataPtr[idx].fDistSq); const float dist = dfSign * miniDist; diff --git a/third_party/gif/SkGifImageReader.cpp b/third_party/gif/SkGifImageReader.cpp index 9c8214c..228c8ec 100644 --- a/third_party/gif/SkGifImageReader.cpp +++ b/third_party/gif/SkGifImageReader.cpp @@ -728,7 +728,7 @@ bool SkGifImageReader::parse(SkGifImageReader::SkGIFParseQuery query) } } - const bool isLocalColormapDefined = currentComponent[8] & 0x80; + const bool isLocalColormapDefined = SkToBool(currentComponent[8] & 0x80); // The three low-order bits of currentComponent[8] specify the bits per pixel. const size_t numColors = 2 << (currentComponent[8] & 0x7); if (currentFrameIsFirstFrame()) { @@ -782,7 +782,7 @@ bool SkGifImageReader::parse(SkGifImageReader::SkGIFParseQuery query) currentFrame->setHeaderDefined(); currentFrame->setRect(xOffset, yOffset, width, height); - currentFrame->setInterlaced(currentComponent[8] & 0x40); + currentFrame->setInterlaced(SkToBool(currentComponent[8] & 0x40)); // Overlaying interlaced, transparent GIFs over // existing image data using the Haeberli display hack diff --git a/third_party/gif/SkGifImageReader.h b/third_party/gif/SkGifImageReader.h index 09c5622..45a1ce6 100644 --- a/third_party/gif/SkGifImageReader.h +++ b/third_party/gif/SkGifImageReader.h @@ -110,7 +110,7 @@ public: bool prepareToDecode(); bool outputRow(const unsigned char* rowBegin); bool doLZW(const unsigned char* block, size_t bytesInBlock); - bool hasRemainingRows() { return rowsRemaining; } + bool hasRemainingRows() { return SkToBool(rowsRemaining); } private: // LZW decoding states and output states.