| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 } | 187 } |
| 188 *dst = bounds; | 188 *dst = bounds; |
| 189 return true; | 189 return true; |
| 190 } | 190 } |
| 191 | 191 |
| 192 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, | 192 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, const
Context& ctx, |
| 193 SkBitmap* result, SkIPoint* offset) const
{ | 193 SkBitmap* result, SkIPoint* offset) const
{ |
| 194 #if SK_SUPPORT_GPU | 194 #if SK_SUPPORT_GPU |
| 195 SkBitmap input = src; | 195 SkBitmap input = src; |
| 196 SkIPoint srcOffset = SkIPoint::Make(0, 0); | 196 SkIPoint srcOffset = SkIPoint::Make(0, 0); |
| 197 if (this->getInput(0) && | 197 if (!this->filterInputGPU(0, proxy, src, ctx, &input, &srcOffset)) { |
| 198 !this->getInput(0)->getInputResultGPU(proxy, src, ctx, &input, &srcOffse
t)) { | |
| 199 return false; | 198 return false; |
| 200 } | 199 } |
| 201 SkIRect rect; | 200 SkIRect rect; |
| 202 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) { | 201 if (!this->applyCropRect(ctx, proxy, input, &srcOffset, &rect, &input)) { |
| 203 return false; | 202 return false; |
| 204 } | 203 } |
| 205 GrTexture* source = input.getTexture(); | 204 GrTexture* source = input.getTexture(); |
| 206 SkVector sigma = mapSigma(fSigma, ctx.ctm()); | 205 SkVector sigma = mapSigma(fSigma, ctx.ctm()); |
| 207 offset->fX = rect.fLeft; | 206 offset->fX = rect.fLeft; |
| 208 offset->fY = rect.fTop; | 207 offset->fY = rect.fTop; |
| (...skipping 21 matching lines...) Expand all Loading... |
| 230 str->appendf("SkBlurImageFilter: ("); | 229 str->appendf("SkBlurImageFilter: ("); |
| 231 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); | 230 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); |
| 232 | 231 |
| 233 if (this->getInput(0)) { | 232 if (this->getInput(0)) { |
| 234 this->getInput(0)->toString(str); | 233 this->getInput(0)->toString(str); |
| 235 } | 234 } |
| 236 | 235 |
| 237 str->append("))"); | 236 str->append("))"); |
| 238 } | 237 } |
| 239 #endif | 238 #endif |
| OLD | NEW |