diff options
Diffstat (limited to 'webkit/glue/image_decoder.cc')
-rw-r--r-- | webkit/glue/image_decoder.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/webkit/glue/image_decoder.cc b/webkit/glue/image_decoder.cc index 178ef9d..8f138ca 100644 --- a/webkit/glue/image_decoder.cc +++ b/webkit/glue/image_decoder.cc @@ -102,6 +102,12 @@ SkBitmap ImageDecoder::Decode(const unsigned char* data, size_t size) const { CGRect rect = CGRectMake(0, 0, CGImageGetWidth(image.get()), CGImageGetHeight(image.get())); + + // We want to copy transparent pixels from |image| over to |result|, instead + // of blending |image| onto the uninitialized pixels of |result|. Since + // |context| is used only locally, there's no need to restore the blend mode. + CGContextSetBlendMode(context.get(), kCGBlendModeCopy); + CGContextDrawImage(context.get(), rect, image.get()); return result; |