macOS: Fix incorrect OSR compositor resize in OnSwapCompositorFrame (issue #2065)

This commit is contained in:
Marshall Greenblatt 2017-02-06 16:24:25 -05:00
parent 661fa722a7
commit fda2f34c75
1 changed files with 10 additions and 4 deletions

View File

@ -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));