diff options
author | hshi@chromium.org <hshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 22:05:55 +0000 |
---|---|---|
committer | hshi@chromium.org <hshi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-08-12 22:07:11 +0000 |
commit | bb1411a35c57fded646926e4c4bf24d1d6988ba4 (patch) | |
tree | 2d431bba1587b6f63ddd9cd58fbfdda2569b816b /content | |
parent | 1effee248d632b14801c7d65919707dcf1c4c482 (diff) | |
download | chromium_src-bb1411a35c57fded646926e4c4bf24d1d6988ba4.zip chromium_src-bb1411a35c57fded646926e4c4bf24d1d6988ba4.tar.gz chromium_src-bb1411a35c57fded646926e4c4bf24d1d6988ba4.tar.bz2 |
Chrome OS desktop capture: pad capture size to multiples of 16 pixels.
This is a temporary workaround to fix desktop capture with HW encoder
at non-multiple-of-16 resolution without an extra memcpy.
BUG=402151
R=hclam@chromium.org
TBR=sergeyu@chromium.org
TEST=verify that desktop capture works on non-multiple-of-16 resolution
Review URL: https://codereview.chromium.org/469493002
Cr-Commit-Position: refs/heads/master@{#289078}
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@289078 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content')
-rw-r--r-- | content/browser/media/capture/desktop_capture_device_aura.cc | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/content/browser/media/capture/desktop_capture_device_aura.cc b/content/browser/media/capture/desktop_capture_device_aura.cc index c99ad01..b795b1c 100644 --- a/content/browser/media/capture/desktop_capture_device_aura.cc +++ b/content/browser/media/capture/desktop_capture_device_aura.cc @@ -245,8 +245,15 @@ void DesktopVideoCaptureMachine::UpdateCaptureSize() { DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); if (oracle_proxy_ && desktop_window_) { ui::Layer* layer = desktop_window_->layer(); - oracle_proxy_->UpdateCaptureSize(ui::ConvertSizeToPixel( - layer, layer->bounds().size())); + gfx::Size capture_size = + ui::ConvertSizeToPixel(layer, layer->bounds().size()); +#if defined(OS_CHROMEOS) + // Pad desktop capture size to multiples of 16 pixels to accommodate HW + // encoder. TODO(hshi): remove this hack. See http://crbug.com/402151 + capture_size.SetSize((capture_size.width() + 15) & ~15, + (capture_size.height() + 15) & ~15); +#endif + oracle_proxy_->UpdateCaptureSize(capture_size); } ClearCursorState(); } |