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 20 matching lines...) Expand all Loading... |
31 box_speed_y_(kSpeed) { | 31 box_speed_y_(kSpeed) { |
32 ScreenConfigurationChanged(); | 32 ScreenConfigurationChanged(); |
33 } | 33 } |
34 | 34 |
35 CapturerFake::~CapturerFake() { | 35 CapturerFake::~CapturerFake() { |
36 } | 36 } |
37 | 37 |
38 void CapturerFake::ScreenConfigurationChanged() { | 38 void CapturerFake::ScreenConfigurationChanged() { |
39 width_ = kWidth; | 39 width_ = kWidth; |
40 height_ = kHeight; | 40 height_ = kHeight; |
41 pixel_format_ = PIXEL_FORMAT_RGB32; | 41 pixel_format_ = media::VideoFrame::RGB32; |
42 bytes_per_row_ = width_ * kBytesPerPixel; | 42 bytes_per_row_ = width_ * kBytesPerPixel; |
43 | 43 |
44 // Create memory for the buffers. | 44 // Create memory for the buffers. |
45 int buffer_size = height_ * bytes_per_row_; | 45 int buffer_size = height_ * bytes_per_row_; |
46 for (int i = 0; i < kNumBuffers; i++) { | 46 for (int i = 0; i < kNumBuffers; i++) { |
47 buffers_[i].reset(new uint8[buffer_size]); | 47 buffers_[i].reset(new uint8[buffer_size]); |
48 } | 48 } |
49 } | 49 } |
50 | 50 |
51 void CapturerFake::CalculateInvalidRects() { | 51 void CapturerFake::CalculateInvalidRects() { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 row[x * kBytesPerPixel] = r; | 94 row[x * kBytesPerPixel] = r; |
95 row[x * kBytesPerPixel+1] = g; | 95 row[x * kBytesPerPixel+1] = g; |
96 row[x * kBytesPerPixel+2] = b; | 96 row[x * kBytesPerPixel+2] = b; |
97 row[x * kBytesPerPixel+3] = 0xff; | 97 row[x * kBytesPerPixel+3] = 0xff; |
98 } | 98 } |
99 row += bytes_per_row_; | 99 row += bytes_per_row_; |
100 } | 100 } |
101 } | 101 } |
102 | 102 |
103 } // namespace remoting | 103 } // namespace remoting |
OLD | NEW |