| Index: content/browser/renderer_host/render_widget_host_view_mac.mm
|
| diff --git a/content/browser/renderer_host/render_widget_host_view_mac.mm b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| index 6bad9f931d7ce54b731206340e7d0d1f1f523e44..9f4d5a693c11f2044baa9e59db4246ab9f2ba507 100644
|
| --- a/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm
|
| @@ -1046,7 +1046,8 @@ void RenderWidgetHostViewMac::PluginImeCompositionCompleted(
|
| }
|
|
|
| bool RenderWidgetHostViewMac::CompositorSwapBuffers(uint64 surface_handle,
|
| - const gfx::Size& size) {
|
| + const gfx::Size& size,
|
| + float scale_factor) {
|
| if (is_hidden_)
|
| return true;
|
|
|
| @@ -1060,7 +1061,8 @@ bool RenderWidgetHostViewMac::CompositorSwapBuffers(uint64 surface_handle,
|
| RenderWidgetHostViewFrameSubscriber::DeliverFrameCallback callback;
|
| if (frame_subscriber_->ShouldCaptureFrame(present_time,
|
| &frame, &callback)) {
|
| - compositing_iosurface_->SetIOSurface(surface_handle, size);
|
| + compositing_iosurface_->SetIOSurface(
|
| + surface_handle, size, scale_factor);
|
| compositing_iosurface_->CopyToVideoFrame(
|
| gfx::Rect(size), ScaleFactor(cocoa_view_), frame,
|
| base::Bind(callback, present_time));
|
| @@ -1102,7 +1104,7 @@ bool RenderWidgetHostViewMac::CompositorSwapBuffers(uint64 surface_handle,
|
| if (!compositing_iosurface_)
|
| return true;
|
|
|
| - compositing_iosurface_->SetIOSurface(surface_handle, size);
|
| + compositing_iosurface_->SetIOSurface(surface_handle, size, scale_factor);
|
|
|
| GotAcceleratedFrame();
|
|
|
| @@ -1312,7 +1314,9 @@ void RenderWidgetHostViewMac::AcceleratedSurfaceBuffersSwapped(
|
| pending_swap_buffers_acks_.push_back(std::make_pair(params.route_id,
|
| gpu_host_id));
|
|
|
| - if (CompositorSwapBuffers(params.surface_handle, params.size))
|
| + if (CompositorSwapBuffers(params.surface_handle,
|
| + params.size,
|
| + params.scale_factor))
|
| AckPendingSwapBuffers();
|
| }
|
|
|
| @@ -1326,7 +1330,9 @@ void RenderWidgetHostViewMac::AcceleratedSurfacePostSubBuffer(
|
| pending_swap_buffers_acks_.push_back(std::make_pair(params.route_id,
|
| gpu_host_id));
|
|
|
| - if (CompositorSwapBuffers(params.surface_handle, params.surface_size))
|
| + if (CompositorSwapBuffers(params.surface_handle,
|
| + params.surface_size,
|
| + params.surface_scale_factor))
|
| AckPendingSwapBuffers();
|
| }
|
|
|
| @@ -1341,15 +1347,6 @@ void RenderWidgetHostViewMac::AcceleratedSurfaceRelease() {
|
|
|
| bool RenderWidgetHostViewMac::HasAcceleratedSurface(
|
| const gfx::Size& desired_size) {
|
| - // Update device scale factor for the IOSurface before checking if there
|
| - // is a match. When initially created, the IOSurface is unaware of its
|
| - // scale factor, which can result in compatible IOSurfaces not being used
|
| - // http://crbug.com/237293
|
| - if (compositing_iosurface_.get() &&
|
| - compositing_iosurface_->HasIOSurface()) {
|
| - compositing_iosurface_->SetDeviceScaleFactor(ScaleFactor(cocoa_view_));
|
| - }
|
| -
|
| return last_frame_was_accelerated_ &&
|
| compositing_iosurface_.get() &&
|
| compositing_iosurface_->HasIOSurface() &&
|
|
|