<!--  As an open source project with a dedicated but small maintainer team, it can sometimes take a long time for issues to be addressed so please be patient and we will get back to you as soon as we can.
-->

### Preflight Checklist
<!-- Please ensure you've completed the following steps by replacing [ ] with [x]-->

* [x] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/master/CONTRIBUTING.md) for this project.
* [x] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/master/CODE_OF_CONDUCT.md) that this project adheres to.
* [x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

### Issue Details

* **Electron Version:**
  * 9.0.0 - 9.0.5
* **Operating System:**
  * maxOS 10.15.5, windows 10 x64
* **Last Known Working Electron version:**
  * 8.3.4

### Expected Behavior
<!-- A clear and concise description of what you expected to happen. -->
The app should not crash. And the window should be transparent in offscreen mode.

### Actual Behavior
<!-- A clear and concise description of what actually happened. -->
The app going to crash after the start.

### To Reproduce
Minimal code example to reproduce:
```
const { app, BrowserWindow } = require('electron');

app.disableHardwareAcceleration()

let win

app.whenReady().then(() => {
    win = new BrowserWindow({
        transparent: true,
        webPreferences: {
            offscreen: true
        }
    })

    win.loadURL('http://github.com');
})
```

<!--
Your best chance of getting this bug looked at quickly is to provide an example.
-->

<!--
For bugs that can be encapsulated in a small experiment, you can use Electron Fiddle (https://github.com/electron/fiddle) to publish your example to a GitHub Gist and link it your bug report.
-->

<!--
If Fiddle is insufficient to produce an example, please provide an example REPOSITORY that can be cloned and run. You can fork electron-quick-start (https://github.com/electron/electron-quick-start) and include a link to the branch with your changes.
-->

<!--
If you provide a URL, please list the commands required to clone/setup/run your repo e.g.
```sh
$ git clone $YOUR_URL -b $BRANCH
$ npm install
$ npm start || electron .
```
-->

### Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

### Additional Information
<!-- Add any other context about the problem here. -->

shell/browser/osr/osr_render_widget_host_view.cc
bool OffScreenRenderWidgetHostView::HasFocus() {
  return false;
}
bool OffScreenRenderWidgetHostView::IsSurfaceAvailableForCopy() {
  return GetDelegatedFrameHost()->CanCopyFromCompositingSurface();
}
void OffScreenRenderWidgetHostView::Show() {
  if (is_showing_)
    return;
  is_showing_ = true;
  delegated_frame_host_->AttachToCompositor(compositor_.get());
  delegated_frame_host_->WasShown(
      GetLocalSurfaceIdAllocation().local_surface_id(),
      GetRootLayer()->bounds().size(), base::nullopt);
  if (render_widget_host_)
    render_widget_host_->WasShown(base::nullopt);
}
void OffScreenRenderWidgetHostView::Hide() {
  if (!is_showing_)
    return;
  if (render_widget_host_)
    render_widget_host_->WasHidden();
  
  GetDelegatedFrameHost()->WasHidden(
      content::DelegatedFrameHost::HiddenCause::kOccluded);
  GetDelegatedFrameHost()->DetachFromCompositor();
  is_showing_ = false;
}
bool OffScreenRenderWidgetHostView::IsShowing() {