Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(932)

Unified Diff: content/browser/media/capture/web_contents_video_capture_device.cc

Issue 2654413002: Stretching NativeViewHost, and misc tab capture fixes.
Patch Set: Gettin' it all working on ui/cocoa and MacViews too. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/browser/media/capture/web_contents_video_capture_device.cc
diff --git a/content/browser/media/capture/web_contents_video_capture_device.cc b/content/browser/media/capture/web_contents_video_capture_device.cc
index 336ec0ee10e81821ee86dcedba39d6ba8ea5214c..f4b73f2bc31d76256ebaaeccc83a627e02707c27 100644
--- a/content/browser/media/capture/web_contents_video_capture_device.cc
+++ b/content/browser/media/capture/web_contents_video_capture_device.cc
@@ -552,9 +552,8 @@ void WebContentsCaptureMachine::Capture(
return;
}
- const gfx::Size view_size = view->GetViewBounds().size();
view->CopyFromCompositingSurfaceToVideoFrame(
- gfx::Rect(view_size), std::move(target),
+ gfx::Rect(), std::move(target),
base::Bind(&WebContentsCaptureMachine::DidCopyToVideoFrame,
weak_ptr_factory_.GetWeakPtr(), start_time, deliver_frame_cb));
}
@@ -686,16 +685,13 @@ void WebContentsCaptureMachine::UpdateCaptureSize() {
if (!view)
return;
- // Convert the view's size from the DIP coordinate space to the pixel
- // coordinate space. When the view is being rendered on a high-DPI display,
- // this allows the high-resolution image detail to propagate through to the
+ // The capture size is not the view's size in DIP coordinates, but instead
+ // based on the backing store. Thus, when a view is being rendered on a high-
+ // DPI display, the high-resolution image detail will propagate through to the
// captured video.
- const gfx::Size view_size = view->GetViewBounds().size();
- const gfx::Size physical_size = gfx::ConvertSizeToPixel(
- ui::GetScaleFactorForNativeView(view->GetNativeView()), view_size);
- VLOG(1) << "Computed physical capture size (" << physical_size.ToString()
- << ") from view size (" << view_size.ToString() << ").";
-
+ const gfx::Size physical_size =
+ static_cast<RenderWidgetHostViewBase*>(view)->GetPhysicalBackingSize();
+ VLOG(1) << "Physical capture size of view is " << physical_size.ToString();
oracle_proxy_->UpdateCaptureSize(physical_size);
}
« no previous file with comments | « content/browser/media/capture/cursor_renderer_aura.cc ('k') | content/browser/renderer_host/delegated_frame_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698