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

Unified Diff: src/image/SkImagePriv.h

Issue 1222683004: add colortable param to newrastercopy (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add test Created 5 years, 6 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 | « include/core/SkImage.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « include/core/SkImage.h ('k') | src/image/SkImage_Raster.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698