From 2a7579d11796866b0026755ab52597d09f4509cc Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 7 Nov 2012 18:30:18 +0000 Subject: 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 --- src/ports/SkImageDecoder_CG.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/ports') 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; } -- cgit v1.2.3