| 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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 } | 252 } |
| 253 *dst = bounds; | 253 *dst = bounds; |
| 254 return true; | 254 return true; |
| 255 } | 255 } |
| 256 | 256 |
| 257 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 257 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 258 SkBitmap* result, SkIPoint* offset) const
{ | 258 SkBitmap* result, SkIPoint* offset) const
{ |
| 259 #if SK_SUPPORT_GPU | 259 #if SK_SUPPORT_GPU |
| 260 SkBitmap input = src; | 260 SkBitmap input = src; |
| 261 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 261 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
| 262 if (getInput(0) && !getInput(0)->getInputResultGPU(proxy, src, ctx, &input,
&srcOffset)) { | 262 if (this->getInput(0) && |
| 263 !this->getInput(0)->getInputResultGPU(proxy, src, ctx, &input, &srcOffse
t)) { |
| 263 return false; | 264 return false; |
| 264 } | 265 } |
| 265 SkIRect rect; | 266 SkIRect rect; |
| 266 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) { | 267 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) { |
| 267 return false; | 268 return false; |
| 268 } | 269 } |
| 269 GrTexture* source = input.getTexture(); | 270 GrTexture* source = input.getTexture(); |
| 270 SkVector sigma = mapSigma(fSigma, ctx.ctm()); | 271 SkVector sigma = mapSigma(fSigma, ctx.ctm()); |
| 271 offset->fX = rect.fLeft; | 272 offset->fX = rect.fLeft; |
| 272 offset->fY = rect.fTop; | 273 offset->fY = rect.fTop; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 294 str->appendf("SkBlurImageFilter: ("); | 295 str->appendf("SkBlurImageFilter: ("); |
| 295 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); | 296 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); |
| 296 | 297 |
| 297 if (this->getInput(0)) { | 298 if (this->getInput(0)) { |
| 298 this->getInput(0)->toString(str); | 299 this->getInput(0)->toString(str); |
| 299 } | 300 } |
| 300 | 301 |
| 301 str->append("))"); | 302 str->append("))"); |
| 302 } | 303 } |
| 303 #endif | 304 #endif |
| OLD | NEW |