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

Unified Diff: src/image/SkImage_Raster.cpp

Issue 25275004: store SkAlphaType inside SkBitmap, on road to support unpremul (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 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
Index: src/image/SkImage_Raster.cpp
diff --git a/src/image/SkImage_Raster.cpp b/src/image/SkImage_Raster.cpp
index cd9b70f018bc6637192dbcca4a581af1b47ffc93..a208d83a7f213643e6fd862a8096d46120ee5687 100644
--- a/src/image/SkImage_Raster.cpp
+++ b/src/image/SkImage_Raster.cpp
@@ -31,8 +31,7 @@ public:
return false;
}
- bool isOpaque;
- if (SkImageInfoToBitmapConfig(info, &isOpaque) == SkBitmap::kNo_Config) {
+ if (SkImageInfoToBitmapConfig(info) == SkBitmap::kNo_Config) {
return false;
}
@@ -85,23 +84,19 @@ SkImage* SkImage_Raster::NewEmpty() {
SkImage_Raster::SkImage_Raster(const Info& info, SkData* data, size_t rowBytes)
: INHERITED(info.fWidth, info.fHeight) {
- bool isOpaque;
- SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
+ SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
- fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes);
+ fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes, info.fAlphaType);
fBitmap.setPixelRef(SkNEW_ARGS(SkDataPixelRef, (data)))->unref();
- fBitmap.setIsOpaque(isOpaque);
fBitmap.setImmutable();
}
SkImage_Raster::SkImage_Raster(const Info& info, SkPixelRef* pr, size_t rowBytes)
: INHERITED(info.fWidth, info.fHeight) {
- bool isOpaque;
- SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
+ SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
- fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes);
+ fBitmap.setConfig(config, info.fWidth, info.fHeight, rowBytes, info.fAlphaType);
fBitmap.setPixelRef(pr);
- fBitmap.setIsOpaque(isOpaque);
}
SkImage_Raster::~SkImage_Raster() {}

Powered by Google App Engine
This is Rietveld 408576698