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

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

Issue 19775006: Implement crop rect for SkImageFilter (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Fix comments Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkColorFilterImageFilter.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 /* 2 /*
3 * Copyright 2006 The Android Open Source Project 3 * Copyright 2006 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkBlurMask.h" 10 #include "SkBlurMask.h"
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
405 405
406 SkScalar xformedRadius = this->computeXformedRadius(context->getMatrix()); 406 SkScalar xformedRadius = this->computeXformedRadius(context->getMatrix());
407 SkASSERT(xformedRadius > 0); 407 SkASSERT(xformedRadius > 0);
408 408
409 float sigma = SkScalarToFloat(xformedRadius) * kBLUR_SIGMA_SCALE; 409 float sigma = SkScalarToFloat(xformedRadius) * kBLUR_SIGMA_SCALE;
410 410
411 // If we're doing a normal blur, we can clobber the pathTexture in the 411 // If we're doing a normal blur, we can clobber the pathTexture in the
412 // gaussianBlur. Otherwise, we need to save it for later compositing. 412 // gaussianBlur. Otherwise, we need to save it for later compositing.
413 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle); 413 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle);
414 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver writeSrc, 414 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver writeSrc,
415 clipRect, sigma, sigma); 415 clipRect, false, sigma, sigma);
416 if (NULL == *result) { 416 if (NULL == *result) {
417 return false; 417 return false;
418 } 418 }
419 419
420 if (!isNormalBlur) { 420 if (!isNormalBlur) {
421 context->setIdentityMatrix(); 421 context->setIdentityMatrix();
422 GrPaint paint; 422 GrPaint paint;
423 SkMatrix matrix; 423 SkMatrix matrix;
424 matrix.setIDiv(src->width(), src->height()); 424 matrix.setIDiv(src->width(), src->height());
425 // Blend pathTexture over blurTexture. 425 // Blend pathTexture over blurTexture.
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
471 } else { 471 } else {
472 str->append("None"); 472 str->append("None");
473 } 473 }
474 str->append("))"); 474 str->append("))");
475 } 475 }
476 #endif 476 #endif
477 477
478 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 478 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
479 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 479 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
480 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 480 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkColorFilterImageFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698