Skip to content

Commit

Permalink
fix: use RenderViewReady to call InstallTransparency (electron#24390)
Browse files Browse the repository at this point in the history
this fixes a crash with transparent OSR when GPU acceleration is
disabled
  • Loading branch information
adill authored Jul 6, 2020
1 parent 99079c3 commit cf74ee3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 0 additions & 1 deletion shell/browser/osr/osr_render_widget_host_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ OffScreenRenderWidgetHostView::OffScreenRenderWidgetHostView(

ResizeRootLayer(false);
render_widget_host_->SetView(this);
InstallTransparency();

if (content::GpuDataManager::GetInstance()->HardwareAccelerationEnabled()) {
video_consumer_ = std::make_unique<OffScreenVideoConsumer>(
Expand Down
5 changes: 4 additions & 1 deletion shell/browser/osr/osr_web_contents_view.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit cf74ee3

Please sign in to comment.