Index: third_party/libwebp/enc/picture_tools.c |
diff --git a/third_party/libwebp/enc/picture_tools.c b/third_party/libwebp/enc/picture_tools.c |
index 7c73646397b765e30f336c8db964ad565bf8afe3..bf97af84081a8173aaead759c8362897eb3eca9d 100644 |
--- a/third_party/libwebp/enc/picture_tools.c |
+++ b/third_party/libwebp/enc/picture_tools.c |
@@ -11,6 +11,8 @@ |
// |
// Author: Skal (pascal.massimino@gmail.com) |
+#include <assert.h> |
+ |
#include "./vp8enci.h" |
#include "../dsp/yuv.h" |
@@ -120,6 +122,24 @@ void WebPCleanupTransparentArea(WebPPicture* pic) { |
#undef SIZE |
#undef SIZE2 |
+void WebPCleanupTransparentAreaLossless(WebPPicture* const pic) { |
+ int x, y, w, h; |
+ uint32_t* argb; |
+ assert(pic != NULL && pic->use_argb); |
+ w = pic->width; |
+ h = pic->height; |
+ argb = pic->argb; |
+ |
+ for (y = 0; y < h; ++y) { |
+ for (x = 0; x < w; ++x) { |
+ if ((argb[x] & 0xff000000) == 0) { |
+ argb[x] = 0x00000000; |
+ } |
+ } |
+ argb += pic->argb_stride; |
+ } |
+} |
+ |
//------------------------------------------------------------------------------ |
// Blend color and remove transparency info |