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