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

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

Issue 2154753003: Introduce GrColorSpaceXform, for gamut conversion on textures (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: More progress & refactoring Created 4 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
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/effects/SkGpuBlurUtils.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 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 1242 matching lines...) Expand 10 before | Expand all | Expand 10 after
1253 xformedSigma, xformedSigma)); 1253 xformedSigma, xformedSigma));
1254 if (!drawContext) { 1254 if (!drawContext) {
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.
1263 paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(src, matr ix)); 1263 paint.addCoverageFragmentProcessor(GrSimpleTextureEffect::Make(src, null ptr, matrix));
1264 if (kInner_SkBlurStyle == fBlurStyle) { 1264 if (kInner_SkBlurStyle == fBlurStyle) {
1265 // inner: dst = dst * src 1265 // inner: dst = dst * src
1266 paint.setCoverageSetOpXPFactory(SkRegion::kIntersect_Op); 1266 paint.setCoverageSetOpXPFactory(SkRegion::kIntersect_Op);
1267 } else if (kSolid_SkBlurStyle == fBlurStyle) { 1267 } else if (kSolid_SkBlurStyle == fBlurStyle) {
1268 // solid: dst = src + dst - src * dst 1268 // solid: dst = src + dst - src * dst
1269 // = src + (1 - src) * dst 1269 // = src + (1 - src) * dst
1270 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op); 1270 paint.setCoverageSetOpXPFactory(SkRegion::kUnion_Op);
1271 } else if (kOuter_SkBlurStyle == fBlurStyle) { 1271 } else if (kOuter_SkBlurStyle == fBlurStyle) {
1272 // outer: dst = dst * (1 - src) 1272 // outer: dst = dst * (1 - src)
1273 // = 0 * src + (1 - src) * dst 1273 // = 0 * src + (1 - src) * dst
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1311 } else { 1311 } else {
1312 str->append("None"); 1312 str->append("None");
1313 } 1313 }
1314 str->append("))"); 1314 str->append("))");
1315 } 1315 }
1316 #endif 1316 #endif
1317 1317
1318 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter) 1318 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_START(SkBlurMaskFilter)
1319 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl) 1319 SK_DEFINE_FLATTENABLE_REGISTRAR_ENTRY(SkBlurMaskFilterImpl)
1320 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END 1320 SK_DEFINE_FLATTENABLE_REGISTRAR_GROUP_END
OLDNEW
« no previous file with comments | « src/core/SkBitmapProcShader.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698