OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "remoting/host/capturer.h" |
| 6 |
| 7 namespace remoting { |
| 8 |
| 9 Capturer::Capturer() |
| 10 : width_(0), |
| 11 height_(0), |
| 12 pixel_format_(chromotocol_pb::PixelFormatInvalid), |
| 13 bytes_per_pixel_(0), |
| 14 bytes_per_row_(0), |
| 15 current_buffer_(0) { |
| 16 } |
| 17 |
| 18 Capturer::~Capturer() { |
| 19 } |
| 20 |
| 21 void Capturer::GetDirtyRects(DirtyRects* rects) const { |
| 22 *rects = dirty_rects_; |
| 23 } |
| 24 |
| 25 int Capturer::GetWidth() const { |
| 26 return width_; |
| 27 } |
| 28 |
| 29 int Capturer::GetHeight() const { |
| 30 return height_; |
| 31 } |
| 32 |
| 33 chromotocol_pb::PixelFormat Capturer::GetPixelFormat() const { |
| 34 return pixel_format_; |
| 35 } |
| 36 |
| 37 void Capturer::InvalidateRect(gfx::Rect dirty_rect) { |
| 38 inval_rects_.push_back(dirty_rect); |
| 39 } |
| 40 |
| 41 void Capturer::FinishCapture(Task* done_task) { |
| 42 done_task->Run(); |
| 43 delete done_task; |
| 44 |
| 45 // Select the next buffer to be the current buffer. |
| 46 current_buffer_ = ++current_buffer_ % kNumBuffers; |
| 47 } |
| 48 |
| 49 } // namespace remoting |
OLD | NEW |