OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/differ.h" | 5 #include "remoting/host/differ.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "remoting/host/differ_block.h" | 8 #include "remoting/host/differ_block.h" |
9 | 9 |
10 namespace remoting { | 10 namespace remoting { |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 // If the screen height is not a multiple of the block size, then this | 98 // If the screen height is not a multiple of the block size, then this |
99 // handles the last partial row. This situation is far more common than the | 99 // handles the last partial row. This situation is far more common than the |
100 // 'partial column' case. | 100 // 'partial column' case. |
101 if (partial_row_height != 0) { | 101 if (partial_row_height != 0) { |
102 const uint8* prev_block = prev_block_row_start; | 102 const uint8* prev_block = prev_block_row_start; |
103 const uint8* curr_block = curr_block_row_start; | 103 const uint8* curr_block = curr_block_row_start; |
104 DiffInfo* diff_info = diff_info_row_start; | 104 DiffInfo* diff_info = diff_info_row_start; |
105 for (int x = 0; x < x_full_blocks; x++) { | 105 for (int x = 0; x < x_full_blocks; x++) { |
106 *diff_info = DiffPartialBlock(prev_block, curr_block, | 106 *diff_info = DiffPartialBlock(prev_block, curr_block, |
107 bytes_per_row_, | 107 bytes_per_row_, |
108 kBlockWidth, partial_row_height); | 108 kBlockSize, partial_row_height); |
109 prev_block += block_x_offset; | 109 prev_block += block_x_offset; |
110 curr_block += block_x_offset; | 110 curr_block += block_x_offset; |
111 diff_info += sizeof(DiffInfo); | 111 diff_info += sizeof(DiffInfo); |
112 } | 112 } |
113 if (partial_column_width != 0) { | 113 if (partial_column_width != 0) { |
114 *diff_info = DiffPartialBlock(prev_block, curr_block, bytes_per_row_, | 114 *diff_info = DiffPartialBlock(prev_block, curr_block, bytes_per_row_, |
115 partial_column_width, partial_row_height); | 115 partial_column_width, partial_row_height); |
116 diff_info += sizeof(DiffInfo); | 116 diff_info += sizeof(DiffInfo); |
117 } | 117 } |
118 } | 118 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 // Increment to next block in this row. | 201 // Increment to next block in this row. |
202 diff_info++; | 202 diff_info++; |
203 } | 203 } |
204 | 204 |
205 // Go to start of next row. | 205 // Go to start of next row. |
206 diff_info_row_start += diff_info_stride; | 206 diff_info_row_start += diff_info_stride; |
207 } | 207 } |
208 } | 208 } |
209 | 209 |
210 } // namespace remoting | 210 } // namespace remoting |
OLD | NEW |