New issue
Advanced search Search tips

Issue 829517 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 17
Cc:
Components:
EstimatedDays: ----
NextAction: 2019-01-11
OS: Linux , Windows
Pri: 2
Type: Bug



Sign in to add a comment

Semi-transparent cursors don't work on Windows

Reported by ivan.kuc...@gmail.com, Apr 5 2018

Issue description

UserAgent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36

Steps to reproduce the problem:
1. Go to http://ivank.net/veci/cursors_alpha.html
2. The cursor image is http://ivank.net/veci/white_grad.png

What is the expected behavior?
The cursor should be semi-transparent.

What went wrong?
The cursor in Windows is fully opaque.

Did this work before? N/A 

Chrome version: 65.0.3325.181  Channel: stable
OS Version: 6.1 (Windows 7, Windows Server 2008 R2)
Flash Version: Shockwave Flash 29.0 r0
 
Labels: Needs-Triage-M65
Components: -Blink UI>Input
Related  issue 647599 
The  issue 647599  was also issued by me ... I completely forgot it. Is now, after two years, a better time to fix it? BTW. semi-transparent cursors work in Firefox on Windows, so I don't think it is any OS restriction.
Cc: vamshi.kommuri@chromium.org
Labels: Triaged-ET Needs-Feedback
Checked the issue on reported chrome version 65.0.3325.181 using Windows 7 and Windows 10 with the below mentioned steps.
1. Launched Chrome
2. Navigated to http://ivank.net/veci/cursors_alpha.html
3. Hovered on the black space.
We observed the cursor is semi transparent. Attaching the screen cast of the same.

@Reporter: Could you please have a look at the screen cast and let us know if we have missed anything in the process. Any further inputs from your end may help us.
829517.mp4
806 KB View Download
Everything is correct in your video. But in my case, I see a fully white square. Maybe it depends on GPU drivers? Here is my about://gpu : https://pastebin.com/wKTeAnPt
Project Member

Comment 6 by sheriffbot@chromium.org, Apr 11 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Cc: susan.boorgula@chromium.org
Labels: Needs-Feedback
ivan.kuckir@ Thanks for the update.

Retried the issue on Windows 10 on the reported version 65.0.3325.181 and the latest Canary 68.0.3410.0 and unable to reproduce the issue.

On hovering the cursor over the black area, can observe the cursor is semi-transparent.
Attached is the gpu details.

Request you to update chrome to the latest stable 66.0.3359.117, retry the issue on a new chrome profile without any flags/extensions and update the thread with the observations.

Thanks..



gpu-M66.html
116 KB View Download
Hi, tried it again with the latest Chrome. The problem is still here.

Note, that I use Windows 7 (not 10) and my GL_RENDERER is ANGLE (Intel(R) HD Graphics 5500 Direct3D11 vs_5_0 ps_5_0)
Project Member

Comment 9 by sheriffbot@chromium.org, Apr 27 2018

