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

Unified Diff: src/lazy/SkDiscardablePixelRef.cpp

Issue 518103002: use possible corrected info when creating pixelref (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/lazy/SkDiscardablePixelRef.cpp
diff --git a/src/lazy/SkDiscardablePixelRef.cpp b/src/lazy/SkDiscardablePixelRef.cpp
index ce38a4a877b9f2cad2c645b3ec66b9309aba95a6..a86c3deff426a07c548cec81a3325f294e23e6d2 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();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698