From a48e0720762ac3f2c0c6e08b65f82f5ca8050fbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Riku=20Palom=C3=A4ki?= Date: Mon, 18 Mar 2019 21:07:02 +0000 Subject: [PATCH] Linux: Add OSR use_external_begin_frame support (see issue #1006) --- libcef/browser/browser_platform_delegate_create.cc | 2 +- .../browser/native/browser_platform_delegate_native_linux.cc | 5 +++-- .../browser/native/browser_platform_delegate_native_linux.h | 3 ++- libcef/browser/osr/render_widget_host_view_osr.cc | 3 +++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libcef/browser/browser_platform_delegate_create.cc b/libcef/browser/browser_platform_delegate_create.cc index da0bd5845..75c05f42a 100644 --- a/libcef/browser/browser_platform_delegate_create.cc +++ b/libcef/browser/browser_platform_delegate_create.cc @@ -46,7 +46,7 @@ std::unique_ptr CreateNativeDelegate( window_info, background_color); #elif defined(OS_LINUX) return std::make_unique( - window_info, background_color); + window_info, background_color, use_external_begin_frame); #endif } diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.cc b/libcef/browser/native/browser_platform_delegate_native_linux.cc index 4e7f48a28..21fb0a992 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.cc +++ b/libcef/browser/native/browser_platform_delegate_native_linux.cc @@ -41,11 +41,12 @@ long GetSystemUptime() { CefBrowserPlatformDelegateNativeLinux::CefBrowserPlatformDelegateNativeLinux( const CefWindowInfo& window_info, - SkColor background_color) + SkColor background_color, + bool use_external_begin_frame) : CefBrowserPlatformDelegateNative(window_info, background_color, false, - false), + use_external_begin_frame), host_window_created_(false), window_widget_(nullptr), window_x11_(nullptr) {} diff --git a/libcef/browser/native/browser_platform_delegate_native_linux.h b/libcef/browser/native/browser_platform_delegate_native_linux.h index d7a54eef3..771d15134 100644 --- a/libcef/browser/native/browser_platform_delegate_native_linux.h +++ b/libcef/browser/native/browser_platform_delegate_native_linux.h @@ -14,7 +14,8 @@ class CefBrowserPlatformDelegateNativeLinux : public CefBrowserPlatformDelegateNative { public: CefBrowserPlatformDelegateNativeLinux(const CefWindowInfo& window_info, - SkColor background_color); + SkColor background_color, + bool use_external_begin_frame); // CefBrowserPlatformDelegate methods: void BrowserDestroyed(CefBrowserHostImpl* browser) override; diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index 50c9168ac..e2ae1e478 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -1323,6 +1323,9 @@ void CefRenderWidgetHostViewOSR::SendExternalBeginFrame() { DCHECK(begin_frame_args.IsValid()); begin_frame_number_++; + if (render_widget_host_) + render_widget_host_->ProgressFlingIfNeeded(frame_time); + if (renderer_compositor_frame_sink_) { GetCompositor()->context_factory_private()->IssueExternalBeginFrame( GetCompositor(), begin_frame_args);