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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 } | 191 } |
192 return true; | 192 return true; |
193 } | 193 } |
194 | 194 |
195 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitm
ap* result) { | 195 bool SkBlurImageFilter::filterImageGPU(Proxy* proxy, const SkBitmap& src, SkBitm
ap* result) { |
196 #if SK_SUPPORT_GPU | 196 #if SK_SUPPORT_GPU |
197 SkBitmap input; | 197 SkBitmap input; |
198 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &input))
{ | 198 if (!SkImageFilterUtils::GetInputResultGPU(getInput(0), proxy, src, &input))
{ |
199 return false; | 199 return false; |
200 } | 200 } |
201 GrTexture* source = (GrTexture*) input.getTexture(); | 201 GrTexture* source = input.getTexture(); |
202 SkRect rect; | 202 SkRect rect; |
203 src.getBounds(&rect); | 203 src.getBounds(&rect); |
204 SkAutoTUnref<GrTexture> tex(source->getContext()->gaussianBlur(source, false
, rect, | 204 SkAutoTUnref<GrTexture> tex(source->getContext()->gaussianBlur(source, false
, rect, |
205 fSigma.width(), fSigma.height())); | 205 fSigma.width(), fSigma.height())); |
206 return SkImageFilterUtils::WrapTexture(tex, src.width(), src.height(), resul
t); | 206 return SkImageFilterUtils::WrapTexture(tex, src.width(), src.height(), resul
t); |
207 #else | 207 #else |
208 SkDEBUGFAIL("Should not call in GPU-less build"); | 208 SkDEBUGFAIL("Should not call in GPU-less build"); |
209 return false; | 209 return false; |
210 #endif | 210 #endif |
211 } | 211 } |
OLD | NEW |