Commit b3f69aaa authored by Alex Ilin's avatar Alex Ilin Committed by Commit Bot

[profiles] Fix image generation in GetPlaceholderAvatarIconWithColors

GetPlaceholderAvatarIconWithColors() constructs an gfx::ImageSkia from
an ImageSkiaSource and size. This code has a bug because the function
passes the size parameter as int instead of gfx::Size.

gfx::ImageSkia() has another constructor overload that accepts `float
scale` as the second parameter. This overload is being called by
mistake. The result image doesn't have any obvious visible defects but
the creation of an image with a very large scale (>70.0) takes a lot of
time (>700ms).

Bug: 1122114
Change-Id: Ibf53dca2b361145703a77c970d255e25453bbca9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2376856
Auto-Submit: Alex Ilin <alexilin@chromium.org>
Reviewed-by: default avatarDavid Roger <droger@chromium.org>
Commit-Queue: David Roger <droger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802151}
parent 63c11408
......@@ -623,7 +623,7 @@ gfx::Image GetPlaceholderAvatarIconWithColors(SkColor fill_color,
gfx::ImageSkia icon_with_background(
std::make_unique<ImageWithBackgroundSource>(icon_without_background,
fill_color),
size);
gfx::Size(size, size));
return gfx::Image(icon_with_background);
}
......
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