From cf74ee3d832ccb420c792f6a773ce98347ed853f Mon Sep 17 00:00:00 2001 From: Andy Dill Date: Mon, 6 Jul 2020 11:57:14 -0700 Subject: [PATCH] fix: use RenderViewReady to call InstallTransparency (#24390) this fixes a crash with transparent OSR when GPU acceleration is disabled --- shell/browser/osr/osr_render_widget_host_view.cc | 1 - shell/browser/osr/osr_web_contents_view.cc | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/shell/browser/osr/osr_render_widget_host_view.cc b/shell/browser/osr/osr_render_widget_host_view.cc index 471cc29b94b40..18bc2b08d51ee 100644 --- a/shell/browser/osr/osr_render_widget_host_view.cc +++ b/shell/browser/osr/osr_render_widget_host_view.cc @@ -222,7 +222,6 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView( ResizeRootLayer(false); render_widget_host_->SetView(this); - InstallTransparency(); if (content::GpuDataManager::GetInstance()->HardwareAccelerationEnabled()) { video_consumer_ = std::make_unique( diff --git a/shell/browser/osr/osr_web_contents_view.cc b/shell/browser/osr/osr_web_contents_view.cc index 0b97193b4a6d8..79e736dfee965 100644 --- a/shell/browser/osr/osr_web_contents_view.cc +++ b/shell/browser/osr/osr_web_contents_view.cc @@ -143,7 +143,10 @@ OffScreenWebContentsView::CreateViewForChildWidget( void OffScreenWebContentsView::SetPageTitle(const base::string16& title) {} -void OffScreenWebContentsView::RenderViewReady() {} +void OffScreenWebContentsView::RenderViewReady() { + if (GetView()) + GetView()->InstallTransparency(); +} void OffScreenWebContentsView::RenderViewHostChanged( content::RenderViewHost* old_host,