New issue
Advanced search Search tips

Issue 770739 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 802308



Sign in to add a comment

Headless chrome without --disable-gpu flag fails to render a transparent background

Reported by v04...@gmail.com, Oct 2 2017

Issue description

Chrome Version       : 61.0.3163.100 (Official Build) (64-bit)

What steps will reproduce the problem?
(1) create the following SVG-file (circle.svg):

<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'>
  <circle fill='red' cx='50' cy='50' r='50'/>
</svg>

(2) Capture a screenshot using headless mode, expecting a png with transparent background:
/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --headless --screenshot --window-size=256,256 --default-background-color=00000000 file://$PWD/circle.svg

(3) Check screenshot.png

What is the expected result?

screenshot.png should contain red circle on a transparent background

What happens instead?

screenshot.png contains red circle on a black background

OS: macOS Sierra 10.12.6 (16G29), MacBook Pro (Retina, Mid 2012)

Using flag --disable-gpu fixes this behaviour and screenshot.png contains a transparent background, as expected.

 
circle.svg
116 bytes Download
screenshot-black.png
10.7 KB View Download
screenshot-transparent.png
12.2 KB View Download
Labels: Needs-Triage-M61
Components: -Platform>DevTools
Thanks for the repro instructions!
I can confirm this is happening in both Mac/Linux when enabling gpu 

eseckler@ is set background color enabled for non-software gpus?


Cc: eseckler@chromium.org
Status: (was: Unconfirmed)
eseckler@ is set background color enabled for non-software gpus?
Status: Available
I'm not aware of any restrictions when using gpu for transparent rendering, but that doesn't mean that there aren't any. I'll have a look when I have some free cycles, but if anyone else would like to start before then, feel free to snatch this.
Owner: eseckler@chromium.org
Status: Started (was: Available)
Looking into this now. Seems this change broke part of this: https://codereview.chromium.org/2944633002/. Reverting it fixes our currently disabled TransparentScreenshots test [1]. Will investigate further.

[1] https://cs.chromium.org/chromium/src/content/browser/devtools/protocol/devtools_protocol_browsertest.cc?type=cs&q=transparentscreen&sq=package:chromium&l=952
Blockedon: 802308
Status: Fixed (was: Started)
With  bug 802308  closed, I expect that this is now resolved as well. Please reopen if the problem persists.

Sign in to add a comment