| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2011 The Android Open Source Project | 2 * Copyright 2011 The Android Open Source Project |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "SkBitmap.h" | 8 #include "SkBitmap.h" |
| 9 #include "SkBlurImageFilter.h" | 9 #include "SkBlurImageFilter.h" |
| 10 #include "SkColorPriv.h" | 10 #include "SkColorPriv.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 sumB -= SkGetPackedB32(l); | 137 sumB -= SkGetPackedB32(l); |
| 138 } | 138 } |
| 139 if (y + bottomOffset + 1 < height) { | 139 if (y + bottomOffset + 1 < height) { |
| 140 SkColor r = *(sptr + (bottomOffset + 1) * srcStride); | 140 SkColor r = *(sptr + (bottomOffset + 1) * srcStride); |
| 141 sumA += SkGetPackedA32(r); | 141 sumA += SkGetPackedA32(r); |
| 142 sumR += SkGetPackedR32(r); | 142 sumR += SkGetPackedR32(r); |
| 143 sumG += SkGetPackedG32(r); | 143 sumG += SkGetPackedG32(r); |
| 144 sumB += SkGetPackedB32(r); | 144 sumB += SkGetPackedB32(r); |
| 145 } | 145 } |
| 146 sptr += srcStride; | 146 sptr += srcStride; |
| 147 // The next leading pixel seems to be too hard to predict. Hint the
fetch. |
| 148 SK_PREFETCH(sptr + (bottomOffset + 1) * srcStride); |
| 147 dptr += dstStride; | 149 dptr += dstStride; |
| 148 } | 150 } |
| 149 } | 151 } |
| 150 } | 152 } |
| 151 | 153 |
| 152 static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo
wOffset, | 154 static void getBox3Params(SkScalar s, int *kernelSize, int* kernelSize3, int *lo
wOffset, |
| 153 int *highOffset) | 155 int *highOffset) |
| 154 { | 156 { |
| 155 float pi = SkScalarToFloat(SK_ScalarPI); | 157 float pi = SkScalarToFloat(SK_ScalarPI); |
| 156 int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * pi)
/ 4.0f + 0.5f)); | 158 int d = static_cast<int>(floorf(SkScalarToFloat(s) * 3.0f * sqrtf(2.0f * pi)
/ 4.0f + 0.5f)); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 fSigma.width(), | 255 fSigma.width(), |
| 254 fSigma.height())); | 256 fSigma.height())); |
| 255 offset->fX += rect.fLeft; | 257 offset->fX += rect.fLeft; |
| 256 offset->fY += rect.fTop; | 258 offset->fY += rect.fTop; |
| 257 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res
ult); | 259 return SkImageFilterUtils::WrapTexture(tex, rect.width(), rect.height(), res
ult); |
| 258 #else | 260 #else |
| 259 SkDEBUGFAIL("Should not call in GPU-less build"); | 261 SkDEBUGFAIL("Should not call in GPU-less build"); |
| 260 return false; | 262 return false; |
| 261 #endif | 263 #endif |
| 262 } | 264 } |
| OLD | NEW |