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

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

Issue 18656002: Fix for r9888 bug (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 | « no previous file | no next file » | 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 SkScalar xformedRadius = this->computeXformedRadius(context->getMatrix()); 405 SkScalar xformedRadius = this->computeXformedRadius(context->getMatrix());
406 SkASSERT(xformedRadius > 0); 406 SkASSERT(xformedRadius > 0);
407 407
408 float sigma = SkScalarToFloat(xformedRadius) * kBLUR_SIGMA_SCALE; 408 float sigma = SkScalarToFloat(xformedRadius) * kBLUR_SIGMA_SCALE;
409 409
410 // If we're doing a normal blur, we can clobber the pathTexture in the 410 // If we're doing a normal blur, we can clobber the pathTexture in the
411 // gaussianBlur. Otherwise, we need to save it for later compositing. 411 // gaussianBlur. Otherwise, we need to save it for later compositing.
412 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle); 412 bool isNormalBlur = (SkBlurMaskFilter::kNormal_BlurStyle == fBlurStyle);
413 *result = context->gaussianBlur(src, isNormalBlur && canOverwriteSrc, 413 *result = context->gaussianBlur(src, isNormalBlur && canOverwriteSrc,
414 clipRect, sigma, sigma); 414 clipRect, sigma, sigma);
415 if (NULL == result) { 415 if (NULL == *result) {
416 return false; 416 return false;
417 } 417 }
418 418
419 if (!isNormalBlur) { 419 if (!isNormalBlur) {
420 context->setIdentityMatrix(); 420 context->setIdentityMatrix();
421 GrPaint paint; 421 GrPaint paint;
422 SkMatrix matrix; 422 SkMatrix matrix;
423 matrix.setIDiv(src->width(), src->height()); 423 matrix.setIDiv(src->width(), src->height());
424 // Blend pathTexture over blurTexture. 424 // Blend pathTexture over blurTexture.
425 GrContext::AutoRenderTarget art(context, (*result)->asRenderTarget()); 425 GrContext::AutoRenderTarget art(context, (*result)->asRenderTarget());
(...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 | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698