| 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 } | 16 } | 
| 17 | 17 | 
| 18 CapturerFakeAscii::~CapturerFakeAscii() { | 18 CapturerFakeAscii::~CapturerFakeAscii() { | 
| 19 } | 19 } | 
| 20 | 20 | 
| 21 void CapturerFakeAscii::ScreenConfigurationChanged() { | 21 void CapturerFakeAscii::ScreenConfigurationChanged() { | 
| 22   width_ = kWidth; | 22   width_ = kWidth; | 
| 23   height_ = kHeight; | 23   height_ = kHeight; | 
| 24   pixel_format_ = PIXEL_FORMAT_ASCII; | 24   pixel_format_ = media::VideoFrame::ASCII; | 
| 25   bytes_per_row_ = width_ * kBytesPerPixel; | 25   bytes_per_row_ = width_ * kBytesPerPixel; | 
| 26 | 26 | 
| 27   // Create memory for the buffers. | 27   // Create memory for the buffers. | 
| 28   int buffer_size = height_ * bytes_per_row_; | 28   int buffer_size = height_ * bytes_per_row_; | 
| 29   for (int i = 0; i < kNumBuffers; i++) { | 29   for (int i = 0; i < kNumBuffers; i++) { | 
| 30     buffers_[i].reset(new uint8[buffer_size]); | 30     buffers_[i].reset(new uint8[buffer_size]); | 
| 31   } | 31   } | 
| 32 } | 32 } | 
| 33 | 33 | 
| 34 void CapturerFakeAscii::CalculateInvalidRects() { | 34 void CapturerFakeAscii::CalculateInvalidRects() { | 
| (...skipping 23 matching lines...) Expand all  Loading... | 
| 58       if (y == 0 || x == 0 || x == (width_ - 1) || y == (height_ - 1)) { | 58       if (y == 0 || x == 0 || x == (width_ - 1) || y == (height_ - 1)) { | 
| 59         row[x] = '*'; | 59         row[x] = '*'; | 
| 60       } else { | 60       } else { | 
| 61         row[x] = ' '; | 61         row[x] = ' '; | 
| 62       } | 62       } | 
| 63     } | 63     } | 
| 64   } | 64   } | 
| 65 } | 65 } | 
| 66 | 66 | 
| 67 }  // namespace remoting | 67 }  // namespace remoting | 
| OLD | NEW | 
|---|