Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Unified Diff: services/data_decoder/image_decoder_impl_unittest.cc

Issue 2895953003: Use SkJpegEncoder in gfx jpeg_codec (Closed)
Patch Set: Update comment Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/data_decoder/image_decoder_impl_unittest.cc
diff --git a/services/data_decoder/image_decoder_impl_unittest.cc b/services/data_decoder/image_decoder_impl_unittest.cc
index 0f304256d7e466410a11fbb1303441bd1d33ed78..55c87e8d768091d523bd7f4d584a7c2f32cd1cad 100644
--- a/services/data_decoder/image_decoder_impl_unittest.cc
+++ b/services/data_decoder/image_decoder_impl_unittest.cc
@@ -35,11 +35,12 @@ bool CreateJPEGImage(int width,
bitmap.allocN32Pixels(width, height);
bitmap.eraseColor(color);
+ SkPixmap pixmap;
+ bool success = bitmap.peekPixels(&pixmap);
+ DCHECK(success);
+
const int kQuality = 50;
- if (!gfx::JPEGCodec::Encode(
- static_cast<const unsigned char*>(bitmap.getPixels()),
- gfx::JPEGCodec::FORMAT_SkBitmap, width, height,
- static_cast<int>(bitmap.rowBytes()), kQuality, output)) {
+ if (!gfx::JPEGCodec::Encode(pixmap, kQuality, output)) {
LOG(ERROR) << "Unable to encode " << width << "x" << height << " bitmap";
return false;
}

Powered by Google App Engine
This is Rietveld 408576698