Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(330)

Unified Diff: src/image/SkImage.cpp

Issue 305483005: remove SkBitmap::asImageInfo (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/image/SkImagePriv.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/core/SkImageFilter.cpp ('k') | src/image/SkImagePriv.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698