aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/lazy
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-08-29 08:23:55 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-29 08:23:56 -0700
commitb75b2c05b999e26343e095eabff646705a0091ae (patch)
tree73ad20ea74265d412dea296f45e5e6397fcc6e72 /src/lazy
parent7187593b4b99529e9386f259639191ba750ed355 (diff)
use possible corrected info when creating pixelref
TBR=halcanary, scroggo Author: reed@google.com Review URL: https://codereview.chromium.org/518103002
Diffstat (limited to 'src/lazy')
-rw-r--r--src/lazy/SkDiscardablePixelRef.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index ce38a4a877..a86c3deff4 100644
--- a/src/lazy/SkDiscardablePixelRef.cpp
+++ b/src/lazy/SkDiscardablePixelRef.cpp
@@ -105,7 +105,10 @@ bool SkInstallDiscardablePixelRef(SkImageGenerator* generator, SkBitmap* dst,
|| (!dst->setInfo(info))) {
return false;
}
- SkASSERT(dst->colorType() != kUnknown_SkColorType);
+ // Since dst->setInfo() may have changed/fixed-up info, we copy it back from that bitmap
+ info = dst->info();
+
+ SkASSERT(info.colorType() != kUnknown_SkColorType);
if (dst->empty()) { // Use a normal pixelref.
return dst->allocPixels();
}