| 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 "SkBlurImageFilter.h" | 8 #include "SkBlurImageFilter.h" |
| 9 | 9 |
| 10 #include "SkAutoPixmapStorage.h" | 10 #include "SkAutoPixmapStorage.h" |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 } | 117 } |
| 118 | 118 |
| 119 offset->fX = dstBounds.fLeft; | 119 offset->fX = dstBounds.fLeft; |
| 120 offset->fY = dstBounds.fTop; | 120 offset->fY = dstBounds.fTop; |
| 121 inputBounds.offset(-inputOffset); | 121 inputBounds.offset(-inputOffset); |
| 122 dstBounds.offset(-inputOffset); | 122 dstBounds.offset(-inputOffset); |
| 123 sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur( | 123 sk_sp<GrDrawContext> drawContext(SkGpuBlurUtils::GaussianBlur( |
| 124 context, | 124 context, |
| 125 inputTexture.get
(), | 125 inputTexture.get
(), |
| 126 sk_ref_sp(source
->getColorSpace()), | 126 sk_ref_sp(source
->getColorSpace()), |
| 127 source->props().
isGammaCorrect(), | |
| 128 dstBounds, | 127 dstBounds, |
| 129 &inputBounds, | 128 &inputBounds, |
| 130 sigma.x(), | 129 sigma.x(), |
| 131 sigma.y())); | 130 sigma.y())); |
| 132 if (!drawContext) { | 131 if (!drawContext) { |
| 133 return nullptr; | 132 return nullptr; |
| 134 } | 133 } |
| 135 | 134 |
| 136 // TODO: Get the colorSpace from the drawContext (once it has one) | 135 // TODO: Get the colorSpace from the drawContext (once it has one) |
| 137 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(dstBounds.width(), ds
tBounds.height()), | 136 return SkSpecialImage::MakeFromGpu(SkIRect::MakeWH(dstBounds.width(), ds
tBounds.height()), |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 str->appendf("SkBlurImageFilter: ("); | 250 str->appendf("SkBlurImageFilter: ("); |
| 252 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); | 251 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); |
| 253 | 252 |
| 254 if (this->getInput(0)) { | 253 if (this->getInput(0)) { |
| 255 this->getInput(0)->toString(str); | 254 this->getInput(0)->toString(str); |
| 256 } | 255 } |
| 257 | 256 |
| 258 str->append("))"); | 257 str->append("))"); |
| 259 } | 258 } |
| 260 #endif | 259 #endif |
| OLD | NEW |