feat: GPU shared texture offscreen rendering (33-x-y) (#44511)

* feat: GPU shared texture offscreen rendering

* fix: EmitWarning in node utils.

Signed-off-by: reito <cnschwarzer@qq.com>

* fix: resolve conflict and reformat

---------

Signed-off-by: reito <cnschwarzer@qq.com>
This commit is contained in:
reito 2024-11-07 22:41:09 +08:00 committed by GitHub
parent c8dc8717a4
commit 65cd09ffaf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 1009 additions and 102 deletions

View file

@ -15,8 +15,11 @@ namespace electron {
OffScreenWebContentsView::OffScreenWebContentsView(
bool transparent,
bool offscreen_use_shared_texture,
const OnPaintCallback& callback)
: transparent_(transparent), callback_(callback) {
: transparent_(transparent),
offscreen_use_shared_texture_(offscreen_use_shared_texture),
callback_(callback) {
#if BUILDFLAG(IS_MAC)
PlatformCreate();
#endif
@ -109,8 +112,8 @@ OffScreenWebContentsView::CreateViewForWidget(
return static_cast<content::RenderWidgetHostViewBase*>(rwhv);
return new OffScreenRenderWidgetHostView(
transparent_, painting_, GetFrameRate(), callback_, render_widget_host,
nullptr, GetSize());
transparent_, offscreen_use_shared_texture_, painting_, GetFrameRate(),
callback_, render_widget_host, nullptr, GetSize());
}
content::RenderWidgetHostViewBase*
@ -124,9 +127,9 @@ OffScreenWebContentsView::CreateViewForChildWidget(
? web_contents_impl->GetOuterWebContents()->GetRenderWidgetHostView()
: web_contents_impl->GetRenderWidgetHostView());
return new OffScreenRenderWidgetHostView(transparent_, painting_,
view->frame_rate(), callback_,
render_widget_host, view, GetSize());
return new OffScreenRenderWidgetHostView(
transparent_, offscreen_use_shared_texture_, painting_,
view->frame_rate(), callback_, render_widget_host, view, GetSize());
}
void OffScreenWebContentsView::RenderViewReady() {