Labels: -Needs-Feedback
Thank you for providing more feedback. Adding the requester to the cc list.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
I installed the latest driver. The cursor is still a fully opaque white rectangle :(
Components: Internals>GPU
Labels: TE-NeedsTriageHelp
Unable to reproduce the issue on Win-7 using chrome latest stable #66.0.3359.139 and latest canary #68.0.3416.0.

As per comment #4 and #7 it seems that the issue is not reproducible from TE-end. Hence, requesting someone from Internals>GPU team to please have a look into the issue and adding label TE-NeedsTriageHelp for further investigation.

Thanks...!!
Cc: weidongg@chromium.org sadrul@chromium.org
cc'ing people who worked in cursor code.
Sounds like we are not setting the aura/hwnd window as transparent?
Cc: kylec...@chromium.org
+kylechar@
Cc: magchen@chromium.org
Owner: zmo@chromium.org
Status: Assigned (was: Unconfirmed)
Assigning to zmo for Windows triage.
Owner: sadrul@chromium.org
sadrul@: can you find an owner for this? I know nothing about cursors.
Labels: -Pri-2 Pri-3
Owner: kylec...@chromium.org
I can take a look at this at some point. I found a Win7 machine the problem reproduces on, although it didn't reproduce on 3 other machines.
Labels: Hotlist-DesktopUIChecked Hotlist-DesktopUIValid
***Mass UI Triage***

We were unable to reproduce this bug from TE end. But as per comment #18 adding related comments for further triage.
Thanks!
Owner: sgilhuly@chromium.org
Labels: Needs-Feedback
NextAction: 2019-01-11
We had a Win7 machine that reproduced the bug, but it seems that it no longer occurs.

ivan.kuckir@ does the bug still occur for you?
Yes, I just tried to install the latest Windows 7 updates, but I still see the fully white square in the latest Chrome :(

In Firefox, the cursor is semi-transparent, but it is "gray in the middle" on white background (i.e. they multiply colors by alpha twice in their pipeline).
Cc: sgilhuly@chromium.org
Owner: kylec...@chromium.org
ivan: Unfortunately it's really difficult to tell what is going wrong here without being able to reproduce it. A few questions to narrow things down.

1. Can you load Chrome (without any extra flags), navigate to chrome://gpu, save that and attach it here.
2. What happens if you run Chrome with the --disable-gpu flag, does the transparent cursor work or is the same behaviour?

I tried to run Chrome with --disable-gpu without any change, so I think it is not GPU-related.

I think I noticed an important detail. My "OS zoom" is 1.25 = 125% (i.e. the devicePixelRatio, when the website zoom is at 100%). When I set the same PNG as a cursor using 

cursor: -webkit-image-set( url(...) 1.25x ), auto; 

the cursor looks correctly (and it is not scaled). So I think, that your cursor-scaling algorithm ignores the transparency.

This can not be reproduced by changing the page zoom. The zoom has to be at the OS level.
Labels: -Pri-3 -Needs-Feedback OS-Linux Pri-2
Ah, yes, it has to do with OS zoom (eg. device scale factor). Thanks for the information to reproduce! I can reproduce on Linux and Windows with --force-device-scale-factor=1.25.

We're probably dropping the alpha channel somewhere when scaling web cursor images.
skia::ImageOperations::Resize() doesn't handle unpremul alpha properly. This is super similar to  crbug.com/533748  where skia also couldn't handle rotating SkBitmap unpremul alpha. We can use the same solution, convert to premul alpha before resizing, but let me double check with someone on the skia team this is required first.
The NextAction date has arrived: 2019-01-11
https://crrev.com/c/1400356 is being reviewed currently.
Project Member

Comment 29 by bugdroid1@chromium.org, Jan 16 (6 days ago)

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ba5cf7b3d18065b934e9a55e2380450f28ad585a

commit ba5cf7b3d18065b934e9a55e2380450f28ad585a
Author: kylechar <kylechar@chromium.org>
Date: Wed Jan 16 14:39:37 2019

Fix web cursor transparency when scaled.

Custom web cursors with transparency were not displaying correctly when
scaled, for example when device scale factor is not 1.0. The cursor
would become fully opaque after scaling.

The helper function skia::ImageOperations::Resize() doesn't appear to
handle the alpha channel correctly with unpremultiplied alpha SkBitmaps.
SkPixmap::scaleImage() does support unpremultiplied alpha SkBitmaps so
use that instead. I filed https://crbug.com/919866 to see if
skia::ImageOperations::Resize() could just use SkPixmap::scaleImage() at
some point.

Also add a test for ScaleAndRotateCursorBitmapAndHotpoint(). There was
already a test that only ran with X11 and premultiplied alpha SkBitmap.
Make the test run on all platforms and parameterize it to run with both
alpha types.

Bug:  829517 , 919866
Change-Id: I12213b03a2569240cf4206869906fb0834217155
Reviewed-on: https://chromium-review.googlesource.com/c/1400356
Commit-Queue: kylechar <kylechar@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#623233}
[modify] https://crrev.com/ba5cf7b3d18065b934e9a55e2380450f28ad585a/content/test/content_test_suite.cc
[modify] https://crrev.com/ba5cf7b3d18065b934e9a55e2380450f28ad585a/content/test/content_test_suite.h
[modify] https://crrev.com/ba5cf7b3d18065b934e9a55e2380450f28ad585a/ui/base/BUILD.gn
[delete] https://crrev.com/71423ee1ddfe6dc0efa722e23408d9662d97f2f6/ui/base/cursor/cursor_loader_x11_unittest.cc
[modify] https://crrev.com/ba5cf7b3d18065b934e9a55e2380450f28ad585a/ui/base/cursor/cursor_util.cc
[add] https://crrev.com/ba5cf7b3d18065b934e9a55e2380450f28ad585a/ui/base/cursor/cursor_util_unittest.cc

Comment 30 by kylec...@chromium.org, Jan 17 (5 days ago)

Status: Fixed (was: Assigned)

Sign in to add a comment