Version: Chromium revision 0bfd25d4 (#381305)
OS: Windows 10 64-bit, HiDPI display
What steps will reproduce the problem?
(1) Call Widget::UpdateWindowIcon().
(2) Return an ImageSkia from WidgetDelegate::GetWindowIcon() containing bitmaps at 1x and 2x scale factors.
What is the expected output?
The 2x scale bitmap representation should be used.
What do you see instead?
The 1x scale bitmap representation is used.
Please use labels and text to provide additional information.
Widget::UpdateWindowIcon() eventually results in a call to HWNDMessageHandler::SetWindowIcons() [1] which uses the ImageSkia::bitmap() method [2]. This method always returns the 1x scale bitmap [3]. SetWindowIcons() should instead use the bitmap nearest the display scale factor.
[1] Call stack to SetWindowIcons:
> views::HWNDMessageHandler::SetWindowIcons(const gfx::ImageSkia & window_icon, const gfx::ImageSkia & app_icon) Line 818 C++
views::DesktopWindowTreeHostWin::SetWindowIcons(const gfx::ImageSkia & window_icon, const gfx::ImageSkia & app_icon) Line 450 C++
views::DesktopNativeWidgetAura::SetWindowIcons(const gfx::ImageSkia & window_icon, const gfx::ImageSkia & app_icon) Line 653 C++
views::Widget::UpdateWindowIcon() Line 850 C++
[2] https://code.google.com/p/chromium/codesearch#chromium/src/ui/views/win/hwnd_message_handler.cc&q=HWNDMessageHandler::SetWindowIcons&sq=package:chromium&type=cs&l=799
[3] https://code.google.com/p/chromium/codesearch#chromium/src/ui/gfx/image/image_skia.h&q=ImageSkia::bitmap&sq=package:chromium&type=cs&l=141
Comment 1 by sky@chromium.org
, Mar 24 2016