diff options
author | noel@chromium.org <noel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 08:09:20 +0000 |
---|---|---|
committer | noel@chromium.org <noel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-04 08:09:20 +0000 |
commit | 24258f8c58c172fe7ce59822752f9757ebb7e53c (patch) | |
tree | 82143864d471750dd092017dbf0b029906e08cac /third_party/libwebp/webp | |
parent | 5750c520339e4bd5ff202a1ce17be8e2c659be2b (diff) | |
download | chromium_src-24258f8c58c172fe7ce59822752f9757ebb7e53c.zip chromium_src-24258f8c58c172fe7ce59822752f9757ebb7e53c.tar.gz chromium_src-24258f8c58c172fe7ce59822752f9757ebb7e53c.tar.bz2 |
When importing BGRA or RGBA data for encoding, provide variants of
the WEBPImportPicture API for RGBX and BRGX data meaning the alpha
channel should be ignored.
Note: the existing WEBPImportPictureRGBA|BGRA routines also ignore
the alpha channel, but won't in a future version of libwebp. Thus,
if WebKit continues using the existing routines, the alpha channel
will be imported and encoded in libwebp.next, and hence will break
canvas.toDataURL("image/webp") and its layout tests.
BUG=130144
TEST=Webkit test pass when using the new functions.
Review URL: https://chromiumcodereview.appspot.com/10496016
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@140264 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/libwebp/webp')
-rw-r--r-- | third_party/libwebp/webp/encode.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/third_party/libwebp/webp/encode.h b/third_party/libwebp/webp/encode.h index 31f0539..ae98419 100644 --- a/third_party/libwebp/webp/encode.h +++ b/third_party/libwebp/webp/encode.h @@ -249,15 +249,22 @@ WEBP_EXTERN(int) WebPPictureRescale(WebPPicture* const pic, // Returns 0 in case of memory error. WEBP_EXTERN(int) WebPPictureImportRGB( WebPPicture* const picture, const uint8_t* const rgb, int rgb_stride); -// Same, but for RGBA buffer +// Same, but for RGBA buffer. WEBP_EXTERN(int) WebPPictureImportRGBA( WebPPicture* const picture, const uint8_t* const rgba, int rgba_stride); +// Same, but for RGBA buffer. Imports the RGB direct from the 32-bit format +// input buffer ignoring the alpha channel. Avoids needing to copy the data +// to a temporary 24-bit RGB buffer to import the RGB only. +WEBP_EXTERN(int) WebPPictureImportRGBX( + WebPPicture* const picture, const uint8_t* const rgbx, int rgbx_stride); -// Variant of the above, but taking BGR(A) input: +// Variants of the above, but taking BGR(A|X) input. WEBP_EXTERN(int) WebPPictureImportBGR( WebPPicture* const picture, const uint8_t* const bgr, int bgr_stride); WEBP_EXTERN(int) WebPPictureImportBGRA( WebPPicture* const picture, const uint8_t* const bgra, int bgra_stride); +WEBP_EXTERN(int) WebPPictureImportBGRX( + WebPPicture* const picture, const uint8_t* const bgrx, int bgrx_stride); //------------------------------------------------------------------------------ // Main call |