mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
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:
committed by
Marshall Greenblatt
parent
09afa3a843
commit
713eebcafc
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=099ec6c9deac65288a47cec317ab6b355e707179$
|
||||
// $hash=2357c186875d3086fa4931a3ac8346d866cab1e3$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/browser_host_cpptoc.h"
|
||||
@ -615,6 +615,18 @@ void CEF_CALLBACK browser_host_invalidate(struct _cef_browser_host_t* self,
|
||||
CefBrowserHostCppToC::Get(self)->Invalidate(type);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
browser_host_send_external_begin_frame(struct _cef_browser_host_t* self) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefBrowserHostCppToC::Get(self)->SendExternalBeginFrame();
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
browser_host_send_key_event(struct _cef_browser_host_t* self,
|
||||
const struct _cef_key_event_t* event) {
|
||||
@ -1111,6 +1123,8 @@ CefBrowserHostCppToC::CefBrowserHostCppToC() {
|
||||
GetStruct()->notify_screen_info_changed =
|
||||
browser_host_notify_screen_info_changed;
|
||||
GetStruct()->invalidate = browser_host_invalidate;
|
||||
GetStruct()->send_external_begin_frame =
|
||||
browser_host_send_external_begin_frame;
|
||||
GetStruct()->send_key_event = browser_host_send_key_event;
|
||||
GetStruct()->send_mouse_click_event = browser_host_send_mouse_click_event;
|
||||
GetStruct()->send_mouse_move_event = browser_host_send_mouse_move_event;
|
||||
|
@ -9,7 +9,7 @@
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
// $hash=6cf6466ab2a1b87a1b57b5994aab64992b9f12dd$
|
||||
// $hash=8df4ed4bd6e80bd90fb9563a021a59848fc40ecc$
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/render_handler_cpptoc.h"
|
||||
@ -266,6 +266,45 @@ void CEF_CALLBACK render_handler_on_paint(struct _cef_render_handler_t* self,
|
||||
width, height);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK
|
||||
render_handler_on_accelerated_paint(struct _cef_render_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
cef_paint_element_type_t type,
|
||||
size_t dirtyRectsCount,
|
||||
cef_rect_t const* dirtyRects,
|
||||
void* shared_handle) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: browser; type: refptr_diff
|
||||
DCHECK(browser);
|
||||
if (!browser)
|
||||
return;
|
||||
// Verify param: dirtyRects; type: simple_vec_byref_const
|
||||
DCHECK(dirtyRectsCount == 0 || dirtyRects);
|
||||
if (dirtyRectsCount > 0 && !dirtyRects)
|
||||
return;
|
||||
// Verify param: shared_handle; type: simple_byaddr
|
||||
DCHECK(shared_handle);
|
||||
if (!shared_handle)
|
||||
return;
|
||||
|
||||
// Translate param: dirtyRects; type: simple_vec_byref_const
|
||||
std::vector<CefRect> dirtyRectsList;
|
||||
if (dirtyRectsCount > 0) {
|
||||
for (size_t i = 0; i < dirtyRectsCount; ++i) {
|
||||
CefRect dirtyRectsVal = dirtyRects[i];
|
||||
dirtyRectsList.push_back(dirtyRectsVal);
|
||||
}
|
||||
}
|
||||
|
||||
// Execute
|
||||
CefRenderHandlerCppToC::Get(self)->OnAcceleratedPaint(
|
||||
CefBrowserCToCpp::Wrap(browser), type, dirtyRectsList, shared_handle);
|
||||
}
|
||||
|
||||
void CEF_CALLBACK render_handler_on_cursor_change(
|
||||
struct _cef_render_handler_t* self,
|
||||
cef_browser_t* browser,
|
||||
@ -444,6 +483,7 @@ CefRenderHandlerCppToC::CefRenderHandlerCppToC() {
|
||||
GetStruct()->on_popup_show = render_handler_on_popup_show;
|
||||
GetStruct()->on_popup_size = render_handler_on_popup_size;
|
||||
GetStruct()->on_paint = render_handler_on_paint;
|
||||
GetStruct()->on_accelerated_paint = render_handler_on_accelerated_paint;
|
||||
GetStruct()->on_cursor_change = render_handler_on_cursor_change;
|
||||
GetStruct()->start_dragging = render_handler_start_dragging;
|
||||
GetStruct()->update_drag_cursor = render_handler_update_drag_cursor;
|
||||
|
Reference in New Issue
Block a user