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

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

Issue 333723004: Fix set_area sizes for RequestCopyOfOutput (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 const base::TimeTicks start_time = base::TimeTicks::Now(); 274 const base::TimeTicks start_time = base::TimeTicks::Now();
275 const VideoCaptureOracle::Event event = 275 const VideoCaptureOracle::Event event =
276 dirty ? VideoCaptureOracle::kCompositorUpdate 276 dirty ? VideoCaptureOracle::kCompositorUpdate
277 : VideoCaptureOracle::kTimerPoll; 277 : VideoCaptureOracle::kTimerPoll;
278 if (oracle_proxy_->ObserveEventAndDecideCapture( 278 if (oracle_proxy_->ObserveEventAndDecideCapture(
279 event, start_time, &frame, &capture_frame_cb)) { 279 event, start_time, &frame, &capture_frame_cb)) {
280 scoped_ptr<cc::CopyOutputRequest> request = 280 scoped_ptr<cc::CopyOutputRequest> request =
281 cc::CopyOutputRequest::CreateRequest( 281 cc::CopyOutputRequest::CreateRequest(
282 base::Bind(&DesktopVideoCaptureMachine::DidCopyOutput, 282 base::Bind(&DesktopVideoCaptureMachine::DidCopyOutput,
283 AsWeakPtr(), frame, start_time, capture_frame_cb)); 283 AsWeakPtr(), frame, start_time, capture_frame_cb));
284 gfx::Rect window_rect = 284 gfx::Rect window_rect = gfx::Rect(desktop_window_->bounds().width(),
285 ui::ConvertRectToPixel(desktop_window_->layer(), 285 desktop_window_->bounds().height());
286 gfx::Rect(desktop_window_->bounds().width(),
287 desktop_window_->bounds().height()));
288 request->set_area(window_rect); 286 request->set_area(window_rect);
289 desktop_layer_->RequestCopyOfOutput(request.Pass()); 287 desktop_layer_->RequestCopyOfOutput(request.Pass());
290 } 288 }
291 } 289 }
292 290
293 void CopyOutputFinishedForVideo( 291 void CopyOutputFinishedForVideo(
294 base::TimeTicks start_time, 292 base::TimeTicks start_time,
295 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb, 293 const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb,
296 const scoped_refptr<media::VideoFrame>& target, 294 const scoped_refptr<media::VideoFrame>& target,
297 const SkBitmap& cursor_bitmap, 295 const SkBitmap& cursor_bitmap,
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 scoped_ptr<Client> client) { 526 scoped_ptr<Client> client) {
529 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); 527 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString();
530 core_->AllocateAndStart(params, client.Pass()); 528 core_->AllocateAndStart(params, client.Pass());
531 } 529 }
532 530
533 void DesktopCaptureDeviceAura::StopAndDeAllocate() { 531 void DesktopCaptureDeviceAura::StopAndDeAllocate() {
534 core_->StopAndDeAllocate(); 532 core_->StopAndDeAllocate();
535 } 533 }
536 534
537 } // namespace content 535 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698