Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: broken OSR transparent option #32885

Merged
merged 1 commit into from Feb 23, 2022
Merged

fix: broken OSR transparent option #32885

merged 1 commit into from Feb 23, 2022

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 in the last 24 hours label Feb 14, 2022
@electron-cation electron-cation bot removed the new-pr 🌱 PR opened in the last 24 hours 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 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