vector icons scaling is suboptimal for non-default scales |
||
Issue descriptionIronically, we don't scale vector icons as well as we could when the device scale factor is not a supported scale (generally, 1x or 2x). We do scale well when the source icon is different from the output size, e.g. when rendering an icon at 16px even though the definition is 32px. So, for example, when we only have one icon definition, it will scale just fine for 1x and 2x, but will look slightly (almost unnoticeably) subpar for 1.25x. The difference is whether we scale the canvas then draw the path (allowing AA to work at the proper scale) or draw the path then scale the canvas (forcing us to use some generic image scaling algorithm). See attached screenshot @1.25x --- the bottom is with my fix, and the top is what we currently have. I've circled the icons that are vector icons. By and large they don't look very different, but if you zoom in and/or overlay the icons, you can see: a) the colors are better on the bottom (darkest part of toolbar icons is 5a5a5a instead of something slightly off like 5f5f5f) b) some of the lines are a little sharper. Easiest to notice on the chromium product icon.
,
Feb 16 2017
here's something else this affects. These network icons are not actually "vector icons" in the sense of things that come from .icon files. They are drawn programatically though and the same fix applies to both types of image. Compare the pointiness at the bottom of the arcs (wifi) and the sharpness at the bottom of the bars (cellular).
,
Feb 17 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/41fb78271f7a247a47fd6a75a8f1953ff0282bce commit 41fb78271f7a247a47fd6a75a8f1953ff0282bce Author: estade <estade@chromium.org> Date: Fri Feb 17 23:43:33 2017 ImageSkia: don't force fallback to a supported scale when the image source advertises that it has representations for all scales. BUG= 693227 Review-Url: https://codereview.chromium.org/2699983002 Cr-Commit-Position: refs/heads/master@{#451401} [modify] https://crrev.com/41fb78271f7a247a47fd6a75a8f1953ff0282bce/ui/gfx/image/image_skia.cc
,
Feb 21 2017
|
||
►
Sign in to add a comment |
||
Comment 1 by est...@chromium.org
, Feb 16 2017