Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(512)

Side by Side Diff: src/effects/SkBlurImageFilter.cpp

Issue 1571033002: remove imagefilter::sizeconstraint (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/core/SkLocalMatrixImageFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 if (!srcBounds.intersect(dstBounds)) { 210 if (!srcBounds.intersect(dstBounds)) {
211 return false; 211 return false;
212 } 212 }
213 GrTexture* source = input.getTexture(); 213 GrTexture* source = input.getTexture();
214 SkVector sigma = mapSigma(fSigma, ctx.ctm()); 214 SkVector sigma = mapSigma(fSigma, ctx.ctm());
215 offset->fX = dstBounds.fLeft; 215 offset->fX = dstBounds.fLeft;
216 offset->fY = dstBounds.fTop; 216 offset->fY = dstBounds.fTop;
217 srcBounds.offset(-srcOffset); 217 srcBounds.offset(-srcOffset);
218 dstBounds.offset(-srcOffset); 218 dstBounds.offset(-srcOffset);
219 SkRect srcBoundsF(SkRect::Make(srcBounds)); 219 SkRect srcBoundsF(SkRect::Make(srcBounds));
220 auto constraint = GrTextureProvider::FromImageFilter(ctx.sizeConstraint());
221 SkAutoTUnref<GrTexture> tex(SkGpuBlurUtils::GaussianBlur(source->getContext( ), 220 SkAutoTUnref<GrTexture> tex(SkGpuBlurUtils::GaussianBlur(source->getContext( ),
222 source, 221 source,
223 false, 222 false,
224 SkRect::Make(dstBou nds), 223 SkRect::Make(dstBou nds),
225 &srcBoundsF, 224 &srcBoundsF,
226 sigma.x(), 225 sigma.x(),
227 sigma.y(), 226 sigma.y()));
228 constraint));
229 if (!tex) { 227 if (!tex) {
230 return false; 228 return false;
231 } 229 }
232 WrapTexture(tex, dstBounds.width(), dstBounds.height(), result); 230 WrapTexture(tex, dstBounds.width(), dstBounds.height(), result);
233 return true; 231 return true;
234 #else 232 #else
235 SkDEBUGFAIL("Should not call in GPU-less build"); 233 SkDEBUGFAIL("Should not call in GPU-less build");
236 return false; 234 return false;
237 #endif 235 #endif
238 } 236 }
239 237
240 #ifndef SK_IGNORE_TO_STRING 238 #ifndef SK_IGNORE_TO_STRING
241 void SkBlurImageFilter::toString(SkString* str) const { 239 void SkBlurImageFilter::toString(SkString* str) const {
242 str->appendf("SkBlurImageFilter: ("); 240 str->appendf("SkBlurImageFilter: (");
243 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight); 241 str->appendf("sigma: (%f, %f) input (", fSigma.fWidth, fSigma.fHeight);
244 242
245 if (this->getInput(0)) { 243 if (this->getInput(0)) {
246 this->getInput(0)->toString(str); 244 this->getInput(0)->toString(str);
247 } 245 }
248 246
249 str->append("))"); 247 str->append("))");
250 } 248 }
251 #endif 249 #endif
OLDNEW
« no previous file with comments | « src/core/SkLocalMatrixImageFilter.cpp ('k') | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698