diff options
author | msarett <msarett@google.com> | 2016-06-13 11:25:03 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-06-13 11:25:03 -0700 |
commit | be36d59e664513294c02ff9691a3c1817a712fee (patch) | |
tree | abd01814ad4b984cc72862726130b8ee51cc9bb6 /src | |
parent | b4da01d8f719f3c43d492e8f62a7e2c861e9ef27 (diff) |
Fix SkImage::asLegacyBitmap() to respect color space info
BUG=skia:5428
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2061783002
Review-Url: https://codereview.chromium.org/2061783002
Diffstat (limited to 'src')
-rw-r--r-- | src/image/SkImage.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/image/SkImage.cpp b/src/image/SkImage.cpp index 1c1b311b93..88cf779081 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; } |