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

Side by Side Diff: gm/blurredclippedcircle.cpp

Issue 2355483002: abstract name of clipping ops, to transtion to a more restricted set (Closed)
Patch Set: no need for ifdef for globals Created 4 years, 3 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/bigblurs.cpp ('k') | gm/circularclips.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 27 matching lines...) Expand all
38 whitePaint.setAntiAlias(true); 38 whitePaint.setAntiAlias(true);
39 39
40 // This scale exercises precision limits in the circle blur effect (crbu g.com/560651) 40 // This scale exercises precision limits in the circle blur effect (crbu g.com/560651)
41 constexpr float kScale = 2.0f; 41 constexpr float kScale = 2.0f;
42 canvas->scale(kScale, kScale); 42 canvas->scale(kScale, kScale);
43 43
44 canvas->save(); 44 canvas->save();
45 SkRect clipRect1 = SkRect::MakeLTRB(0, 0, 45 SkRect clipRect1 = SkRect::MakeLTRB(0, 0,
46 SkIntToScalar(kWidth), SkIntToSc alar(kHeight)); 46 SkIntToScalar(kWidth), SkIntToSc alar(kHeight));
47 47
48 canvas->clipRect(clipRect1, SkRegion::kIntersect_Op, false); 48 canvas->clipRect(clipRect1);
49 49
50 canvas->save(); 50 canvas->save();
51 51
52 canvas->clipRect(clipRect1, SkRegion::kIntersect_Op, false); 52 canvas->clipRect(clipRect1);
53 canvas->drawRect(clipRect1, whitePaint); 53 canvas->drawRect(clipRect1, whitePaint);
54 54
55 canvas->save(); 55 canvas->save();
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, SkCanvas::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::Make( 66 paint.setMaskFilter(SkBlurMaskFilter::Make(
67 kNormal_SkBlurStyle, 67 kNormal_SkBlurStyle,
68 1.366025f, 68 1.366025f,
69 SkBlurMaskFilter::kHighQuality_BlurF lag)); 69 SkBlurMaskFilter::kHighQuality_BlurF lag));
(...skipping 13 matching lines...) Expand all
83 static constexpr int kWidth = 1164; 83 static constexpr int kWidth = 1164;
84 static constexpr int kHeight = 802; 84 static constexpr 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/bigblurs.cpp ('k') | gm/circularclips.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698