OLD | NEW |
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/renderer_host/media/desktop_capture_device_aura.h" | 5 #include "content/browser/renderer_host/media/desktop_capture_device_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/timer/timer.h" | 8 #include "base/timer/timer.h" |
9 #include "cc/output/copy_output_request.h" | 9 #include "cc/output/copy_output_request.h" |
10 #include "cc/output/copy_output_result.h" | 10 #include "cc/output/copy_output_result.h" |
(...skipping 325 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
336 result_rect.size(), | 336 result_rect.size(), |
337 result_rect, | 337 result_rect, |
338 video_frame->coded_size(), | 338 video_frame->coded_size(), |
339 region_in_frame, | 339 region_in_frame, |
340 true, | 340 true, |
341 true)); | 341 true)); |
342 } | 342 } |
343 | 343 |
344 gfx::Point cursor_position_in_frame = UpdateCursorState(region_in_frame); | 344 gfx::Point cursor_position_in_frame = UpdateCursorState(region_in_frame); |
345 yuv_readback_pipeline_->ReadbackYUV( | 345 yuv_readback_pipeline_->ReadbackYUV( |
346 texture_mailbox.name(), texture_mailbox.sync_point(), video_frame.get(), | 346 texture_mailbox.mailbox(), |
347 base::Bind(&CopyOutputFinishedForVideo, start_time, capture_frame_cb, | 347 texture_mailbox.sync_point(), |
348 video_frame, scaled_cursor_bitmap_, cursor_position_in_frame, | 348 video_frame.get(), |
| 349 base::Bind(&CopyOutputFinishedForVideo, |
| 350 start_time, |
| 351 capture_frame_cb, |
| 352 video_frame, |
| 353 scaled_cursor_bitmap_, |
| 354 cursor_position_in_frame, |
349 base::Passed(&release_callback))); | 355 base::Passed(&release_callback))); |
350 } | 356 } |
351 | 357 |
352 gfx::Point DesktopVideoCaptureMachine::UpdateCursorState( | 358 gfx::Point DesktopVideoCaptureMachine::UpdateCursorState( |
353 const gfx::Rect& region_in_frame) { | 359 const gfx::Rect& region_in_frame) { |
354 const gfx::Rect desktop_bounds = desktop_layer_->bounds(); | 360 const gfx::Rect desktop_bounds = desktop_layer_->bounds(); |
355 gfx::NativeCursor cursor = desktop_window_->GetDispatcher()->last_cursor(); | 361 gfx::NativeCursor cursor = desktop_window_->GetDispatcher()->last_cursor(); |
356 if (last_cursor_ != cursor) { | 362 if (last_cursor_ != cursor) { |
357 SkBitmap cursor_bitmap; | 363 SkBitmap cursor_bitmap; |
358 if (ui::GetCursorBitmap(cursor, &cursor_bitmap, &cursor_hot_point_)) { | 364 if (ui::GetCursorBitmap(cursor, &cursor_bitmap, &cursor_hot_point_)) { |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
436 scoped_ptr<Client> client) { | 442 scoped_ptr<Client> client) { |
437 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); | 443 DVLOG(1) << "Allocating " << params.requested_format.frame_size.ToString(); |
438 impl_->AllocateAndStart(params, client.Pass()); | 444 impl_->AllocateAndStart(params, client.Pass()); |
439 } | 445 } |
440 | 446 |
441 void DesktopCaptureDeviceAura::StopAndDeAllocate() { | 447 void DesktopCaptureDeviceAura::StopAndDeAllocate() { |
442 impl_->StopAndDeAllocate(); | 448 impl_->StopAndDeAllocate(); |
443 } | 449 } |
444 | 450 |
445 } // namespace content | 451 } // namespace content |
OLD | NEW |