| 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 "SkConvolver.h" | 5 #include "SkConvolver.h" |
| 6 #include "SkSize.h" | 6 #include "SkSize.h" |
| 7 #include "SkTypes.h" | 7 #include "SkTypes.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 while (nextXRow < filterOffset + filterLength) { | 429 while (nextXRow < filterOffset + filterLength) { |
| 430 if (convolveProcs.fConvolve4RowsHorizontally && | 430 if (convolveProcs.fConvolve4RowsHorizontally && |
| 431 nextXRow + 3 < lastFilterOffset + lastFilterLength - | 431 nextXRow + 3 < lastFilterOffset + lastFilterLength - |
| 432 avoidSimdRows) { | 432 avoidSimdRows) { |
| 433 const unsigned char* src[4]; | 433 const unsigned char* src[4]; |
| 434 unsigned char* outRow[4]; | 434 unsigned char* outRow[4]; |
| 435 for (int i = 0; i < 4; ++i) { | 435 for (int i = 0; i < 4; ++i) { |
| 436 src[i] = &sourceData[(uint64_t)(nextXRow + i) * sourceByteRo
wStride]; | 436 src[i] = &sourceData[(uint64_t)(nextXRow + i) * sourceByteRo
wStride]; |
| 437 outRow[i] = rowBuffer.advanceRow(); | 437 outRow[i] = rowBuffer.advanceRow(); |
| 438 } | 438 } |
| 439 convolveProcs.fConvolve4RowsHorizontally(src, filterX, outRow); | 439 convolveProcs.fConvolve4RowsHorizontally(src, filterX, outRow, 4
*rowBufferWidth); |
| 440 nextXRow += 4; | 440 nextXRow += 4; |
| 441 } else { | 441 } else { |
| 442 // Check if we need to avoid SSE2 for this row. | 442 // Check if we need to avoid SSE2 for this row. |
| 443 if (convolveProcs.fConvolveHorizontally && | 443 if (convolveProcs.fConvolveHorizontally && |
| 444 nextXRow < lastFilterOffset + lastFilterLength - | 444 nextXRow < lastFilterOffset + lastFilterLength - |
| 445 avoidSimdRows) { | 445 avoidSimdRows) { |
| 446 convolveProcs.fConvolveHorizontally( | 446 convolveProcs.fConvolveHorizontally( |
| 447 &sourceData[(uint64_t)nextXRow * sourceByteRowStride], | 447 &sourceData[(uint64_t)nextXRow * sourceByteRowStride], |
| 448 filterX, rowBuffer.advanceRow(), sourceHasAlpha); | 448 filterX, rowBuffer.advanceRow(), sourceHasAlpha); |
| 449 } else { | 449 } else { |
| (...skipping 30 matching lines...) Expand all Loading... |
| 480 filterX.numValues(), curOutputRow
, | 480 filterX.numValues(), curOutputRow
, |
| 481 sourceHasAlpha); | 481 sourceHasAlpha); |
| 482 } else { | 482 } else { |
| 483 ConvolveVertically(filterValues, filterLength, | 483 ConvolveVertically(filterValues, filterLength, |
| 484 firstRowForFilter, | 484 firstRowForFilter, |
| 485 filterX.numValues(), curOutputRow, | 485 filterX.numValues(), curOutputRow, |
| 486 sourceHasAlpha); | 486 sourceHasAlpha); |
| 487 } | 487 } |
| 488 } | 488 } |
| 489 } | 489 } |
| OLD | NEW |