New issue
Advanced search Search tips

Issue 693227 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome
Pri: 1
Type: Bug

Blocking:
issue 688503



Sign in to add a comment

vector icons scaling is suboptimal for non-default scales

Project Member Reported by est...@chromium.org, Feb 16 2017

Issue description

Ironically, 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.
 
fdQa8prS0XL.png
77.8 KB View Download

Comment 1 by est...@chromium.org, Feb 16 2017

Summary: vector icons scaling is suboptimal for non-default scales (was: vector icons scaling is suboptimal)

Comment 2 by est...@chromium.org, 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).
rR0yhH45ddT.png
48.7 KB View Download
Project Member

Comment 3 by bugdroid1@chromium.org, 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

Comment 4 by est...@chromium.org, Feb 21 2017

Status: Fixed (was: Started)

Sign in to add a comment