Chromium Code Reviews| 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 f546d4e1d630f91be8a9c76389a918e710686c21..bd6cbbf412e48f6138d79dece4ef58c4ff553b73 100644 |
| --- a/content/browser/renderer_host/render_widget_host_view_mac.mm |
| +++ b/content/browser/renderer_host/render_widget_host_view_mac.mm |
| @@ -822,22 +822,22 @@ void RenderWidgetHostViewMac::CopyFromCompositingSurface( |
| const base::Callback<void(bool)>& callback, |
| skia::PlatformCanvas* output) { |
| base::ScopedClosureRunner scoped_callback_runner(base::Bind(callback, false)); |
| - // TODO(mazda): Support copying a partial rectangle from the compositing |
| - // surface with |src_subrect| (http://crbug.com/118571). |
| - if (!src_subrect.IsEmpty()) { |
| - NOTIMPLEMENTED(); |
| - return; |
| - } |
| - |
| if (!compositing_iosurface_.get() || |
| !compositing_iosurface_->HasIOSurface()) |
| return; |
| - if (!output->initialize(dst_size.width(), dst_size.height(), true)) |
| + float scale = ScaleFactor(cocoa_view_); |
| + gfx::Size dst_size_in_pixel = dst_size.Scale(scale); |
| + if (!output->initialize( |
| + dst_size_in_pixel.width(), dst_size_in_pixel.height(), true)) |
| return; |
| + gfx::Rect src_subrect_in_pixel(src_subrect.origin().Scale(scale), |
|
Nico
2012/07/26 23:45:48
src_pixel_subrect is more consistent with the rest
mazda
2012/07/27 00:00:35
Done.
|
| + src_subrect.size().Scale(scale)); |
| const bool result = compositing_iosurface_->CopyTo( |
| - dst_size, output->getTopDevice()->accessBitmap(true).getPixels()); |
| + src_subrect_in_pixel, |
| + dst_size_in_pixel, |
| + output->getTopDevice()->accessBitmap(true).getPixels()); |
| scoped_callback_runner.Release(); |
| callback.Run(result); |
| } |