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