| 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_fake.h" | 5 #include "remoting/host/capturer_fake.h" |
| 6 | 6 |
| 7 #include "gfx/rect.h" | 7 #include "gfx/rect.h" |
| 8 | 8 |
| 9 namespace remoting { | 9 namespace remoting { |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 CaptureCompletedCallback* callback) { | 24 CaptureCompletedCallback* callback) { |
| 25 GenerateImage(); | 25 GenerateImage(); |
| 26 Capturer::DataPlanes planes; | 26 Capturer::DataPlanes planes; |
| 27 planes.data[0] = buffers_[current_buffer_].get(); | 27 planes.data[0] = buffers_[current_buffer_].get(); |
| 28 planes.strides[0] = bytes_per_row_; | 28 planes.strides[0] = bytes_per_row_; |
| 29 | 29 |
| 30 scoped_refptr<CaptureData> capture_data(new CaptureData(planes, | 30 scoped_refptr<CaptureData> capture_data(new CaptureData(planes, |
| 31 width_, | 31 width_, |
| 32 height_, | 32 height_, |
| 33 pixel_format_)); | 33 pixel_format_)); |
| 34 capture_data->mutable_dirty_rects() = rects; |
| 34 FinishCapture(capture_data, callback); | 35 FinishCapture(capture_data, callback); |
| 35 } | 36 } |
| 36 | 37 |
| 37 void CapturerFake::ScreenConfigurationChanged() { | 38 void CapturerFake::ScreenConfigurationChanged() { |
| 38 width_ = kWidth; | 39 width_ = kWidth; |
| 39 height_ = kHeight; | 40 height_ = kHeight; |
| 40 pixel_format_ = PixelFormatRgb32; | 41 pixel_format_ = PixelFormatRgb32; |
| 41 bytes_per_row_ = width_ * kBytesPerPixel; | 42 bytes_per_row_ = width_ * kBytesPerPixel; |
| 42 | 43 |
| 43 // Create memory for the buffers. | 44 // Create memory for the buffers. |
| (...skipping 10 matching lines...) Expand all Loading... |
| 54 for (int x = 0; x < width_; ++x) { | 55 for (int x = 0; x < width_; ++x) { |
| 55 row[x * kBytesPerPixel + offset] = seed_++; | 56 row[x * kBytesPerPixel + offset] = seed_++; |
| 56 seed_ &= kMaxColorChannelValue; | 57 seed_ &= kMaxColorChannelValue; |
| 57 } | 58 } |
| 58 row += bytes_per_row_; | 59 row += bytes_per_row_; |
| 59 } | 60 } |
| 60 ++seed_; | 61 ++seed_; |
| 61 } | 62 } |
| 62 | 63 |
| 63 } // namespace remoting | 64 } // namespace remoting |
| OLD | NEW |