| 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 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 250 bounds.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))), | 250 bounds.outset(SkScalarCeilToInt(SkScalarMul(sigma.x(), SkIntToScalar(3))), |
| 251 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3)))); | 251 SkScalarCeilToInt(SkScalarMul(sigma.y(), SkIntToScalar(3)))); |
| 252 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { | 252 if (getInput(0) && !getInput(0)->filterBounds(bounds, ctm, &bounds)) { |
| 253 return false; | 253 return false; |
| 254 } | 254 } |
| 255 *dst = bounds; | 255 *dst = bounds; |
| 256 return true; | 256 return true; |
| 257 } | 257 } |
| 258 | 258 |
| 259 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 259 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 260 SkBitmap* result, SkIPoint* offset) const
{ | 260 const GrClip&, SkBitmap* result, |
| 261 SkIPoint* offset) const { |
| 261 #if SK_SUPPORT_GPU | 262 #if SK_SUPPORT_GPU |
| 262 SkBitmap input = src; | 263 SkBitmap input = src; |
| 263 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 264 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
| 264 if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &input,
&srcOffset)) { | 265 if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &input,
&srcOffset)) { |
| 265 return false; | 266 return false; |
| 266 } | 267 } |
| 267 SkIRect rect; | 268 SkIRect rect; |
| 268 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) { | 269 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) { |
| 269 return false; | 270 return false; |
| 270 } | 271 } |
| (...skipping 22 matching lines...) Expand all Loading... |
| 293 str->appendf("SkBlurImageFilter: ("); | 294 str->appendf("SkBlurImageFilter: ("); |
| 294 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); | 295 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); |
| 295 | 296 |
| 296 if (this->getInput(0)) { | 297 if (this->getInput(0)) { |
| 297 this->getInput(0)->toString(str); | 298 this->getInput(0)->toString(str); |
| 298 } | 299 } |
| 299 | 300 |
| 300 str->append("))"); | 301 str->append("))"); |
| 301 } | 302 } |
| 302 #endif | 303 #endif |
| OLD | NEW |