New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 596036 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: May 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Mac
Pri: 2
Type: Bug

Blocking:
issue 547953



Sign in to add a comment

Regression: Location and MIDI icon is not seen properly in incognito mode.

Reported by dmascare...@etouch.net, Mar 18 2016

Issue description

Chrome Version:51.0.2682.0 (Official Build) 153a9028e5cb73e3c707b4884550499e2a08af5c-refs/heads/master@{#381839} 64 bit
OS: Mac 

Pre-condition: Select 'Material' option for 'Material design in the browser's top chrome'.

What steps will reproduce the problem?
1. Launch chrome and open Incognito window.
2. Navigate to https://adrifelt.github.io/demos/all-permissions.html and click on ‘Location’ button or ‘MIDI’ button
3. Click on ‘Allow’ button present in the bubble and observe the omnibox.

Actual: 'Location' and  'MIDI'  icon is not seen properly in incognito mode.(i.e Grey colour icon over grey background of omnibox)
Expected: 'Location'  and  'MIDI'  icon should seen properly.

This is regression issue, broken in ‘M 51’ and below is narrow bisect:
https://chromium.googlesource.com/chromium/src/+log/4dba7838c14fff4e36c49045a8c4c2bf72b64b18..231c29739fa47b943eb277b7cff67d8c4b8636c3?pretty=fuller&n=100

Suspecting: r379889 ?

Good build:51.0.2671.0 
Bad build:51.0.2672.0 

Note: Issue is not seen on Windows and Linux OS.

Please help in reassigning if it is not related to your change
 
incog.png
29.8 KB View Download
Labels: ReleaseBlock-Stable
Adding release block label, please undo if not the case.

Comment 2 by shrike@chromium.org, Mar 22 2016

Blocking: 547953
Labels: -Pri-1 -ReleaseBlock-Stable Proj-MaterialDesign-NativeUI Pri-2
Removing release block - this bug only affects users with Material Design switch flipped.
Cc: shrike@chromium.org
Labels: -M-51 M-52
Owner: spqc...@chromium.org
spqchan@ - this will hopefully not take much time to get up-to-speed on. Basically there are "decorations" (little icons) that appear in the omnibox textfield. Pre-Material Design they displayed PNGs but with the switch to MD they display icons that are created from vectors. In the old days you could set the image at construction time but with MD the omnibox textfield can be light or dark, based on being in Incognito mode. When the textfield is light the decoration is gray, when it's dark the decoration is white. You can't know what color to make it until the omnibox textfield gets added to the window, so the constructors typically no longer set the icon.

There are a bunch of decorations I've already converted, like the Zoom decoration (FYI the Star decoration is special-cased so don't look at that one too much). It should be mostly clear what changes are needed to convert over to MD but let me know if you have any questions. Please add me to the cl when you're ready.

Note that you can use https://permission.site/ to make these decorations visible (otherwise it can be hard finding a site that does so).

It looks like my CL https://codereview.chromium.org/1955083003/ would fix this issue
However, I noticed that while the color is setting the vector graphics to white, it's still darker than the star icon. 

Is that alright?
Screen Shot 2016-05-09 at 1.54.16 PM.png
4.1 KB View Download

Comment 6 by shrike@chromium.org, May 10 2016

Labels: -Type-Bug-Regression Type-Bug
I don't think that cl updates these icons. The location icon at the very least is not correct (see attached).

There's a location_decoration in chrome/browser/ui/cocoa/location_bar/ - I suspect that's where it's drawn. I'm not sure where the others live.
Screen Shot 2016-05-09 at 5.14.42 PM.png
9.6 KB View Download
The CL actually does affect the icons, if you change the SkColor to blue in my CL it actually changes the icon colors. That's a good point on Location Decoration though, I'll look into it

Comment 8 by shrike@chromium.org, May 10 2016

So it does - nevermind, and nevermind the icon screenshot (that's a vector icon with a Location name but I guess it's not for the location bar).

It looks like the code is being clever. GetIcon() calls the routine DeriveDefaultIconColor() which takes a text color and generates what it deems an appropriate icon color. If you pass in pure black you'll get chrome icon grey. If you pass white you'll get a transparent white, but it's not matching up with the color of the bookmark star icon. I'm not sure why that is (either the star is using the wrong alpha or there's a color space mismatch) - please file a bug on that.
 Issue 610738  has been created

I suspect it might be the bookmark star icon that's using the wrong alpha, based on the attached screenshot in the bug description
It doesn't look like it. The spec from sgabriel@:

Incognito mode:
- Not bookmarked: Hollowed out start, #FFF 80% alpha.
- Bookmarked: Filled start, #7BAAF7 (GB300) 100% alpha

80% alpha is 0xCC, which is what's in the star_decoration code. I wonder if DeriveDefaultIconColor() is returning 0xCC for the alpha.

Ah I see, that makes sense. What bugs me is the fact that DeriveDefaultIconColor() exists.

I tried a few things out and change SkColorSetA(SK_ColorWHITE, 0xCC) to SkColorSetA(SK_ColorWHITE, 0xFF). It looks like it's matching now.
Screen Shot 2016-05-10 at 10.37.28 AM.png
7.2 KB View Download
In that case, would it be good enough if I just pass in SkColorWHITE with 100% alpha to GetIcon()?
It's very close, but it's not the same (Photoshop says the star is 0xE3 but the other icons are 0xD6). I'm testing things on my Retina machine and the difference is more noticeable.

Can you check what DeriveDefaultIconColor() returns for an alpha value if you pass in SkColorSetA(SK_ColorWHITE, 0xFF)?

Just checked, never mind it looks like the alpha stays the same. For 80%, it becomes 84% with DeriveDefaultIconColor().
Can you figure out what the correct alpha value should be for color_utils::AlphaBlend() to get 0xCC out? We can just submit a cl that fixes it.
Sounds good, I can do that. There is one thing I want to clarify first.
If we're changing AlphaBlend(), what is the correct input and output?

Are we changing the alpha value in DeriveDefaultIconColor() so that when we input 0xFF, it will output 0xCC? Also, it looks like there are other places that use this method so we'll need to make sure that we don't break anything.
My thought was to change DeriveDefaultIconColor(), not AlphaBlend().

I had also assumed AlphaBlend() returns a color with an alpha channel < 0xFF but I no longer think that's true (it must be an opaque).

0x33 is 20% of 0xFF, so it must be that color_utils::AlphaBlend(SK_ColorBLACK, text_color, 0x33) is returning a color that is 80% text_color and 20% SK_ColorBLACK. That seems like it should be the same as painting the star icon with a white that is 80% opaque - the difference may be that in the DeriveDefaultIconColor() case the output is an opaque icon whereas by painting the star with an 80% opaque white the icon is a partially transparent icon. The transparency allows part of the background to show through, which makes the star brighter than the non-opaque icons.

I need to get clarification from sgabriel@ on which approach is correct.

Comment 18 by spqchan@google.com, May 10 2016

Sorry, what I said was a bit confusing. I meant changing what values we feed into AlphaBlend(), not the method itself. Anyway, that sounds good. Let me know when you get an update for it!
> Sorry, what I said was a bit confusing.

Or I may have read it wrong.

Status: Fixed (was: Assigned)

Sign in to add a comment