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

Unified Diff: src/pdf/SkPDFBitmap.cpp

Issue 2250663002: Add alphaType() to SkImage (Closed) Base URL: https://skia.googlesource.com/skia.git@special-image-alpha-type
Patch Set: Remove virtuals from SkImage, slight cleanup Created 4 years, 4 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/image/SkImage_Raster.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFBitmap.cpp
diff --git a/src/pdf/SkPDFBitmap.cpp b/src/pdf/SkPDFBitmap.cpp
index 887bca4ab0f427b5e845e821d64f19099ca59ec6..772745ca50aa29e05fc4435e04a556746fc841d2 100644
--- a/src/pdf/SkPDFBitmap.cpp
+++ b/src/pdf/SkPDFBitmap.cpp
@@ -32,8 +32,7 @@ void image_get_ro_pixels(const SkImage* image, SkBitmap* dst) {
}
}
// no pixels or wrong size: fill with zeros.
- SkAlphaType at = image->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
- dst->setInfo(SkImageInfo::MakeN32(image->width(), image->height(), at));
+ dst->setInfo(SkImageInfo::MakeN32(image->width(), image->height(), image->alphaType()));
}
bool image_compute_is_opaque(const SkImage* image) {
« no previous file with comments | « src/image/SkImage_Raster.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698