Commit dc1166b6 authored by Oleg Maximenko's avatar Oleg Maximenko Committed by Commit Bot

Don't use decode-to-scale ImageDecoder feature for icons.

Passing desired_size to ImageDecoder::Create() means that caller have checked
that the size is possible by calling ImageDecoder::GetSupportedDecodeSizes().
Otherwise some issues may arise even for the formats that don't support
decode-to-scale. On the other hand the only supported format (JPEG) isn't
very popular for the icons. Better to simplify the code.

Change-Id: I24e173ee0540bb5d7adc055ffaa8285bef8f90de
Reviewed-on: https://chromium-review.googlesource.com/1253901Reviewed-by: default avatarPeter Beverloo <peter@chromium.org>
Reviewed-by: default avatarvmpstr <vmpstr@chromium.org>
Commit-Queue: Peter Beverloo <peter@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595788}
parent 3efff7c9
......@@ -168,13 +168,10 @@ void BackgroundFetchIconLoader::DecodeAndResizeImageOnBackgroundThread(
DCHECK(task_runner);
DCHECK(data);
// Explicitly pass in the |icon_display_size_pixels_| to benefit from decoders
// that have optimizations for partial decoding.
std::unique_ptr<ImageDecoder> decoder = ImageDecoder::Create(
std::move(data), /* data_complete= */ true,
ImageDecoder::kAlphaPremultiplied, ImageDecoder::kDefaultBitDepth,
ColorBehavior::TransformToSRGB(),
{icon_display_size_pixels_.width, icon_display_size_pixels_.height});
ColorBehavior::TransformToSRGB());
int64_t ideal_to_chosen_icon_size_times_hundred = -1;
if (decoder) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment