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

Side by Side Diff: gm/bigblurs.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/aaclip.cpp ('k') | gm/blurredclippedcircle.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 2013 Google Inc. 2 * Copyright 2013 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 blurPaint.setMaskFilter(SkBlurMaskFilter::Make((SkBlurStyle)j, k Sigma)); 73 blurPaint.setMaskFilter(SkBlurMaskFilter::Make((SkBlurStyle)j, k Sigma));
74 74
75 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) { 75 for (int k = 0; k < (int)SK_ARRAY_COUNT(origins); ++k) {
76 canvas->save(); 76 canvas->save();
77 77
78 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX), 78 SkRect clipRect = SkRect::MakeXYWH(SkIntToScalar(desiredX),
79 SkIntToScalar(desiredY), 79 SkIntToScalar(desiredY),
80 SkIntToScalar(kCloseUpSiz e), 80 SkIntToScalar(kCloseUpSiz e),
81 SkIntToScalar(kCloseUpSiz e)); 81 SkIntToScalar(kCloseUpSiz e));
82 82
83 canvas->clipRect(clipRect, SkRegion::kReplace_Op, false); 83 canvas->clipRect(clipRect, SkCanvas::kReplace_Op, false);
84 84
85 canvas->translate(desiredX-origins[k].fX, 85 canvas->translate(desiredX-origins[k].fX,
86 desiredY-origins[k].fY); 86 desiredY-origins[k].fY);
87 87
88 if (0 == i) { 88 if (0 == i) {
89 canvas->drawRect(bigRect, blurPaint); 89 canvas->drawRect(bigRect, blurPaint);
90 } else { 90 } else {
91 canvas->drawPath(rectori, blurPaint); 91 canvas->drawPath(rectori, blurPaint);
92 } 92 }
93 canvas->restore(); 93 canvas->restore();
(...skipping 11 matching lines...) Expand all
105 private: 105 private:
106 static constexpr int kCloseUpSize = 64; 106 static constexpr int kCloseUpSize = 64;
107 static constexpr int kWidth = 5 * kCloseUpSize; 107 static constexpr int kWidth = 5 * kCloseUpSize;
108 static constexpr int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSiz e; 108 static constexpr int kHeight = 2 * (kLastEnum_SkBlurStyle + 1) * kCloseUpSiz e;
109 109
110 typedef GM INHERITED; 110 typedef GM INHERITED;
111 }; 111 };
112 112
113 DEF_GM(return new BigBlursGM;) 113 DEF_GM(return new BigBlursGM;)
114 } 114 }
OLDNEW
« no previous file with comments | « gm/aaclip.cpp ('k') | gm/blurredclippedcircle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698