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

Side by Side Diff: gm/blurrect.cpp

Issue 2300623005: Replace a lot of 'static const' with 'constexpr' or 'const'. (Closed)
Patch Set: small msvc concession 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/blurquickreject.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 2012 Google Inc. 2 * Copyright 2012 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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 for (size_t s = 0; s < SK_ARRAY_COUNT(scales); ++s) { 118 for (size_t s = 0; s < SK_ARRAY_COUNT(scales); ++s) {
119 canvas->save(); 119 canvas->save();
120 for (size_t f = 0; f < SK_ARRAY_COUNT(fMaskFilters); ++f) { 120 for (size_t f = 0; f < SK_ARRAY_COUNT(fMaskFilters); ++f) {
121 SkPaint paint; 121 SkPaint paint;
122 paint.setMaskFilter(fMaskFilters[f]); 122 paint.setMaskFilter(fMaskFilters[f]);
123 paint.setAlpha(fAlpha); 123 paint.setAlpha(fAlpha);
124 124
125 SkPaint paintWithRadial = paint; 125 SkPaint paintWithRadial = paint;
126 paintWithRadial.setShader(MakeRadial()); 126 paintWithRadial.setShader(MakeRadial());
127 127
128 static const Proc procs[] = { 128 constexpr Proc procs[] = {
129 fill_rect, draw_donut, draw_donut_skewed 129 fill_rect, draw_donut, draw_donut_skewed
130 }; 130 };
131 131
132 canvas->save(); 132 canvas->save();
133 canvas->scale(scales[s], scales[s]); 133 canvas->scale(scales[s], scales[s]);
134 this->drawProcs(canvas, r, paint, false, procs, SK_ARRAY_COUNT(p rocs)); 134 this->drawProcs(canvas, r, paint, false, procs, SK_ARRAY_COUNT(p rocs));
135 canvas->translate(r.width() * 4/3, 0); 135 canvas->translate(r.width() * 4/3, 0);
136 this->drawProcs(canvas, r, paintWithRadial, false, procs, SK_ARR AY_COUNT(procs)); 136 this->drawProcs(canvas, r, paintWithRadial, false, procs, SK_ARR AY_COUNT(procs));
137 canvas->translate(r.width() * 4/3, 0); 137 canvas->translate(r.width() * 4/3, 0);
138 this->drawProcs(canvas, r, paint, true, procs, SK_ARRAY_COUNT(pr ocs)); 138 this->drawProcs(canvas, r, paint, true, procs, SK_ARRAY_COUNT(pr ocs));
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 if (bm.height() > max_height) 225 if (bm.height() > max_height)
226 max_height = bm.height(); 226 max_height = bm.height();
227 } 227 }
228 } 228 }
229 } 229 }
230 } 230 }
231 231
232 ////////////////////////////////////////////////////////////////////////////// 232 //////////////////////////////////////////////////////////////////////////////
233 233
234 DEF_GM(return new BlurRectGM("blurrects", 0xFF);) 234 DEF_GM(return new BlurRectGM("blurrects", 0xFF);)
OLDNEW
« no previous file with comments | « gm/blurquickreject.cpp ('k') | gm/blurredclippedcircle.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698