diff options
author | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 04:19:46 +0000 |
---|---|---|
committer | aa@chromium.org <aa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-24 04:19:46 +0000 |
commit | 20ee7a74a7587986ed5db9b13aac2a78a5f0bdfc (patch) | |
tree | eb3cd5661b20400e3636fd472b82149ff105195c /chrome | |
parent | a40ac6908178a1570e17bc3b501298d7a525be39 (diff) | |
download | chromium_src-20ee7a74a7587986ed5db9b13aac2a78a5f0bdfc.zip chromium_src-20ee7a74a7587986ed5db9b13aac2a78a5f0bdfc.tar.gz chromium_src-20ee7a74a7587986ed5db9b13aac2a78a5f0bdfc.tar.bz2 |
Fix premultiplication mismatch in
chrome.browserAction.setIcon().
SkBitmap expects premultiplied values, canvas returns them
not premultiplied.
BUG=24643
TEST=install gmail browser action sample. Should not have
weird colorful artifacts around edges.
Review URL: http://codereview.chromium.org/333011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29996 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/renderer/extensions/extension_process_bindings.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/renderer/extensions/extension_process_bindings.cc b/chrome/renderer/extensions/extension_process_bindings.cc index 2e8d036..a9360eb 100644 --- a/chrome/renderer/extensions/extension_process_bindings.cc +++ b/chrome/renderer/extensions/extension_process_bindings.cc @@ -24,6 +24,7 @@ #include "grit/common_resources.h" #include "grit/renderer_resources.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "third_party/skia/include/core/SkColor.h" #include "webkit/api/public/WebFrame.h" #include "webkit/api/public/WebURL.h" #include "webkit/api/public/WebKit.h" @@ -437,11 +438,11 @@ class ExtensionImpl : public ExtensionBase { uint32_t* pixels = bitmap.getAddr32(0, 0); for (int t = 0; t < width*height; t++) { // |data| is RGBA, pixels is ARGB. - pixels[t] = + pixels[t] = SkPreMultiplyColor( ((data->Get(v8::Integer::New(4*t + 3))->Int32Value() & 0xFF) << 24) | ((data->Get(v8::Integer::New(4*t + 0))->Int32Value() & 0xFF) << 16) | ((data->Get(v8::Integer::New(4*t + 1))->Int32Value() & 0xFF) << 8) | - ((data->Get(v8::Integer::New(4*t + 2))->Int32Value() & 0xFF) << 0); + ((data->Get(v8::Integer::New(4*t + 2))->Int32Value() & 0xFF) << 0)); } // Construct the Value object. |