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

Side by Side Diff: content/browser/media/capture/desktop_capture_device_aura.cc

Issue 462173002: Fix set_area sizes for RequestCopyOfOutput, and related tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove 'middle 3 columns' exception, per sky@. Created 6 years, 4 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/media/capture/desktop_capture_device_aura.h" 5 #include "content/browser/media/capture/desktop_capture_device_aura.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/timer/timer.h" 9 #include "base/timer/timer.h"
10 #include "cc/output/copy_output_request.h" 10 #include "cc/output/copy_output_request.h"
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 const base::TimeTicks start_time = base::TimeTicks::Now(); 271 const base::TimeTicks start_time = base::TimeTicks::Now();
272 const VideoCaptureOracle::Event event = 272 const VideoCaptureOracle::Event event =
273 dirty ? VideoCaptureOracle::kCompositorUpdate 273 dirty ? VideoCaptureOracle::kCompositorUpdate
274 : VideoCaptureOracle::kTimerPoll; 274 : VideoCaptureOracle::kTimerPoll;
275 if (oracle_proxy_->ObserveEventAndDecideCapture( 275 if (oracle_proxy_->ObserveEventAndDecideCapture(
276 event, gfx::Rect(), start_time, &frame, &capture_frame_cb)) { 276 event, gfx::Rect(), start_time, &frame, &capture_frame_cb)) {
277 scoped_ptr<cc::CopyOutputRequest> request = 277 scoped_ptr<cc::CopyOutputRequest> request =
278 cc::CopyOutputRequest::CreateRequest( 278 cc::CopyOutputRequest::CreateRequest(
279 base::Bind(&DesktopVideoCaptureMachine::DidCopyOutput, 279 base::Bind(&DesktopVideoCaptureMachine::DidCopyOutput,
280 AsWeakPtr(), frame, start_time, capture_frame_cb)); 280 AsWeakPtr(), frame, start_time, capture_frame_cb));
281 gfx::Rect window_rect = 281 gfx::Rect window_rect = gfx::Rect(desktop_window_->bounds().width(),
282 ui::ConvertRectToPixel(desktop_window_->layer(), 282 desktop_window_->bounds().height());
283 gfx::Rect(desktop_window_->bounds().width(),
284 desktop_window_->bounds().height()));
285 request->set_area(window_rect); 283 request->set_area(window_rect);
286 desktop_window_->layer()->RequestCopyOfOutput(request.Pass()); 284 desktop_window_->layer()->RequestCopyOfOutput(request.Pass());
287 } 285 }
288 } 286 }
289 287
290 void CopyOutputFinishedForVideo( 288 void CopyOutputFinishedForVideo(
291 base::TimeTicks start_time, 289 base::TimeTicks start_time,
292 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, 290 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb,
293 const scoped_refptr<media::VideoFrame>& target, 291 const scoped_refptr<media::VideoFrame>& target,
294 const SkBitmap& cursor_bitmap, 292 const SkBitmap& cursor_bitmap,
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 scoped_ptr<Client> client) { 529 scoped_ptr<Client> client) {
532 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); 530 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
533 core_->AllocateAndStart(params, client.Pass()); 531 core_->AllocateAndStart(params, client.Pass());
534 } 532 }
535 533
536 void DesktopCaptureDeviceAura::StopAndDeAllocate() { 534 void DesktopCaptureDeviceAura::StopAndDeAllocate() {
537 core_->StopAndDeAllocate(); 535 core_->StopAndDeAllocate();
538 } 536 }
539 537
540 } // namespace content 538 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/compositor/delegated_frame_host.cc ('k') | content/browser/renderer_host/render_widget_host_view_base.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698