Index: src/image/SkImage.cpp |
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp |
index 4cbfd81bedbaa34f215d500399f9c8d536fea7dd..e0a13f915bdef3116ef2f212eb5c17d4445f2c5a 100644 |
--- a/src/image/SkImage.cpp |
+++ b/src/image/SkImage.cpp |
@@ -103,18 +103,16 @@ static bool raster_canvas_supports(const SkImageInfo& info) { |
} |
bool SkImage_Base::onReadPixels(SkBitmap* bitmap, const SkIRect& subset) const { |
- SkImageInfo info; |
- |
if (bitmap->pixelRef()) { |
- if (!bitmap->asImageInfo(&info)) { |
+ const SkImageInfo info = bitmap->info(); |
+ if (kUnknown_SkColorType == info.colorType()) { |
return false; |
} |
if (!raster_canvas_supports(info)) { |
return false; |
} |
} else { |
- SkImageInfo info = SkImageInfo::MakeN32Premul(subset.width(), |
- subset.height()); |
+ const SkImageInfo info = SkImageInfo::MakeN32Premul(subset.width(), subset.height()); |
SkBitmap tmp; |
if (!tmp.allocPixels(info)) { |
return false; |