Add support for shared texture and external BeginFrame in OSR mode (issue #1006)

- Add CefWindowInfo::shared_texture_enabled and
  CefRenderHandler::OnAcceleratedPaint for shared texture support. Currently
  only supported on Windows (D3D11).
- Add CefWindowInfo::external_begin_frame_enabled and
  CefBrowserHost::SendExternalBeginFrame for external begin frame support.
This commit is contained in:
Greg Wessels
2018-07-02 19:46:03 -05:00
committed by Marshall Greenblatt
parent 09afa3a843
commit 713eebcafc
43 changed files with 2339 additions and 156 deletions

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=9a1691bbc0a509032dd60b463189dd1eb0f6cc4d$
// $hash=5d699bfd2e9f2d689a5bca3372563b1578fa1ba1$
//
#include "libcef_dll/ctocpp/browser_host_ctocpp.h"
@@ -557,6 +557,17 @@ void CefBrowserHostCToCpp::Invalidate(PaintElementType type) {
_struct->invalidate(_struct, type);
}
NO_SANITIZE("cfi-icall") void CefBrowserHostCToCpp::SendExternalBeginFrame() {
cef_browser_host_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, send_external_begin_frame))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
_struct->send_external_begin_frame(_struct);
}
NO_SANITIZE("cfi-icall")
void CefBrowserHostCToCpp::SendKeyEvent(const CefKeyEvent& event) {
cef_browser_host_t* _struct = GetStruct();

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=39ab8db08e667fac8e6dccffaa99935d8aa7d4b5$
// $hash=0a61852aa1a8c8c808e9d2258e09a0fa341056e0$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_BROWSER_HOST_CTOCPP_H_
@@ -86,6 +86,7 @@ class CefBrowserHostCToCpp : public CefCToCppRefCounted<CefBrowserHostCToCpp,
void WasHidden(bool hidden) OVERRIDE;
void NotifyScreenInfoChanged() OVERRIDE;
void Invalidate(PaintElementType type) OVERRIDE;
void SendExternalBeginFrame() OVERRIDE;
void SendKeyEvent(const CefKeyEvent& event) OVERRIDE;
void SendMouseClickEvent(const CefMouseEvent& event,
MouseButtonType type,

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=db89496c825cdc7fe1eaa4b7822d8492ae3a3f23$
// $hash=3c149c932cf4ebd4b2b8c81102851ebd1d6c1d63$
//
#include "libcef_dll/ctocpp/render_handler_ctocpp.h"
@@ -204,6 +204,48 @@ void CefRenderHandlerCToCpp::OnPaint(CefRefPtr<CefBrowser> browser,
delete[] dirtyRectsList;
}
NO_SANITIZE("cfi-icall")
void CefRenderHandlerCToCpp::OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
PaintElementType type,
const RectList& dirtyRects,
void* shared_handle) {
cef_render_handler_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, on_accelerated_paint))
return;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Verify param: browser; type: refptr_diff
DCHECK(browser.get());
if (!browser.get())
return;
// Verify param: shared_handle; type: simple_byaddr
DCHECK(shared_handle);
if (!shared_handle)
return;
// Translate param: dirtyRects; type: simple_vec_byref_const
const size_t dirtyRectsCount = dirtyRects.size();
cef_rect_t* dirtyRectsList = NULL;
if (dirtyRectsCount > 0) {
dirtyRectsList = new cef_rect_t[dirtyRectsCount];
DCHECK(dirtyRectsList);
if (dirtyRectsList) {
for (size_t i = 0; i < dirtyRectsCount; ++i) {
dirtyRectsList[i] = dirtyRects[i];
}
}
}
// Execute
_struct->on_accelerated_paint(_struct, CefBrowserCppToC::Wrap(browser), type,
dirtyRectsCount, dirtyRectsList, shared_handle);
// Restore param:dirtyRects; type: simple_vec_byref_const
if (dirtyRectsList)
delete[] dirtyRectsList;
}
NO_SANITIZE("cfi-icall")
void CefRenderHandlerCToCpp::OnCursorChange(
CefRefPtr<CefBrowser> browser,

View File

@@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=46dd8560076264a776129a02ba11e2c2f56bf209$
// $hash=2f19b04733f565830f873853695e9163086a8ee0$
//
#ifndef CEF_LIBCEF_DLL_CTOCPP_RENDER_HANDLER_CTOCPP_H_
@@ -52,6 +52,10 @@ class CefRenderHandlerCToCpp
const void* buffer,
int width,
int height) override;
void OnAcceleratedPaint(CefRefPtr<CefBrowser> browser,
PaintElementType type,
const RectList& dirtyRects,
void* shared_handle) override;
void OnCursorChange(CefRefPtr<CefBrowser> browser,
CefCursorHandle cursor,
CursorType type,