diff options
author | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 09:43:16 +0000 |
---|---|---|
committer | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-05 09:43:16 +0000 |
commit | 7b73bbc974ff74e28aecdad6cbf10b43d99a29e3 (patch) | |
tree | e144e1a6dc7326656ea2bdc88108e3e5263aec5d /ui/gfx/codec | |
parent | baa0e34f39f96dd52ff7421c3d4058a663f14d38 (diff) | |
download | chromium_src-7b73bbc974ff74e28aecdad6cbf10b43d99a29e3.zip chromium_src-7b73bbc974ff74e28aecdad6cbf10b43d99a29e3.tar.gz chromium_src-7b73bbc974ff74e28aecdad6cbf10b43d99a29e3.tar.bz2 |
Aura: Adds custom cursors for drag and drop.
BUG=121135
TEST=none
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=135378
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=135426
Review URL: http://codereview.chromium.org/10316019
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@135533 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/codec')
-rw-r--r-- | ui/gfx/codec/png_codec.cc | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/ui/gfx/codec/png_codec.cc b/ui/gfx/codec/png_codec.cc index 1ca139d..da73928 100644 --- a/ui/gfx/codec/png_codec.cc +++ b/ui/gfx/codec/png_codec.cc @@ -8,6 +8,7 @@ #include "base/memory/scoped_ptr.h" #include "base/string_util.h" #include "ui/gfx/size.h" +#include "ui/gfx/skia_util.h" #include "third_party/skia/include/core/SkBitmap.h" #include "third_party/skia/include/core/SkUnPreMultiply.h" #include "third_party/skia/include/core/SkColorPriv.h" @@ -76,25 +77,7 @@ void ConvertSkiatoRGB(const unsigned char* skia, int pixel_width, void ConvertSkiatoRGBA(const unsigned char* skia, int pixel_width, unsigned char* rgba, bool* is_opaque) { - int total_length = pixel_width * 4; - for (int i = 0; i < total_length; i += 4) { - const uint32_t pixel_in = *reinterpret_cast<const uint32_t*>(&skia[i]); - - // Pack the components here. - int alpha = SkGetPackedA32(pixel_in); - if (alpha != 0 && alpha != 255) { - SkColor unmultiplied = SkUnPreMultiply::PMColorToColor(pixel_in); - rgba[i + 0] = SkColorGetR(unmultiplied); - rgba[i + 1] = SkColorGetG(unmultiplied); - rgba[i + 2] = SkColorGetB(unmultiplied); - rgba[i + 3] = alpha; - } else { - rgba[i + 0] = SkGetPackedR32(pixel_in); - rgba[i + 1] = SkGetPackedG32(pixel_in); - rgba[i + 2] = SkGetPackedB32(pixel_in); - rgba[i + 3] = alpha; - } - } + gfx::ConvertSkiaToRGBA(skia, pixel_width, rgba); } } // namespace |