aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar msarett <msarett@google.com>2016-06-13 11:25:03 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-06-13 11:25:03 -0700
commitbe36d59e664513294c02ff9691a3c1817a712fee (patch)
treeabd01814ad4b984cc72862726130b8ee51cc9bb6 /src
parentb4da01d8f719f3c43d492e8f62a7e2c861e9ef27 (diff)
Fix SkImage::asLegacyBitmap() to respect color space info
Diffstat (limited to 'src')
-rw-r--r--src/image/SkImage.cpp4
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;
}