Index: ui/gfx/codec/png_codec.h |
diff --git a/ui/gfx/codec/png_codec.h b/ui/gfx/codec/png_codec.h |
index abb3eaab32c952195791ff4b9684e86b2a1d5579..03347d498e61602dbccd53e98840cadfd89ab010 100644 |
--- a/ui/gfx/codec/png_codec.h |
+++ b/ui/gfx/codec/png_codec.h |
@@ -67,6 +67,8 @@ class GFX_EXPORT PNGCodec { |
// alpha values, these alpha values will be discarded and only RGB will be |
// written to the resulting file. Otherwise, alpha values in the input |
// will be preserved. |
+ // discard_color: when true, color images will be converted to grayscale |
+ // (can be used in combination with discard_transparency) |
// comments: comments to be written in the png's metadata. |
static bool Encode(const unsigned char* input, |
ColorFormat format, |
@@ -74,22 +76,26 @@ class GFX_EXPORT PNGCodec { |
int row_byte_width, |
bool discard_transparency, |
const std::vector<Comment>& comments, |
- std::vector<unsigned char>* output); |
+ std::vector<unsigned char>* output, |
+ bool discard_color = false); |
sadrul
2014/01/15 21:43:06
default parameter values are not allowed in chromi
|
// Call PNGCodec::Encode on the supplied SkBitmap |input|, which is assumed |
- // to be BGRA, 32 bits per pixel. The params |discard_transparency| and |
- // |output| are passed directly to Encode; refer to Encode for more |
- // information. During the call, an SkAutoLockPixels lock is held on |input|. |
+ // to be BGRA, 32 bits per pixel. The params |discard_transparency|, |
+ // |discard_color|, and |output| are passed directly to Encode; refer to |
+ // Encode for more information. During the call, an SkAutoLockPixels lock |
+ // is held on |input|. |
static bool EncodeBGRASkBitmap(const SkBitmap& input, |
bool discard_transparency, |
- std::vector<unsigned char>* output); |
+ std::vector<unsigned char>* output, |
+ bool discard_color = false); |
// Call PNGCodec::Encode on the supplied SkBitmap |input|. The difference |
// between this and the previous method is that this restricts compression to |
// zlib q1, which is just rle encoding. |
static bool FastEncodeBGRASkBitmap(const SkBitmap& input, |
bool discard_transparency, |
- std::vector<unsigned char>* output); |
+ std::vector<unsigned char>* output, |
+ bool discard_color = false); |
// Decodes the PNG data contained in input of length input_size. The |
// decoded data will be placed in *output with the dimensions in *w and *h |