| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/host/screen_recorder.h" | 5 #include "remoting/host/screen_recorder.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 | 243 |
| 244 // Try to do a capture again only if |frame_skipped_| is set to true by | 244 // Try to do a capture again only if |frame_skipped_| is set to true by |
| 245 // capture timer. | 245 // capture timer. |
| 246 if (frame_skipped_) | 246 if (frame_skipped_) |
| 247 DoCapture(); | 247 DoCapture(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void ScreenRecorder::DoInvalidateFullScreen() { | 250 void ScreenRecorder::DoInvalidateFullScreen() { |
| 251 DCHECK(capture_task_runner_->BelongsToCurrentThread()); | 251 DCHECK(capture_task_runner_->BelongsToCurrentThread()); |
| 252 | 252 |
| 253 capturer_->InvalidateFullScreen(); | 253 SkRegion region; |
| 254 region.op(SkIRect::MakeSize(capturer_->size_most_recent()), |
| 255 SkRegion::kUnion_Op); |
| 256 capturer_->InvalidateRegion(region); |
| 254 } | 257 } |
| 255 | 258 |
| 256 // Network thread -------------------------------------------------------------- | 259 // Network thread -------------------------------------------------------------- |
| 257 | 260 |
| 258 void ScreenRecorder::DoSendVideoPacket(scoped_ptr<VideoPacket> packet) { | 261 void ScreenRecorder::DoSendVideoPacket(scoped_ptr<VideoPacket> packet) { |
| 259 DCHECK(network_task_runner_->BelongsToCurrentThread()); | 262 DCHECK(network_task_runner_->BelongsToCurrentThread()); |
| 260 | 263 |
| 261 if (network_stopped_ || connections_.empty()) | 264 if (network_stopped_ || connections_.empty()) |
| 262 return; | 265 return; |
| 263 | 266 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 361 packet->set_encode_time_ms(encode_time_ms); | 364 packet->set_encode_time_ms(encode_time_ms); |
| 362 scheduler_.RecordEncodeTime(encode_time); | 365 scheduler_.RecordEncodeTime(encode_time); |
| 363 } | 366 } |
| 364 | 367 |
| 365 network_task_runner_->PostTask( | 368 network_task_runner_->PostTask( |
| 366 FROM_HERE, base::Bind(&ScreenRecorder::DoSendVideoPacket, this, | 369 FROM_HERE, base::Bind(&ScreenRecorder::DoSendVideoPacket, this, |
| 367 base::Passed(packet.Pass()))); | 370 base::Passed(packet.Pass()))); |
| 368 } | 371 } |
| 369 | 372 |
| 370 } // namespace remoting | 373 } // namespace remoting |
| OLD | NEW |