Index: src/image/SkImagePriv.h |
diff --git a/src/image/SkImagePriv.h b/src/image/SkImagePriv.h |
index 3a5c59a13e5b71b6a89cf9d0db61c764c43af1bb..d3b1c79a79903b5cd9d6b5362bc0f53552dbdced 100644 |
--- a/src/image/SkImagePriv.h |
+++ b/src/image/SkImagePriv.h |
@@ -30,7 +30,11 @@ extern SkImage* SkNewImageFromPixelRef(const SkImageInfo&, SkPixelRef*, |
extern SkImage* SkNewImageFromBitmap(const SkBitmap&, bool canSharePixelRef, const SkSurfaceProps*); |
static inline size_t SkImageMinRowBytes(const SkImageInfo& info) { |
- return SkAlign4(info.minRowBytes()); |
+ size_t minRB = info.minRowBytes(); |
+ if (kIndex_8_SkColorType != info.colorType()) { |
+ minRB = SkAlign4(minRB); |
+ } |
+ return minRB; |
} |
// Given an image created from SkNewImageFromBitmap, return its pixelref. This |