diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-07 18:30:18 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-11-07 18:30:18 +0000 |
commit | 2a7579d11796866b0026755ab52597d09f4509cc (patch) | |
tree | 786887dfa086b39139f8b7b37b6f0634d8db9eac /src/ports | |
parent | 4a26d9d62a6d762a518c0ca08d43189916b75cf2 (diff) |
CG imagedecoder never sets isOpaque, so add method to SkBitmap to compute that,
and call it from CG imagedecoder.
Review URL: https://codereview.appspot.com/6816101
git-svn-id: http://skia.googlecode.com/svn/trunk@6334 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/ports')
-rw-r--r-- | src/ports/SkImageDecoder_CG.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ports/SkImageDecoder_CG.cpp b/src/ports/SkImageDecoder_CG.cpp index bcd3e3741c..ba7a89c91e 100644 --- a/src/ports/SkImageDecoder_CG.cpp +++ b/src/ports/SkImageDecoder_CG.cpp @@ -6,6 +6,7 @@ * found in the LICENSE file. */ +#include "SkColorPriv.h" #include "SkImageDecoder.h" #include "SkImageEncoder.h" @@ -86,6 +87,8 @@ bool SkImageDecoder_CG::onDecode(SkStream* stream, SkBitmap* bm, Mode mode) { CGContextDrawImage(cg, CGRectMake(0, 0, width, height), image); CGContextRelease(cg); + // since CGImage won't tell us if it is opaque, we have to compute it. + bm->computeAndSetOpaquePredicate(); bm->unlockPixels(); return true; } |