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 "SkMath.h" | 6 #include "SkMath.h" |
7 #include "SkSize.h" | 7 #include "SkSize.h" |
8 #include "SkTypes.h" | 8 #include "SkTypes.h" |
9 | 9 |
10 namespace { | 10 namespace { |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 if (hasAlpha) { | 156 if (hasAlpha) { |
157 outRow[outX * 4 + 3] = ClampTo8(accum[3]); | 157 outRow[outX * 4 + 3] = ClampTo8(accum[3]); |
158 } | 158 } |
159 } | 159 } |
160 } | 160 } |
161 | 161 |
162 // There's a bug somewhere here with GCC autovectorization (-ftree-vectorize
). We originally | 162 // There's a bug somewhere here with GCC autovectorization (-ftree-vectorize
). We originally |
163 // thought this was 32 bit only, but subsequent tests show that some 64 bit
gcc compiles | 163 // thought this was 32 bit only, but subsequent tests show that some 64 bit
gcc compiles |
164 // suffer here too. | 164 // suffer here too. |
165 // | 165 // |
166 // Dropping to -O2 disables -ftree-vectorize. GCC 4.6 needs noinline. http
://skbug.com/2575 | 166 // Dropping to -O2 disables -ftree-vectorize. GCC 4.6 needs noinline. http
s://bug.skia.org/2575 |
167 #if SK_HAS_ATTRIBUTE(optimize) && defined(SK_RELEASE) | 167 #if SK_HAS_ATTRIBUTE(optimize) && defined(SK_RELEASE) |
168 #define SK_MAYBE_DISABLE_VECTORIZATION __attribute__((optimize("O2"), no
inline)) | 168 #define SK_MAYBE_DISABLE_VECTORIZATION __attribute__((optimize("O2"), no
inline)) |
169 #else | 169 #else |
170 #define SK_MAYBE_DISABLE_VECTORIZATION | 170 #define SK_MAYBE_DISABLE_VECTORIZATION |
171 #endif | 171 #endif |
172 | 172 |
173 SK_MAYBE_DISABLE_VECTORIZATION | 173 SK_MAYBE_DISABLE_VECTORIZATION |
174 static void ConvolveHorizontallyAlpha(const unsigned char* srcData, | 174 static void ConvolveHorizontallyAlpha(const unsigned char* srcData, |
175 const SkConvolutionFilter1D& filter, | 175 const SkConvolutionFilter1D& filter, |
176 unsigned char* outRow) { | 176 unsigned char* outRow) { |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 sourceHasAlpha); | 496 sourceHasAlpha); |
497 } else { | 497 } else { |
498 ConvolveVertically(filterValues, filterLength, | 498 ConvolveVertically(filterValues, filterLength, |
499 firstRowForFilter, | 499 firstRowForFilter, |
500 filterX.numValues(), curOutputRow, | 500 filterX.numValues(), curOutputRow, |
501 sourceHasAlpha); | 501 sourceHasAlpha); |
502 } | 502 } |
503 } | 503 } |
504 return true; | 504 return true; |
505 } | 505 } |
OLD | NEW |