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

Unified Diff: chrome/browser/search/suggestions/image_decoder_impl.cc

Issue 2715153006: Set desired_image_size when decoding images for NTP Tile icons. (Closed)
Patch Set: comment formatting 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
« no previous file with comments | « chrome/browser/search/suggestions/image_decoder_impl.h ('k') | components/image_fetcher/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/search/suggestions/image_decoder_impl.cc
diff --git a/chrome/browser/search/suggestions/image_decoder_impl.cc b/chrome/browser/search/suggestions/image_decoder_impl.cc
index bb3094cc7f150ab678f223e50b147c7b0162fe4e..c8ae236f93324539f4848222c30c49d2f53f4522 100644
--- a/chrome/browser/search/suggestions/image_decoder_impl.cc
+++ b/chrome/browser/search/suggestions/image_decoder_impl.cc
@@ -7,6 +7,7 @@
#include "base/callback.h"
#include "chrome/browser/search/suggestions/image_decoder_impl.h"
+#include "ui/gfx/geometry/size.h"
#include "ui/gfx/image/image.h"
namespace suggestions {
@@ -65,11 +66,16 @@ ImageDecoderImpl::~ImageDecoderImpl() {}
void ImageDecoderImpl::DecodeImage(
const std::string& image_data,
+ const gfx::Size& desired_image_frame_size,
const image_fetcher::ImageDecodedCallback& callback) {
std::unique_ptr<DecodeImageRequest> decode_image_request(
new DecodeImageRequest(this, callback));
- ::ImageDecoder::Start(decode_image_request.get(), image_data);
+ ::ImageDecoder::StartWithOptions(
+ decode_image_request.get(),
+ std::vector<uint8_t>(image_data.begin(), image_data.end()),
+ ::ImageDecoder::DEFAULT_CODEC,
+ /*shrink_to_fit=*/false, desired_image_frame_size);
decode_image_requests_.push_back(std::move(decode_image_request));
}
« no previous file with comments | « chrome/browser/search/suggestions/image_decoder_impl.h ('k') | components/image_fetcher/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698