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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 | 197 |
198 offset->fX = srcBounds.fLeft; | 198 offset->fX = srcBounds.fLeft; |
199 offset->fY = srcBounds.fTop; | 199 offset->fY = srcBounds.fTop; |
200 srcBounds.offset(-srcOffset); | 200 srcBounds.offset(-srcOffset); |
201 const SkPMColor* s = src.getAddr32(srcBounds.left(), srcBounds.top()); | 201 const SkPMColor* s = src.getAddr32(srcBounds.left(), srcBounds.top()); |
202 SkPMColor* t = temp.getAddr32(0, 0); | 202 SkPMColor* t = temp.getAddr32(0, 0); |
203 SkPMColor* d = dst->getAddr32(0, 0); | 203 SkPMColor* d = dst->getAddr32(0, 0); |
204 int w = dstBounds.width(), h = dstBounds.height(); | 204 int w = dstBounds.width(), h = dstBounds.height(); |
205 int sw = src.rowBytesAsPixels(); | 205 int sw = src.rowBytesAsPixels(); |
206 SkBoxBlurProc boxBlurX, boxBlurY, boxBlurXY, boxBlurYX; | 206 SkBoxBlurProc boxBlurX, boxBlurXY, boxBlurYX; |
207 if (!SkBoxBlurGetPlatformProcs(&boxBlurX, &boxBlurY, &boxBlurXY, &boxBlurYX)
) { | 207 if (!SkBoxBlurGetPlatformProcs(&boxBlurX, &boxBlurXY, &boxBlurYX)) { |
208 boxBlurX = boxBlur<kX, kX>; | 208 boxBlurX = boxBlur<kX, kX>; |
209 boxBlurY = boxBlur<kY, kY>; | |
210 boxBlurXY = boxBlur<kX, kY>; | 209 boxBlurXY = boxBlur<kX, kY>; |
211 boxBlurYX = boxBlur<kY, kX>; | 210 boxBlurYX = boxBlur<kY, kX>; |
212 } | 211 } |
213 | 212 |
214 if (kernelSizeX > 0 && kernelSizeY > 0) { | 213 if (kernelSizeX > 0 && kernelSizeY > 0) { |
215 boxBlurX(s, sw, t, kernelSizeX, lowOffsetX, highOffsetX, w, h); | 214 boxBlurX(s, sw, t, kernelSizeX, lowOffsetX, highOffsetX, w, h); |
216 boxBlurX(t, w, d, kernelSizeX, highOffsetX, lowOffsetX, w, h); | 215 boxBlurX(t, w, d, kernelSizeX, highOffsetX, lowOffsetX, w, h); |
217 boxBlurXY(d, w, t, kernelSizeX3, highOffsetX, highOffsetX, w, h); | 216 boxBlurXY(d, w, t, kernelSizeX3, highOffsetX, highOffsetX, w, h); |
218 boxBlurX(t, h, d, kernelSizeY, lowOffsetY, highOffsetY, h, w); | 217 boxBlurX(t, h, d, kernelSizeY, lowOffsetY, highOffsetY, h, w); |
219 boxBlurX(d, h, t, kernelSizeY, highOffsetY, lowOffsetY, h, w); | 218 boxBlurX(d, h, t, kernelSizeY, highOffsetY, lowOffsetY, h, w); |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 str->appendf("SkBlurImageFilter: ("); | 294 str->appendf("SkBlurImageFilter: ("); |
296 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); | 295 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); |
297 | 296 |
298 if (this->getInput(0)) { | 297 if (this->getInput(0)) { |
299 this->getInput(0)->toString(str); | 298 this->getInput(0)->toString(str); |
300 } | 299 } |
301 | 300 |
302 str->append("))"); | 301 str->append("))"); |
303 } | 302 } |
304 #endif | 303 #endif |
OLD | NEW |