Fix bug: can't convert nullptr -> bool
Change-Id: Ib37c46d00b6a3e768e6d8399f2a6afb332d36bff Reviewed-on: https://skia-review.googlesource.com/5141 Commit-Queue: Hal Canary <halcanary@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
This commit is contained in:
parent
818d8a99e8
commit
2cb6cb7218
@ -14,6 +14,9 @@
|
||||
* Enum describing format of encoded data.
|
||||
*/
|
||||
enum class SkEncodedImageFormat {
|
||||
#ifdef GOOGLE3
|
||||
kUnknown,
|
||||
#endif
|
||||
kBMP,
|
||||
kGIF,
|
||||
kICO,
|
||||
|
@ -47,6 +47,9 @@ inline bool SkEncodeImage(SkWStream* dst, const SkBitmap& src, SkEncodedImageFor
|
||||
class SkImageEncoder {
|
||||
public:
|
||||
enum Type {
|
||||
#ifdef GOOGLE3
|
||||
kUnknown_Type = (uint8_t)SkEncodedImageFormat::kUnknown,
|
||||
#endif
|
||||
kBMP_Type = (uint8_t)SkEncodedImageFormat::kBMP,
|
||||
kGIF_Type = (uint8_t)SkEncodedImageFormat::kGIF,
|
||||
kICO_Type = (uint8_t)SkEncodedImageFormat::kICO,
|
||||
|
@ -11,7 +11,7 @@ bool SkEncodeImage(SkWStream* dst, const SkPixmap& src,
|
||||
SkEncodedImageFormat format, int quality) {
|
||||
SkBitmap bm;
|
||||
if (!bm.installPixels(src)) {
|
||||
return nullptr;
|
||||
return false;
|
||||
}
|
||||
bm.setImmutable();
|
||||
std::unique_ptr<SkImageEncoder> enc(SkImageEncoder::Create((SkImageEncoder::Type)format));
|
||||
|
Loading…
Reference in New Issue
Block a user