From fda2f34c75d4dd4faf7707a3e16e15130521a761 Mon Sep 17 00:00:00 2001 From: Marshall Greenblatt Date: Mon, 6 Feb 2017 16:24:25 -0500 Subject: [PATCH] macOS: Fix incorrect OSR compositor resize in OnSwapCompositorFrame (issue #2065) --- libcef/browser/osr/render_widget_host_view_osr.cc | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/libcef/browser/osr/render_widget_host_view_osr.cc b/libcef/browser/osr/render_widget_host_view_osr.cc index bd6f3482b..ca646b512 100644 --- a/libcef/browser/osr/render_widget_host_view_osr.cc +++ b/libcef/browser/osr/render_widget_host_view_osr.cc @@ -696,8 +696,11 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame( // The compositor will draw directly to the SoftwareOutputDevice which // then calls OnPaint. #if defined(OS_MACOSX) - browser_compositor_->SwapCompositorFrame(output_surface_id, - std::move(frame)); + // We would normally call BrowserCompositorMac::SwapCompositorFrame, + // however it contains compositor resize logic that we don't want. + // Consequently we instead call the SwapDelegatedFrame method directly. + browser_compositor_->GetDelegatedFrameHost()->SwapDelegatedFrame( + output_surface_id, std::move(frame)); #else delegated_frame_host_->SwapDelegatedFrame(output_surface_id, std::move(frame)); @@ -717,8 +720,11 @@ void CefRenderWidgetHostViewOSR::OnSwapCompositorFrame( damage_rect.Intersect(gfx::Rect(frame_size)); #if defined(OS_MACOSX) - browser_compositor_->SwapCompositorFrame(output_surface_id, - std::move(frame)); + // We would normally call BrowserCompositorMac::SwapCompositorFrame, + // however it contains compositor resize logic that we don't want. + // Consequently we instead call the SwapDelegatedFrame method directly. + browser_compositor_->GetDelegatedFrameHost()->SwapDelegatedFrame( + output_surface_id, std::move(frame)); #else delegated_frame_host_->SwapDelegatedFrame(output_surface_id, std::move(frame));