Description
Hi Team,
Â
What I need is very similar to the issue #2315. I would like to provide my changes for the case.
First of all, the requirement I have is to create a non-rectangular window. One solution is implementing OSR to have parent window with transparent background. Another solution is creating a translucent window via Views frameworks, which is what this PR did.
Â
The major changes are:
Configure
opacity
toviews::Widget::InitParams::TRANSLUCENT_WINDOW
while initializing the Widget controlled byCefWindowDelegate::IsTranslucent()
Set the background color of CefWindow to transparent if above is configured
Configure
CefSettings.transparent_painting
to true. It controls accepting alpha component while configuring the background inCefContext::GetBackgroundColor()
. It is required for deciding the default background of WebView in renderer.
CefSettings.windowless_rendering_enabled
is renamed to CefSettings.transparent_painting
because I consider the flag only controlling the background color calculation logic.
I created a testing page using the Views framework as below:
The page can be launched by
1
cefclient --use-views --transparent-painting-enabled --hide-frame --hide-controls
Thank you for any feedback/comments in advance.