Skip to content

Conversation

codebytere
Copy link
Member

@codebytere codebytere commented Feb 14, 2022

Description of Change

Closes #32846.

Traced back to #30778 - we no longer have a transparent option in webPreferences, and so

options.Get(options::kTransparent, &transparent);
would always return false. As of the above PR, we handle transparency in webPreferences by propagating it to webPreferences in the BrowserWindow ctor:
web_preferences.SetHidden(options::kBackgroundColor,
ToRGBAHex(SK_ColorTRANSPARENT));
Therefore, in order to properly instantiate a transparent offscreen window, we need to check for the backgroundColor being set to the hex equivalent of SK_ColorTRANSPARENT and proceed with that value.

Tested with https://gist.github.com/29850810e9c5892587729d3d64a25761.

Checklist

Release Notes

Notes: Fixed broken transparency option in offscreen window rendering.

@codebytere codebytere added semver/patch backwards-compatible bug fixes target/16-x-y labels Feb 14, 2022
@electron-cation electron-cation bot added the new-pr 🌱 PR opened recently label Feb 14, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened recently label Feb 15, 2022
@codebytere codebytere force-pushed the fix-osr-transparency branch 2 times, most recently from 43eb737 to ffc4a67 Compare February 21, 2022 11:06
@codebytere codebytere requested review from a team as code owners February 21, 2022 11:29
@zcbenz zcbenz force-pushed the fix-osr-transparency branch from 5054b38 to 72135fd Compare February 23, 2022 07:50
@zcbenz zcbenz merged commit 08e2617 into main Feb 23, 2022
@zcbenz zcbenz deleted the fix-osr-transparency branch February 23, 2022 10:33
@release-clerk
Copy link

release-clerk bot commented Feb 23, 2022

Release Notes Persisted

Fixed broken transparency option in offscreen window rendering.

@trop
Copy link
Contributor

trop bot commented Feb 23, 2022

I have automatically backported this PR to "16-x-y", please check out #33051

@trop
Copy link
Contributor

trop bot commented Feb 23, 2022

I have automatically backported this PR to "17-x-y", please check out #33052

@trop trop bot removed the target/16-x-y label Feb 23, 2022
@trop
Copy link
Contributor

trop bot commented Feb 23, 2022

I have automatically backported this PR to "18-x-y", please check out #33053

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver/patch backwards-compatible bug fixes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: offscreen render set background transparent does not work
3 participants