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:
views::Widget::InitParams::TRANSLUCENT_WINDOWwhile initializing the Widget controlled by
Set the background color of CefWindow to transparent if above is configured
CefSettings.transparent_paintingto true. It controls accepting alpha component while configuring the background in
CefContext::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
cefclient --use-views --transparent-painting-enabled --hide-frame --hide-controls
Thank you for any feedback/comments in advance.