| 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 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 *filterOffset = filter.fOffset; | 323 *filterOffset = filter.fOffset; |
| 324 *filterLength = filter.fTrimmedLength; | 324 *filterLength = filter.fTrimmedLength; |
| 325 *specifiedFilterlength = filter.fLength; | 325 *specifiedFilterlength = filter.fLength; |
| 326 if (filter.fTrimmedLength == 0) { | 326 if (filter.fTrimmedLength == 0) { |
| 327 return NULL; | 327 return NULL; |
| 328 } | 328 } |
| 329 | 329 |
| 330 return &fFilterValues[filter.fDataLocation]; | 330 return &fFilterValues[filter.fDataLocation]; |
| 331 } | 331 } |
| 332 | 332 |
| 333 // There's a bug somewhere in here with GCC autovectorization (-ftree-vectorize)
on 32 bit builds. |
| 334 // Dropping to -O2 disables -ftree-vectorize. http://skbug.com/2575 |
| 335 #if defined(__i386) && SK_HAS_ATTRIBUTE(optimize) |
| 336 __attribute__((optimize("O2"))) |
| 337 #endif |
| 333 void BGRAConvolve2D(const unsigned char* sourceData, | 338 void BGRAConvolve2D(const unsigned char* sourceData, |
| 334 int sourceByteRowStride, | 339 int sourceByteRowStride, |
| 335 bool sourceHasAlpha, | 340 bool sourceHasAlpha, |
| 336 const SkConvolutionFilter1D& filterX, | 341 const SkConvolutionFilter1D& filterX, |
| 337 const SkConvolutionFilter1D& filterY, | 342 const SkConvolutionFilter1D& filterY, |
| 338 int outputByteRowStride, | 343 int outputByteRowStride, |
| 339 unsigned char* output, | 344 unsigned char* output, |
| 340 const SkConvolutionProcs& convolveProcs, | 345 const SkConvolutionProcs& convolveProcs, |
| 341 bool useSimdIfPossible) { | 346 bool useSimdIfPossible) { |
| 342 | 347 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 452 filterX.numValues(), curOutputRow
, | 457 filterX.numValues(), curOutputRow
, |
| 453 sourceHasAlpha); | 458 sourceHasAlpha); |
| 454 } else { | 459 } else { |
| 455 ConvolveVertically(filterValues, filterLength, | 460 ConvolveVertically(filterValues, filterLength, |
| 456 firstRowForFilter, | 461 firstRowForFilter, |
| 457 filterX.numValues(), curOutputRow, | 462 filterX.numValues(), curOutputRow, |
| 458 sourceHasAlpha); | 463 sourceHasAlpha); |
| 459 } | 464 } |
| 460 } | 465 } |
| 461 } | 466 } |
| OLD | NEW |