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