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

@ -39,6 +39,7 @@
#include "shell/browser/background_throttling_source.h"
#include "shell/browser/event_emitter_mixin.h"
#include "shell/browser/extended_web_contents_observer.h"
#include "shell/browser/osr/osr_paint_event.h"
#include "shell/browser/ui/inspectable_web_contents_delegate.h"
#include "shell/browser/ui/inspectable_web_contents_view_delegate.h"
#include "shell/common/gin_helper/cleaned_up_at_exit.h"
@ -301,7 +302,9 @@ class WebContents final : public ExclusiveAccessContext,
// Methods for offscreen rendering
bool IsOffScreen() const;
void OnPaint(const gfx::Rect& dirty_rect, const SkBitmap& bitmap);
void OnPaint(const gfx::Rect& dirty_rect,
const SkBitmap& bitmap,
const OffscreenSharedTexture& info);
void StartPainting();
void StopPainting();
bool IsPainting() const;
@ -834,6 +837,9 @@ class WebContents final : public ExclusiveAccessContext,
bool offscreen_ = false;
// Whether offscreen rendering use gpu shared texture
bool offscreen_use_shared_texture_ = false;
// Whether window is fullscreened by HTML5 api.
bool html_fullscreen_ = false;