sk_sp: act as if operator bool() not implicit.

Change-Id: Icd426a162ca0c778db7b3373efcb2c546da50273
Reviewed-on: https://skia-review.googlesource.com/22543
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
This commit is contained in:
Hal Canary 2017-07-12 11:59:17 -04:00 committed by Skia Commit-Bot
parent 80ace82be1
commit 9a0e39054c
3 changed files with 3 additions and 3 deletions

View File

@ -165,7 +165,7 @@ void SkGifCodec::initializeColorTable(const SkImageInfo& dstInfo, int frameIndex
}
sk_sp<SkColorTable> currColorTable = fReader->getColorTable(colorTableColorType, frameIndex);
fCurrColorTableIsReal = currColorTable;
fCurrColorTableIsReal = static_cast<bool>(currColorTable);
if (!fCurrColorTableIsReal) {
// This is possible for an empty frame. Create a dummy with one value (transparent).
SkPMColor color = SK_ColorTRANSPARENT;

View File

@ -35,7 +35,7 @@ public:
SkColorSpace* getColorSpace() const { return fColorSpace.get(); }
sk_sp<SkColorSpace> refColorSpace() const { return fColorSpace; }
bool isGammaCorrect() const { return fColorSpace; }
bool isGammaCorrect() const { return static_cast<bool>(fColorSpace); }
// TODO: these two calls would be way cooler if this object had a GrSurfaceProxy pointer
int width() const { return this->asSurfaceProxy()->width(); }

View File

@ -437,7 +437,7 @@ void SkLightingShaderImpl::flatten(SkWriteBuffer& buf) const {
fLights->flatten(buf);
buf.writeFlattenable(fNormalSource.get());
buf.writeBool(fDiffuseShader);
buf.writeBool(static_cast<bool>(fDiffuseShader));
if (fDiffuseShader) {
buf.writeFlattenable(fDiffuseShader.get());
}