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);
}
}
}
}
SkAutoCanvasRestore acr(canvas, true);
- canvas->translate(0, fCodec->getInfo().height());
+ canvas->translate(0, SkIntToScalar(fCodec->getInfo().height()));
this->drawFrame(canvas, fFrame);
}
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;
}
}
- 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()) {
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
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.