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

Unified Diff: src/image/SkImage.cpp

Issue 2061783002: Fix SkImage::asLegacyBitmap() to respect color space info (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Fix windows Created 4 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 | « gm/bitmapimage.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/image/SkImage.cpp
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp
index 1c1b311b9381cda6966bf6ca2f3880655a45ef0e..88cf779081bf47ed4d10619904db6472c6a74d72 100644
--- a/src/image/SkImage.cpp
+++ b/src/image/SkImage.cpp
@@ -319,8 +319,8 @@ bool SkImage::asLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const {
bool SkImage_Base::onAsLegacyBitmap(SkBitmap* bitmap, LegacyBitmapMode mode) const {
// As the base-class, all we can do is make a copy (regardless of mode).
// Subclasses that want to be more optimal should override.
- SkImageInfo info = SkImageInfo::MakeN32(this->width(), this->height(),
- this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
+ SkImageInfo info = this->onImageInfo().makeColorType(kN32_SkColorType)
+ .makeAlphaType(this->isOpaque() ? kOpaque_SkAlphaType : kPremul_SkAlphaType);
if (!bitmap->tryAllocPixels(info)) {
return false;
}
« no previous file with comments | « gm/bitmapimage.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698