osr: Implement shared texture support (fixes #1006, fixes #2575)

Adds support for the OnAcceleratedPaint callback. Verified to work
on macOS and Windows. Linux support is present but not implemented
for cefclient, so it is not verified to work.

To test:
Run `cefclient --off-screen-rendering-enabled --shared-texture-enabled`
This commit is contained in:
reito
2024-03-08 20:44:56 +08:00
committed by Marshall Greenblatt
parent dca0435d2f
commit 260dd0ca24
43 changed files with 768 additions and 108 deletions

View File

@@ -49,6 +49,14 @@ class OsrRenderer {
int width,
int height);
// Used when rendering with shared textures.
void OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
CefRenderHandler::PaintElementType type,
const CefRenderHandler::RectList& dirtyRects,
unsigned int io_surface_tex,
int width,
int height);
// Apply spin.
void SetSpin(float spinX, float spinY);
void IncrementSpin(float spinDX, float spinDY);
@@ -61,6 +69,8 @@ class OsrRenderer {
void ClearPopupRects();
const OsrRendererSettings& settings() const { return settings_; }
private:
CefRect GetPopupRectInWebView(const CefRect& original_rect);