Commit e63e3c19 authored by Alexey Baskakov's avatar Alexey Baskakov Committed by Commit Bot

IconLoadingPipeline: Fix integer division.

Scale factor of 2 is default on pixelbook, but it could be
{1.0, 1.2, 1.4, 1.6, 1.8, 2.0, 2.2, 2.5, 3.0}

My previous CL calculates scale factor as integer by mistake.
It worked for 1/2/3 scale factors but not for fractional scales.

This bug was found by glenrob@ while reading the code.

We need this fix ASAP to merge into M85.

Bug: 1119709
Change-Id: I451fd00c735d188f280632bcb4b14547c8964478
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2366259
Commit-Queue: Alexey Baskakov <loyso@chromium.org>
Commit-Queue: Dominick Ng <dominickn@chromium.org>
Auto-Submit: Alexey Baskakov <loyso@chromium.org>
Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800065}
parent 9ac42588
......@@ -388,7 +388,8 @@ class IconLoadingPipeline : public base::RefCounted<IconLoadingPipeline> {
fallback_callback_(std::move(fallback)) {
icon_size_in_px_ = apps_util::ConvertDipToPx(
size_hint_in_dip, /*quantize_to_supported_scale_factor=*/true);
icon_scale_ = icon_size_in_px_ / size_hint_in_dip;
// Both px and dip sizes are integers but the scale factor is fractional.
icon_scale_ = static_cast<float>(icon_size_in_px_) / size_hint_in_dip;
}
IconLoadingPipeline(
......
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