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

Side by Side Diff: gm/blurredclippedcircle.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/blurrect.cpp ('k') | gm/blurroundrect.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 2015 Google Inc. 2 * Copyright 2015 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 "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkColorFilter.h" 10 #include "SkColorFilter.h"
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 56
57 SkRect clipRect2 = SkRect::MakeLTRB(8, 8, 288, 288); 57 SkRect clipRect2 = SkRect::MakeLTRB(8, 8, 288, 288);
58 SkRRect clipRRect = SkRRect::MakeOval(clipRect2); 58 SkRRect clipRRect = SkRRect::MakeOval(clipRect2);
59 canvas->clipRRect(clipRRect, SkRegion::kDifference_Op, true) ; 59 canvas->clipRRect(clipRRect, SkRegion::kDifference_Op, true) ;
60 60
61 SkRect r = SkRect::MakeLTRB(4, 4, 292, 292); 61 SkRect r = SkRect::MakeLTRB(4, 4, 292, 292);
62 SkRRect rr = SkRRect::MakeOval(r); 62 SkRRect rr = SkRRect::MakeOval(r);
63 63
64 SkPaint paint; 64 SkPaint paint;
65 65
66 paint.setMaskFilter(SkBlurMaskFilter::Create( 66 paint.setMaskFilter(SkBlurMaskFilter::Make(
67 kNormal_SkBlurStyle, 67 kNormal_SkBlurStyle,
68 1.366025f, 68 1.366025f,
69 SkBlurMaskFilter::kHighQuality_BlurF lag))->unref(); 69 SkBlurMaskFilter::kHighQuality_BlurF lag));
70 paint.setColorFilter(SkColorFilter::MakeModeFilter( 70 paint.setColorFilter(SkColorFilter::MakeModeFilter(
71 SK_ColorRED, 71 SK_ColorRED,
72 SkXfermode::kSrcIn_Mode)); 72 SkXfermode::kSrcIn_Mode));
73 paint.setAntiAlias(true); 73 paint.setAntiAlias(true);
74 74
75 canvas->drawRRect(rr, paint); 75 canvas->drawRRect(rr, paint);
76 76
77 canvas->restore(); 77 canvas->restore();
78 canvas->restore(); 78 canvas->restore();
79 canvas->restore(); 79 canvas->restore();
80 } 80 }
81 81
82 private: 82 private:
83 static const int kWidth = 1164; 83 static const int kWidth = 1164;
84 static const int kHeight = 802; 84 static const int kHeight = 802;
85 85
86 typedef GM INHERITED; 86 typedef GM INHERITED;
87 }; 87 };
88 88
89 ////////////////////////////////////////////////////////////////////////////// 89 //////////////////////////////////////////////////////////////////////////////
90 90
91 DEF_GM(return new BlurredClippedCircleGM;) 91 DEF_GM(return new BlurredClippedCircleGM;)
92 } 92 }
OLDNEW
« no previous file with comments | « gm/blurrect.cpp ('k') | gm/blurroundrect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698