libcef/browser/image_impl.cc
// Compress as PNG. Requires post-multiplied alpha.
Compress as PNG. Requires post-multiplied alpha.
Compress as PNG . Requires post - multiplied alpha .
bool PNGMethod(bool with_transparency,
               const SkBitmap& bitmap,
               std::vector<unsigned char>* compressed) {
  return gfx::PNGCodec::Encode(
      reinterpret_cast<unsigned char*>(bitmap.getPixels()),
      bitmap.colorType() == kBGRA_8888_SkColorType ? gfx::PNGCodec::FORMAT_BGRA
                                                   : gfx::PNGCodec::FORMAT_RGBA,
      gfx::Size(bitmap.width(), bitmap.height()),
      static_cast<int>(bitmap.rowBytes()),
      bitmap.alphaType() == kOpaque_SkAlphaType || !with_transparency,
      std::vector<gfx::PNGCodec::Comment>(), compressed);
}
bool PNGMethod ( bool with_transparency , const SkBitmap & bitmap , std :: vector < unsigned char > * compressed ) { return gfx :: PNGCodec :: Encode ( reinterpret_cast < unsigned char * > ( bitmap . getPixels ( ) ) , bitmap . colorType ( ) == kBGRA_8888_SkColorType ? gfx :: PNGCodec :: FORMAT_BGRA : gfx :: PNGCodec :: FORMAT_RGBA , gfx :: Size ( bitmap . width ( ) , bitmap . height ( ) ) , static_cast < int > ( bitmap . rowBytes ( ) ) , bitmap . alphaType ( ) == kOpaque_SkAlphaType || ! with_transparency , std :: vector < gfx :: PNGCodec :: Comment > ( ) , compressed ) ; }
Compress as PNG.
Compress as PNG .