OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
| 11 #include "webrtc/modules/desktop_capture/differ_block.h" |
11 #include "webrtc/test/gmock.h" | 12 #include "webrtc/test/gmock.h" |
12 #include "webrtc/modules/desktop_capture/differ_block.h" | |
13 | 13 |
14 namespace webrtc { | 14 namespace webrtc { |
15 | 15 |
16 // Run 900 times to mimic 1280x720. | 16 // Run 900 times to mimic 1280x720. |
17 // TODO(fbarchard): Remove benchmark once performance is non-issue. | 17 // TODO(fbarchard): Remove benchmark once performance is non-issue. |
18 static const int kTimesToRun = 900; | 18 static const int kTimesToRun = 900; |
19 | 19 |
20 static void GenerateData(uint8_t* data, int size) { | 20 static void GenerateData(uint8_t* data, int size) { |
21 for (int i = 0; i < size; ++i) { | 21 for (int i = 0; i < size; ++i) { |
22 data[i] = i; | 22 data[i] = i; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 PrepareBuffers(block1, block2); | 77 PrepareBuffers(block1, block2); |
78 block2[0] += 1; | 78 block2[0] += 1; |
79 | 79 |
80 for (int i = 0; i < kTimesToRun; ++i) { | 80 for (int i = 0; i < kTimesToRun; ++i) { |
81 int result = BlockDifference(block1, block2, kBlockSize * kBytesPerPixel); | 81 int result = BlockDifference(block1, block2, kBlockSize * kBytesPerPixel); |
82 EXPECT_EQ(1, result); | 82 EXPECT_EQ(1, result); |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 } // namespace webrtc | 86 } // namespace webrtc |
OLD | NEW |