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

Unified Diff: chrome/browser/image_decoder.h

Issue 2715153006: Set desired_image_size when decoding images for NTP Tile icons. (Closed)
Patch Set: ran git cl format as suggested Created 3 years, 10 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: chrome/browser/image_decoder.h
diff --git a/chrome/browser/image_decoder.h b/chrome/browser/image_decoder.h
index 2770662f3657eee796a61fa2407fd2592130fd2f..68d3b1e2b298ac398053553272a31f474020e66d 100644
--- a/chrome/browser/image_decoder.h
+++ b/chrome/browser/image_decoder.h
@@ -15,6 +15,10 @@
#include "base/sequenced_task_runner.h"
#include "base/synchronization/lock.h"
+namespace gfx {
+class Size;
+} // namespace gfx
+
class SkBitmap;
// This is a helper class for decoding images safely in a sandboxed service. To
@@ -83,10 +87,14 @@ class ImageDecoder {
// Starts asynchronous image decoding. Once finished, the callback will be
// posted back to image_request's |task_runner_|.
+ // For images with multiple frames (e.g. ico files), a frame with a size as
+ // close as possible to |desired_image_frame_size| is chosen (tries to take
+ // one in larger size if there's no precise match).
Mathieu 2017/03/01 14:36:23 mention that people can pass gfx::Size() and what
tschumann 2017/03/01 19:40:08 Done.
static void StartWithOptions(ImageRequest* image_request,
std::vector<uint8_t> image_data,
ImageCodec image_codec,
- bool shrink_to_fit);
+ bool shrink_to_fit,
+ const gfx::Size& desired_image_frame_size);
// Deprecated. Use std::vector<uint8_t> version to avoid an extra copy.
static void StartWithOptions(ImageRequest* image_request,
const std::string& image_data,
@@ -106,7 +114,8 @@ class ImageDecoder {
void StartWithOptionsImpl(ImageRequest* image_request,
std::vector<uint8_t> image_data,
ImageCodec image_codec,
- bool shrink_to_fit);
+ bool shrink_to_fit,
+ const gfx::Size& desired_image_frame_size);
void CancelImpl(ImageRequest* image_request);

Powered by Google App Engine
This is Rietveld 408576698