Support transparent window in Views framework (follow up issue #2315)
Andy Tzeng
Branch: trendmicro-consumer/cef:transparent
trendmicro-consumer/cef:transparent
Branch: chromiumembedded/cef:master
chromiumembedded/cef:master
Open
#267 · Created  · Last updated
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 to views::Widget::InitParams::WindowOpacity::kTranslucent while initializing the Widget controlled by the alpha component of CefBrowserSettings.background_color
Set the background color of CefWindowto transparent if above is configured
Invoke CefContext::Get()->GetBackgroundColor() with STATE_ENABLED from Views framework invocation chain to enable transparent capability.
I created a testing page using the Views framework as below:
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::WindowOpacity::kTranslucent
while initializing the Widget controlled by the alpha component ofCefBrowserSettings.background_color
Set the background color of
CefWindow
to transparent if above is configuredInvoke
CefContext::Get()->GetBackgroundColor()
with STATE_ENABLED from Views framework invocation chain to enable transparent capability.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 --hide-overlays
Thank you for any feedback/comments in advance.