| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 } | 90 } |
| 91 if (!inputBounds.intersect(dstBounds)) { | 91 if (!inputBounds.intersect(dstBounds)) { |
| 92 return nullptr; | 92 return nullptr; |
| 93 } | 93 } |
| 94 | 94 |
| 95 const SkVector sigma = map_sigma(fSigma, ctx.ctm()); | 95 const SkVector sigma = map_sigma(fSigma, ctx.ctm()); |
| 96 | 96 |
| 97 #if SK_SUPPORT_GPU | 97 #if SK_SUPPORT_GPU |
| 98 if (source->isTextureBacked()) { | 98 if (source->isTextureBacked()) { |
| 99 GrContext* context = source->getContext(); | 99 GrContext* context = source->getContext(); |
| 100 GrTexture* inputTexture = input->asTextureRef(context); | 100 SkAutoTUnref<GrTexture> inputTexture(input->asTextureRef(context)); |
| 101 SkASSERT(inputTexture); | 101 SkASSERT(inputTexture); |
| 102 | 102 |
| 103 if (0 == sigma.x() && 0 == sigma.y()) { | 103 if (0 == sigma.x() && 0 == sigma.y()) { |
| 104 offset->fX = inputBounds.x(); | 104 offset->fX = inputBounds.x(); |
| 105 offset->fY = inputBounds.y(); | 105 offset->fY = inputBounds.y(); |
| 106 return input->makeSubset(inputBounds.makeOffset(-inputOffset.x(), | 106 return input->makeSubset(inputBounds.makeOffset(-inputOffset.x(), |
| 107 -inputOffset.y())); | 107 -inputOffset.y())); |
| 108 } | 108 } |
| 109 | 109 |
| 110 offset->fX = dstBounds.fLeft; | 110 offset->fX = dstBounds.fLeft; |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 str->appendf("SkBlurImageFilter: ("); | 242 str->appendf("SkBlurImageFilter: ("); |
| 243 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); | 243 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); |
| 244 | 244 |
| 245 if (this->getInput(0)) { | 245 if (this->getInput(0)) { |
| 246 this->getInput(0)->toString(str); | 246 this->getInput(0)->toString(str); |
| 247 } | 247 } |
| 248 | 248 |
| 249 str->append("))"); | 249 str->append("))"); |
| 250 } | 250 } |
| 251 #endif | 251 #endif |
| OLD | NEW |