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 18 matching lines...) Expand all Loading... |
35 | 37 |
36 CapturerFake::~CapturerFake() { | 38 CapturerFake::~CapturerFake() { |
37 } | 39 } |
38 | 40 |
39 void CapturerFake::Start() { | 41 void CapturerFake::Start() { |
40 } | 42 } |
41 | 43 |
42 void CapturerFake::Stop() { | 44 void CapturerFake::Stop() { |
43 } | 45 } |
44 | 46 |
| 47 void CapturerFake::SetCursorShapeChangedCallback( |
| 48 const CursorShapeChangedCallback& callback) { |
| 49 } |
| 50 |
45 void CapturerFake::ScreenConfigurationChanged() { | 51 void CapturerFake::ScreenConfigurationChanged() { |
46 size_ = SkISize::Make(kWidth, kHeight); | 52 size_ = SkISize::Make(kWidth, kHeight); |
47 bytes_per_row_ = size_.width() * kBytesPerPixel; | 53 bytes_per_row_ = size_.width() * kBytesPerPixel; |
48 pixel_format_ = media::VideoFrame::RGB32; | 54 pixel_format_ = media::VideoFrame::RGB32; |
49 | 55 |
50 // Create memory for the buffers. | 56 // Create memory for the buffers. |
51 int buffer_size = size_.height() * bytes_per_row_; | 57 int buffer_size = size_.height() * bytes_per_row_; |
52 for (int i = 0; i < kNumBuffers; i++) { | 58 for (int i = 0; i < kNumBuffers; i++) { |
53 buffers_[i].reset(new uint8[buffer_size]); | 59 buffers_[i].reset(new uint8[buffer_size]); |
54 } | 60 } |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 row[x * kBytesPerPixel] = r; | 134 row[x * kBytesPerPixel] = r; |
129 row[x * kBytesPerPixel+1] = g; | 135 row[x * kBytesPerPixel+1] = g; |
130 row[x * kBytesPerPixel+2] = b; | 136 row[x * kBytesPerPixel+2] = b; |
131 row[x * kBytesPerPixel+3] = 0xff; | 137 row[x * kBytesPerPixel+3] = 0xff; |
132 } | 138 } |
133 row += bytes_per_row_; | 139 row += bytes_per_row_; |
134 } | 140 } |
135 } | 141 } |
136 | 142 |
137 } // namespace remoting | 143 } // namespace remoting |
OLD | NEW |