| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "remoting/base/capture_data.h" |
| 8 |
| 7 namespace remoting { | 9 namespace remoting { |
| 8 | 10 |
| 9 // CapturerFake generates a white picture of size kWidth x kHeight with a | 11 // CapturerFake generates a white picture of size kWidth x kHeight with a |
| 10 // rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed pixels | 12 // rectangle of size kBoxWidth x kBoxHeight. The rectangle moves kSpeed pixels |
| 11 // per frame along both axes, and bounces off the sides of the screen. | 13 // per frame along both axes, and bounces off the sides of the screen. |
| 12 static const int kWidth = 800; | 14 static const int kWidth = 800; |
| 13 static const int kHeight = 600; | 15 static const int kHeight = 600; |
| 14 static const int kBoxWidth = 140; | 16 static const int kBoxWidth = 140; |
| 15 static const int kBoxHeight = 140; | 17 static const int kBoxHeight = 140; |
| 16 static const int kSpeed = 20; | 18 static const int kSpeed = 20; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 29 box_speed_x_(kSpeed), | 31 box_speed_x_(kSpeed), |
| 30 box_speed_y_(kSpeed), | 32 box_speed_y_(kSpeed), |
| 31 current_buffer_(0), | 33 current_buffer_(0), |
| 32 pixel_format_(media::VideoFrame::RGB32) { | 34 pixel_format_(media::VideoFrame::RGB32) { |
| 33 ScreenConfigurationChanged(); | 35 ScreenConfigurationChanged(); |
| 34 } | 36 } |
| 35 | 37 |
| 36 CapturerFake::~CapturerFake() { | 38 CapturerFake::~CapturerFake() { |
| 37 } | 39 } |
| 38 | 40 |
| 39 void CapturerFake::Start() { | 41 void CapturerFake::Start( |
| 42 const CursorShapeChangedCallback& callback) { |
| 40 } | 43 } |
| 41 | 44 |
| 42 void CapturerFake::Stop() { | 45 void CapturerFake::Stop() { |
| 43 } | 46 } |
| 44 | 47 |
| 45 void CapturerFake::ScreenConfigurationChanged() { | 48 void CapturerFake::ScreenConfigurationChanged() { |
| 46 size_ = SkISize::Make(kWidth, kHeight); | 49 size_ = SkISize::Make(kWidth, kHeight); |
| 47 bytes_per_row_ = size_.width() * kBytesPerPixel; | 50 bytes_per_row_ = size_.width() * kBytesPerPixel; |
| 48 pixel_format_ = media::VideoFrame::RGB32; | 51 pixel_format_ = media::VideoFrame::RGB32; |
| 49 | 52 |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 row[x * kBytesPerPixel] = r; | 131 row[x * kBytesPerPixel] = r; |
| 129 row[x * kBytesPerPixel+1] = g; | 132 row[x * kBytesPerPixel+1] = g; |
| 130 row[x * kBytesPerPixel+2] = b; | 133 row[x * kBytesPerPixel+2] = b; |
| 131 row[x * kBytesPerPixel+3] = 0xff; | 134 row[x * kBytesPerPixel+3] = 0xff; |
| 132 } | 135 } |
| 133 row += bytes_per_row_; | 136 row += bytes_per_row_; |
| 134 } | 137 } |
| 135 } | 138 } |
| 136 | 139 |
| 137 } // namespace remoting | 140 } // namespace remoting |
| OLD | NEW |