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

Unified Diff: components/suggestions/image_encoder.cc

Issue 2895953003: Use SkJpegEncoder in gfx jpeg_codec (Closed)
Patch Set: Remove brackets 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: components/suggestions/image_encoder.cc
diff --git a/components/suggestions/image_encoder.cc b/components/suggestions/image_encoder.cc
index 8b0fa09fc260d64b8df3bc12cf5499dd017f604e..414766446c4e5e225e19cc4c7becd8e1b521e99d 100644
--- a/components/suggestions/image_encoder.cc
+++ b/components/suggestions/image_encoder.cc
@@ -20,10 +20,8 @@ bool EncodeSkBitmapToJPEG(const SkBitmap& bitmap,
if (!bitmap.readyToDraw() || bitmap.isNull()) {
return false;
}
- return gfx::JPEGCodec::Encode(
- reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)),
- gfx::JPEGCodec::FORMAT_SkBitmap, bitmap.width(), bitmap.height(),
- bitmap.rowBytes(), 100, dest);
+
+ return gfx::JPEGCodec::Encode(bitmap, 100, dest);
}
} // namespace suggestions

Powered by Google App Engine
This is Rietveld 408576698