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

Unified Diff: ui/gfx/image/image_util.cc

Issue 8631002: [ntp4] Use highest quality jpeg compression for thumbnail images. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 1 month 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
« ui/gfx/image/image_util.h ('K') | « ui/gfx/image/image_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_util.cc
===================================================================
--- ui/gfx/image/image_util.cc (revision 111060)
+++ ui/gfx/image/image_util.cc (working copy)
@@ -26,7 +26,7 @@
return gfx::PNGCodec::EncodeBGRASkBitmap(bitmap, false, dst);
}
-bool JPEGEncodedDataFromImage(const Image& image,
+bool JPEGEncodedDataFromImage(const Image& image, int quality,
std::vector<unsigned char>* dst) {
const SkBitmap& bitmap = image;
SkAutoLockPixels bitmap_lock(bitmap);
@@ -34,14 +34,11 @@
if (!bitmap.readyToDraw())
return false;
- // Use 90 quality (out of 100) which is pretty high, because
- // we're very sensitive to artifacts for these small sized,
- // highly detailed images.
return gfx::JPEGCodec::Encode(
reinterpret_cast<unsigned char*>(bitmap.getAddr32(0, 0)),
gfx::JPEGCodec::FORMAT_BGRA, bitmap.width(),
bitmap.height(),
- static_cast<int>(bitmap.rowBytes()), 90,
+ static_cast<int>(bitmap.rowBytes()), quality,
dst);
}
« ui/gfx/image/image_util.h ('K') | « ui/gfx/image/image_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698