summaryrefslogtreecommitdiffstats
path: root/webkit/glue/image_decoder.cc
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 15:33:55 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-15 15:33:55 +0000
commitf8a7bf5a45ddbab7bd3cd32fbb1a66bba04b2639 (patch)
tree42fdd4d1740f1423d61d85a8d159f141aadb114d /webkit/glue/image_decoder.cc
parente363ceb53762d31312fc8594809706ce46093cd7 (diff)
downloadchromium_src-f8a7bf5a45ddbab7bd3cd32fbb1a66bba04b2639.zip
chromium_src-f8a7bf5a45ddbab7bd3cd32fbb1a66bba04b2639.tar.gz
chromium_src-f8a7bf5a45ddbab7bd3cd32fbb1a66bba04b2639.tar.bz2
Fix favicon display on the NTP on os x. The favicons get corrupted before they are
written to the favicon db, so this patch will only fix new favicons. TEST=Open the NTP and see that favicons with transparency look broken. Close Chromium, delete ~/Library/Application\ Support/Chromium, go to a page with a favicon with transparency (e.g. http://codereview.chromium.org/), open another NTP, and make sure that the favicon is now displayed correctly. BUG=None as far as I know. Review URL: http://codereview.chromium.org/126108 Review URL: http://codereview.chromium.org/126108 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18389 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/image_decoder.cc')
-rw-r--r--webkit/glue/image_decoder.cc6
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;