| 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/media/capture/aura_window_capture_machine.h" | 5 #include "content/browser/media/capture/aura_window_capture_machine.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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 result->TakeTexture(&texture_mailbox, &release_callback); | 280 result->TakeTexture(&texture_mailbox, &release_callback); |
| 281 DCHECK(texture_mailbox.IsTexture()); | 281 DCHECK(texture_mailbox.IsTexture()); |
| 282 if (!texture_mailbox.IsTexture()) | 282 if (!texture_mailbox.IsTexture()) |
| 283 return false; | 283 return false; |
| 284 video_frame = media::VideoFrame::WrapNativeTexture( | 284 video_frame = media::VideoFrame::WrapNativeTexture( |
| 285 make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox.mailbox(), | 285 make_scoped_ptr(new gpu::MailboxHolder(texture_mailbox.mailbox(), |
| 286 texture_mailbox.target(), | 286 texture_mailbox.target(), |
| 287 texture_mailbox.sync_point())), | 287 texture_mailbox.sync_point())), |
| 288 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), | 288 base::Bind(&RunSingleReleaseCallback, base::Passed(&release_callback)), |
| 289 result->size(), gfx::Rect(result->size()), result->size(), | 289 result->size(), gfx::Rect(result->size()), result->size(), |
| 290 base::TimeDelta(), false); | 290 base::TimeDelta(), false /* allows_overlay */, true /* has_alpha */); |
| 291 capture_frame_cb.Run(video_frame, start_time, true); | 291 capture_frame_cb.Run(video_frame, start_time, true); |
| 292 return true; | 292 return true; |
| 293 } else { | 293 } else { |
| 294 DCHECK(video_frame.get()); | 294 DCHECK(video_frame.get()); |
| 295 } | 295 } |
| 296 | 296 |
| 297 // Compute the dest size we want after the letterboxing resize. Make the | 297 // Compute the dest size we want after the letterboxing resize. Make the |
| 298 // coordinates and sizes even because we letterbox in YUV space | 298 // coordinates and sizes even because we letterbox in YUV space |
| 299 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to | 299 // (see CopyRGBToVideoFrame). They need to be even for the UV samples to |
| 300 // line up correctly. | 300 // line up correctly. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 window->GetHost()->compositor()->RemoveObserver(this); | 441 window->GetHost()->compositor()->RemoveObserver(this); |
| 442 } | 442 } |
| 443 | 443 |
| 444 void AuraWindowCaptureMachine::OnCompositingEnded( | 444 void AuraWindowCaptureMachine::OnCompositingEnded( |
| 445 ui::Compositor* compositor) { | 445 ui::Compositor* compositor) { |
| 446 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( | 446 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, base::Bind( |
| 447 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); | 447 &AuraWindowCaptureMachine::Capture, AsWeakPtr(), true)); |
| 448 } | 448 } |
| 449 | 449 |
| 450 } // namespace content | 450 } // namespace content |
| OLD | NEW |