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

Unified Diff: src/lazy/SkLazyPixelRef.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/lazy/SkLazyPixelRef.cpp
diff --git a/src/lazy/SkLazyPixelRef.cpp b/src/lazy/SkLazyPixelRef.cpp
index 9e023c4a7c8859369886fe07a650c85fe1c69e23..22d4b112f18688dcedcef287dac019bc7c5f9210 100644
--- a/src/lazy/SkLazyPixelRef.cpp
+++ b/src/lazy/SkLazyPixelRef.cpp
@@ -150,15 +150,14 @@ SkData* SkLazyPixelRef::onRefEncodedData() {
static bool init_from_info(SkBitmap* bm, const SkImage::Info& info,
size_t rowBytes) {
- bool isOpaque;
- SkBitmap::Config config = SkImageInfoToBitmapConfig(info, &isOpaque);
+ SkBitmap::Config config = SkImageInfoToBitmapConfig(info);
if (SkBitmap::kNo_Config == config) {
return false;
}
- bm->setConfig(config, info.fWidth, info.fHeight, rowBytes);
- bm->setIsOpaque(isOpaque);
- return bm->allocPixels();
+ return bm->setConfig(config, info.fWidth, info.fHeight, rowBytes, info.fAlphaType)
+ &&
+ bm->allocPixels();
}
bool SkLazyPixelRef::onImplementsDecodeInto() {

Powered by Google App Engine
This is Rietveld 408576698