From ca1c00f95d1d48db7b7124df38fb52356f557461 Mon Sep 17 00:00:00 2001 From: Masako Toda Date: Mon, 20 Jul 2020 20:01:13 +0000 Subject: [PATCH] Fix timing of InstallTransparency for OSR + gpu-disabled (see issue #2938) --- libcef/browser/osr/web_contents_view_osr.cc | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/libcef/browser/osr/web_contents_view_osr.cc b/libcef/browser/osr/web_contents_view_osr.cc index 3d3649158..2cafecf92 100644 --- a/libcef/browser/osr/web_contents_view_osr.cc +++ b/libcef/browser/osr/web_contents_view_osr.cc @@ -29,11 +29,7 @@ void CefWebContentsViewOSR::WebContentsCreated( DCHECK(!web_contents_); web_contents_ = web_contents; - auto host = web_contents_->GetRenderViewHost(); - CefRenderWidgetHostViewOSR* view = - static_cast(host->GetWidget()->GetView()); - if (view) - view->InstallTransparency(); + RenderViewReady(); } gfx::NativeView CefWebContentsViewOSR::GetNativeView() const { @@ -124,7 +120,15 @@ CefWebContentsViewOSR::CreateViewForChildWidget( void CefWebContentsViewOSR::SetPageTitle(const base::string16& title) {} -void CefWebContentsViewOSR::RenderViewReady() {} +void CefWebContentsViewOSR::RenderViewReady() { + if (web_contents_) { + auto host = web_contents_->GetRenderViewHost(); + CefRenderWidgetHostViewOSR* view = + static_cast(host->GetWidget()->GetView()); + if (view) + view->InstallTransparency(); + } +} void CefWebContentsViewOSR::RenderViewHostChanged( content::RenderViewHost* old_host,