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 "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
12 #include "webrtc/modules/desktop_capture/differ_block.h" | 12 #include "webrtc/modules/desktop_capture/differ_block.h" |
13 #include "webrtc/system_wrappers/interface/ref_count.h" | 13 #include "webrtc/system_wrappers/include/ref_count.h" |
14 | 14 |
15 namespace webrtc { | 15 namespace webrtc { |
16 | 16 |
17 // Run 900 times to mimic 1280x720. | 17 // Run 900 times to mimic 1280x720. |
18 // TODO(fbarchard): Remove benchmark once performance is non-issue. | 18 // TODO(fbarchard): Remove benchmark once performance is non-issue. |
19 static const int kTimesToRun = 900; | 19 static const int kTimesToRun = 900; |
20 | 20 |
21 static void GenerateData(uint8_t* data, int size) { | 21 static void GenerateData(uint8_t* data, int size) { |
22 for (int i = 0; i < size; ++i) { | 22 for (int i = 0; i < size; ++i) { |
23 data[i] = i; | 23 data[i] = i; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 PrepareBuffers(block1, block2); | 78 PrepareBuffers(block1, block2); |
79 block2[0] += 1; | 79 block2[0] += 1; |
80 | 80 |
81 for (int i = 0; i < kTimesToRun; ++i) { | 81 for (int i = 0; i < kTimesToRun; ++i) { |
82 int result = BlockDifference(block1, block2, kBlockSize * kBytesPerPixel); | 82 int result = BlockDifference(block1, block2, kBlockSize * kBytesPerPixel); |
83 EXPECT_EQ(1, result); | 83 EXPECT_EQ(1, result); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 } // namespace webrtc | 87 } // namespace webrtc |
OLD | NEW |