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

Side by Side Diff: gm/drawlooper.cpp

Issue 1852113003: switch maskfilters to sk_sp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 8 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 | « gm/drawfilter.cpp ('k') | gm/emboss.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 Google Inc. 2 * Copyright 2011 Google Inc.
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 "gm.h" 8 #include "gm.h"
9 #include "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 info.fPaintBits = SkLayerDrawLooper::kStyle_Bit | SkLayerDrawLooper::kMa skFilter_Bit; 75 info.fPaintBits = SkLayerDrawLooper::kStyle_Bit | SkLayerDrawLooper::kMa skFilter_Bit;
76 info.fColorMode = SkXfermode::kSrc_Mode; 76 info.fColorMode = SkXfermode::kSrc_Mode;
77 77
78 for (size_t i = 0; i < SK_ARRAY_COUNT(gParams); i++) { 78 for (size_t i = 0; i < SK_ARRAY_COUNT(gParams); i++) {
79 info.fOffset.set(gParams[i].fOffset, gParams[i].fOffset); 79 info.fOffset.set(gParams[i].fOffset, gParams[i].fOffset);
80 SkPaint* paint = looperBuilder.addLayer(info); 80 SkPaint* paint = looperBuilder.addLayer(info);
81 paint->setColor(gParams[i].fColor); 81 paint->setColor(gParams[i].fColor);
82 paint->setStyle(gParams[i].fStyle); 82 paint->setStyle(gParams[i].fStyle);
83 paint->setStrokeWidth(gParams[i].fWidth); 83 paint->setStrokeWidth(gParams[i].fWidth);
84 if (gParams[i].fBlur > 0) { 84 if (gParams[i].fBlur > 0) {
85 SkMaskFilter* mf = SkBlurMaskFilter::Create(kNormal_SkBlurStyle, 85 paint->setMaskFilter(SkBlurMaskFilter::Make(kNormal_SkBlurStyle,
86 SkBlurMask::ConvertRadiusToSigma(gParam s[i].fBlur)); 86 SkBlurMask::ConvertRadiusToSigma(gParam s[i].fBlur)));
87 paint->setMaskFilter(mf)->unref();
88 } 87 }
89 } 88 }
90 fLooper = looperBuilder.detach(); 89 fLooper = looperBuilder.detach();
91 } 90 }
92 91
93 typedef GM INHERITED; 92 typedef GM INHERITED;
94 }; 93 };
95 94
96 ////////////////////////////////////////////////////////////////////////////// 95 //////////////////////////////////////////////////////////////////////////////
97 96
98 DEF_GM( return new DrawLooperGM; ) 97 DEF_GM( return new DrawLooperGM; )
OLDNEW
« no previous file with comments | « gm/drawfilter.cpp ('k') | gm/emboss.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698