| 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_ascii.h" | 5 #include "remoting/host/capturer_fake_ascii.h" |
| 6 | 6 |
| 7 #include "gfx/rect.h" | 7 #include "gfx/rect.h" |
| 8 | 8 |
| 9 namespace remoting { | 9 namespace remoting { |
| 10 | 10 |
| 11 static const int kWidth = 32; | 11 static const int kWidth = 32; |
| 12 static const int kHeight = 20; | 12 static const int kHeight = 20; |
| 13 static const int kBytesPerPixel = 1; | 13 static const int kBytesPerPixel = 1; |
| 14 | 14 |
| 15 CapturerFakeAscii::CapturerFakeAscii() { | 15 CapturerFakeAscii::CapturerFakeAscii() { |
| 16 // Dimensions of screen. | 16 // Dimensions of screen. |
| 17 width_ = kWidth; | 17 width_ = kWidth; |
| 18 height_ = kHeight; | 18 height_ = kHeight; |
| 19 pixel_format_ = chromotocol_pb::PixelFormatAscii; | 19 pixel_format_ = PixelFormatAscii; |
| 20 bytes_per_pixel_ = kBytesPerPixel; | 20 bytes_per_pixel_ = kBytesPerPixel; |
| 21 bytes_per_row_ = width_ * bytes_per_pixel_; | 21 bytes_per_row_ = width_ * bytes_per_pixel_; |
| 22 | 22 |
| 23 // Create memory for the buffers. | 23 // Create memory for the buffers. |
| 24 int buffer_size = height_ * bytes_per_row_; | 24 int buffer_size = height_ * bytes_per_row_; |
| 25 for (int i = 0; i < kNumBuffers; i++) { | 25 for (int i = 0; i < kNumBuffers; i++) { |
| 26 buffers_[i].reset(new uint8[buffer_size]); | 26 buffers_[i].reset(new uint8[buffer_size]); |
| 27 } | 27 } |
| 28 } | 28 } |
| 29 | 29 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 if (y == 0 || x == 0 || x == (width_ - 1) || y == (height_ - 1)) { | 79 if (y == 0 || x == 0 || x == (width_ - 1) || y == (height_ - 1)) { |
| 80 row[x] = '*'; | 80 row[x] = '*'; |
| 81 } else { | 81 } else { |
| 82 row[x] = ' '; | 82 row[x] = ' '; |
| 83 } | 83 } |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 } // namespace remoting | 88 } // namespace remoting |
| OLD | NEW |