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

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

Issue 1961953002: Reland of Simplify SkGpuBlurUtils::GaussianBlur method (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 7 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/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkGpuBlurUtils.h » ('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 2006 The Android Open Source Project 2 * Copyright 2006 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 "SkBlurMaskFilter.h" 8 #include "SkBlurMaskFilter.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkGpuBlurUtils.h" 10 #include "SkGpuBlurUtils.h"
(...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after
1242 1242
1243 GrContext* context = src->getContext(); 1243 GrContext* context = src->getContext();
1244 1244
1245 SkScalar xformedSigma = this->computeXformedSigma(ctm); 1245 SkScalar xformedSigma = this->computeXformedSigma(ctm);
1246 SkASSERT(xformedSigma > 0); 1246 SkASSERT(xformedSigma > 0);
1247 1247
1248 // If we're doing a normal blur, we can clobber the pathTexture in the 1248 // If we're doing a normal blur, we can clobber the pathTexture in the
1249 // gaussianBlur. Otherwise, we need to save it for later compositing. 1249 // gaussianBlur. Otherwise, we need to save it for later compositing.
1250 bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle); 1250 bool isNormalBlur = (kNormal_SkBlurStyle == fBlurStyle);
1251 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver writeSrc, 1251 *result = SkGpuBlurUtils::GaussianBlur(context, src, isNormalBlur && canOver writeSrc,
1252 false, clipRect, nullptr, 1252 clipRect, nullptr,
1253 xformedSigma, xformedSigma); 1253 xformedSigma, xformedSigma);
1254 if (nullptr == *result) { 1254 if (nullptr == *result) {
1255 return false; 1255 return false;
1256 } 1256 }
1257 1257
1258 if (!isNormalBlur) { 1258 if (!isNormalBlur) {
1259 GrPaint paint; 1259 GrPaint paint;
1260 SkMatrix matrix; 1260 SkMatrix matrix;
1261 matrix.setIDiv(src->width(), src->height()); 1261 matrix.setIDiv(src->width(), src->height());
1262 // Blend pathTexture over blurTexture. 1262 // Blend pathTexture over blurTexture.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
1316 } else { 1316 } else {
1317 str->append("None"); 1317 str->append("None");
1318 } 1318 }
1319 str->append("))"); 1319 str->append("))");
1320 } 1320 }
1321 #endif 1321 #endif
1322 1322
1323 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1323 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1324 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1324 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1325 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1325 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/effects/SkBlurImageFilter.cpp ('k') | src/effects/SkGpuBlurUtils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698