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

Side by Side Diff: gm/drawbitmaprect.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/circles.cpp ('k') | gm/drawfilter.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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 // test the following code path: 204 // test the following code path:
205 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter() 205 // SkGpuDevice::drawPath() -> SkGpuDevice::drawWithMaskFilter()
206 SkIRect srcRect; 206 SkIRect srcRect;
207 SkPaint paint; 207 SkPaint paint;
208 SkBitmap bm; 208 SkBitmap bm;
209 209
210 bm = make_chessbm(5, 5); 210 bm = make_chessbm(5, 5);
211 paint.setFilterQuality(kLow_SkFilterQuality); 211 paint.setFilterQuality(kLow_SkFilterQuality);
212 212
213 srcRect.setXYWH(1, 1, 3, 3); 213 srcRect.setXYWH(1, 1, 3, 3);
214 SkMaskFilter* mf = SkBlurMaskFilter::Create( 214 paint.setMaskFilter(SkBlurMaskFilter::Make(
215 kNormal_SkBlurStyle, 215 kNormal_SkBlurStyle,
216 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)), 216 SkBlurMask::ConvertRadiusToSigma(SkIntToScalar(5)),
217 SkBlurMaskFilter::kHighQuality_BlurFlag | 217 SkBlurMaskFilter::kHighQuality_BlurFlag |
218 SkBlurMaskFilter::kIgnoreTransform_BlurFlag); 218 SkBlurMaskFilter::kIgnoreTransform_BlurFlag));
219 paint.setMaskFilter(mf)->unref();
220 canvas->drawBitmapRect(bm, srcRect, dstRect, &paint); 219 canvas->drawBitmapRect(bm, srcRect, dstRect, &paint);
221 } 220 }
222 } 221 }
223 222
224 private: 223 private:
225 typedef skiagm::GM INHERITED; 224 typedef skiagm::GM INHERITED;
226 }; 225 };
227 226
228 DEF_GM( return new DrawBitmapRectGM(canvasproc, nullptr); ) 227 DEF_GM( return new DrawBitmapRectGM(canvasproc, nullptr); )
229 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); ) 228 DEF_GM( return new DrawBitmapRectGM(imageproc, "-imagerect"); )
OLDNEW
« no previous file with comments | « gm/circles.cpp ('k') | gm/drawfilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698