Commit 245d5bd4 authored by Vladislav Kaznacheev's avatar Vladislav Kaznacheev Committed by Commit Bot

Use fewer sizes for bundled Play Store icons

- Use only 32 and 192 sizes
- Apply png optimizer.
- Use correct icons in icon_decode_request.cc

Bug: 879617
Test: manual
Change-Id: Icced1e403c75852b2143c695dd22032c3a9e4f8c
Reviewed-on: https://chromium-review.googlesource.com/1216084Reviewed-by: default avatarYury Khmel <khmel@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Vladislav Kaznacheev <kaznacheev@chromium.org>
Cr-Commit-Position: refs/heads/master@{#590420}
parent 2f9563e4
...@@ -58,8 +58,11 @@ gfx::ImageSkiaRep IconSource::GetImageForScale(float scale) { ...@@ -58,8 +58,11 @@ gfx::ImageSkiaRep IconSource::GetImageForScale(float scale) {
// ARC icon. // ARC icon.
const gfx::ImageSkia* icon_to_scale; const gfx::ImageSkia* icon_to_scale;
if (decoded_icon_.isNull()) { if (decoded_icon_.isNull()) {
int resource_id = const int resource_size_in_px =
scale >= 1.5f ? IDR_ARC_SUPPORT_ICON_96 : IDR_ARC_SUPPORT_ICON_48; static_cast<int>(resource_size_in_dip_ * scale + 0.5);
const int resource_id = resource_size_in_px <= 32
? IDR_ARC_SUPPORT_ICON_32
: IDR_ARC_SUPPORT_ICON_192;
icon_to_scale = icon_to_scale =
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id); ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(resource_id);
} else { } else {
......
...@@ -84,10 +84,7 @@ ...@@ -84,10 +84,7 @@
<include name="IDR_ARC_SUPPORT_FOCUS_MANAGER_JS" file="chromeos/arc_support/arc_optin_focus_manager.js" type="BINDATA" /> <include name="IDR_ARC_SUPPORT_FOCUS_MANAGER_JS" file="chromeos/arc_support/arc_optin_focus_manager.js" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_MAIN" file="chromeos/arc_support/main.html" allowexternalscript="true" type="BINDATA" /> <include name="IDR_ARC_SUPPORT_MAIN" file="chromeos/arc_support/main.html" allowexternalscript="true" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_ICON_32" file="chromeos/arc_support/icon/32.png" type="BINDATA" /> <include name="IDR_ARC_SUPPORT_ICON_32" file="chromeos/arc_support/icon/32.png" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_ICON_48" file="chromeos/arc_support/icon/48.png" type="BINDATA" /> <include name="IDR_ARC_SUPPORT_ICON_192" file="chromeos/arc_support/icon/192.png" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_ICON_64" file="chromeos/arc_support/icon/64.png" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_ICON_96" file="chromeos/arc_support/icon/96.png" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_ICON_128" file="chromeos/arc_support/icon/128.png" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_ICON_ERROER_IMAGE" file="chromeos/arc_support/images/error_image.png" type="BINDATA" /> <include name="IDR_ARC_SUPPORT_ICON_ERROER_IMAGE" file="chromeos/arc_support/images/error_image.png" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_ICON_HEADER" file="chromeos/arc_support/images/header.png" type="BINDATA" /> <include name="IDR_ARC_SUPPORT_ICON_HEADER" file="chromeos/arc_support/images/header.png" type="BINDATA" />
<include name="IDR_ARC_SUPPORT_RECOMMEND_APP_LIST_VIEW_JS" file="chromeos/arc_support/recommend_app_list_view.js" type="BINDATA" /> <include name="IDR_ARC_SUPPORT_RECOMMEND_APP_LIST_VIEW_JS" file="chromeos/arc_support/recommend_app_list_view.js" type="BINDATA" />
......
...@@ -135,16 +135,8 @@ gfx::ImageSkiaRep ArcAppIcon::Source::GetImageForScale(float scale) { ...@@ -135,16 +135,8 @@ gfx::ImageSkiaRep ArcAppIcon::Source::GetImageForScale(float scale) {
// Store that is adapted according Chrome style. // Store that is adapted according Chrome style.
const int resource_size_in_px = const int resource_size_in_px =
static_cast<int>(resource_size_in_dip_ * scale + 0.5); static_cast<int>(resource_size_in_dip_ * scale + 0.5);
if (resource_size_in_px <= 32) resource_id = resource_size_in_px <= 32 ? IDR_ARC_SUPPORT_ICON_32
resource_id = IDR_ARC_SUPPORT_ICON_32; : IDR_ARC_SUPPORT_ICON_192;
else if (resource_size_in_px <= 48)
resource_id = IDR_ARC_SUPPORT_ICON_48;
else if (resource_size_in_px <= 64)
resource_id = IDR_ARC_SUPPORT_ICON_64;
else if (resource_size_in_px <= 96)
resource_id = IDR_ARC_SUPPORT_ICON_96;
else
resource_id = IDR_ARC_SUPPORT_ICON_128;
} else { } else {
if (host_) if (host_)
host_->LoadForScaleFactor(ui::GetSupportedScaleFactor(scale)); host_->LoadForScaleFactor(ui::GetSupportedScaleFactor(scale));
......
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