OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/capturer.h" | 5 #include "remoting/host/capturer.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "remoting/base/tracer.h" | 9 #include "remoting/base/tracer.h" |
10 | 10 |
11 namespace remoting { | 11 namespace remoting { |
12 | 12 |
13 Capturer::Capturer() | 13 Capturer::Capturer() |
14 : width_(0), | 14 : width_(0), |
15 height_(0), | 15 height_(0), |
16 pixel_format_(PIXEL_FORMAT_INVALID), | 16 pixel_format_(PixelFormatInvalid), |
17 bytes_per_row_(0), | 17 bytes_per_row_(0), |
18 current_buffer_(0) { | 18 current_buffer_(0) { |
19 } | 19 } |
20 | 20 |
21 Capturer::~Capturer() { | 21 Capturer::~Capturer() { |
22 } | 22 } |
23 | 23 |
24 void Capturer::ClearInvalidRects() { | 24 void Capturer::ClearInvalidRects() { |
25 AutoLock auto_inval_rects_lock(inval_rects_lock_); | 25 AutoLock auto_inval_rects_lock(inval_rects_lock_); |
26 inval_rects_.clear(); | 26 inval_rects_.clear(); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 void Capturer::FinishCapture(scoped_refptr<CaptureData> data, | 63 void Capturer::FinishCapture(scoped_refptr<CaptureData> data, |
64 CaptureCompletedCallback* callback) { | 64 CaptureCompletedCallback* callback) { |
65 // Select the next buffer to be the current buffer. | 65 // Select the next buffer to be the current buffer. |
66 current_buffer_ = (current_buffer_ + 1) % kNumBuffers; | 66 current_buffer_ = (current_buffer_ + 1) % kNumBuffers; |
67 | 67 |
68 callback->Run(data); | 68 callback->Run(data); |
69 delete callback; | 69 delete callback; |
70 } | 70 } |
71 | 71 |
72 } // namespace remoting | 72 } // namespace remoting |
OLD | NEW |