| Index: base/gfx/png_encoder.cc
|
| diff --git a/base/gfx/png_encoder.cc b/base/gfx/png_encoder.cc
|
| old mode 100644
|
| new mode 100755
|
| index 7b44a5259867babfd88750acc40f2be593436182..64e46d7c16ee286782f9f3836d5e6391863fd966
|
| --- a/base/gfx/png_encoder.cc
|
| +++ b/base/gfx/png_encoder.cc
|
| @@ -5,6 +5,7 @@
|
| #include "base/basictypes.h"
|
| #include "base/gfx/png_encoder.h"
|
| #include "base/logging.h"
|
| +#include "skia/include/SkBitmap.h"
|
|
|
| extern "C" {
|
| #include "png.h"
|
| @@ -191,3 +192,14 @@ bool PNGEncoder::Encode(const unsigned char* input, ColorFormat format,
|
| return true;
|
| }
|
|
|
| +// static
|
| +bool PNGEncoder::EncodeBGRASkBitmap(const SkBitmap& input,
|
| + bool discard_transparency,
|
| + std::vector<unsigned char>* output) {
|
| + SkAutoLockPixels input_lock(input);
|
| + DCHECK_EQ(input.bytesPerPixel(), 4);
|
| + return Encode(static_cast<unsigned char*>(input.getPixels()),
|
| + PNGEncoder::FORMAT_BGRA, input.width(), input.height(),
|
| + input.rowBytes(), discard_transparency, output);
|
| +}
|
| +
|
|
|