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

Side by Side Diff: gm/composeshader.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/complexclip3.cpp ('k') | gm/constcolorprocessor.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 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 canvas->translate(0, r.height() + 5); 203 canvas->translate(0, r.height() + 5);
204 } 204 }
205 } 205 }
206 206
207 private: 207 private:
208 /** This determines the length and width of the bitmaps used in the ComposeS haders. Values 208 /** This determines the length and width of the bitmaps used in the ComposeS haders. Values
209 * above 20 may cause an SkASSERT to fail in SkSmallAllocator. However, lar ger values will 209 * above 20 may cause an SkASSERT to fail in SkSmallAllocator. However, lar ger values will
210 * work in a release build. You can change this parameter and then compile a release build 210 * work in a release build. You can change this parameter and then compile a release build
211 * to have this GM draw larger bitmaps for easier visual inspection. 211 * to have this GM draw larger bitmaps for easier visual inspection.
212 */ 212 */
213 static const int squareLength = 20; 213 static constexpr int squareLength = 20;
214 214
215 SkBitmap fColorBitmap; 215 SkBitmap fColorBitmap;
216 SkBitmap fAlpha8Bitmap; 216 SkBitmap fAlpha8Bitmap;
217 sk_sp<SkShader> fColorBitmapShader; 217 sk_sp<SkShader> fColorBitmapShader;
218 sk_sp<SkShader> fAlpha8BitmapShader; 218 sk_sp<SkShader> fAlpha8BitmapShader;
219 sk_sp<SkShader> fLinearGradientShader; 219 sk_sp<SkShader> fLinearGradientShader;
220 220
221 typedef GM INHERITED; 221 typedef GM INHERITED;
222 }; 222 };
223 223
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 paint.setShader( 257 paint.setShader(
258 SkShader::MakeComposeShader(skMaskShader, skSrcShader, dstInMode)); 258 SkShader::MakeComposeShader(skMaskShader, skSrcShader, dstInMode));
259 canvas->drawRect(r, paint); 259 canvas->drawRect(r, paint);
260 } 260 }
261 261
262 ////////////////////////////////////////////////////////////////////////////// 262 //////////////////////////////////////////////////////////////////////////////
263 263
264 DEF_GM( return new ComposeShaderGM; ) 264 DEF_GM( return new ComposeShaderGM; )
265 DEF_GM( return new ComposeShaderAlphaGM; ) 265 DEF_GM( return new ComposeShaderAlphaGM; )
266 DEF_GM( return new ComposeShaderBitmapGM; ) 266 DEF_GM( return new ComposeShaderBitmapGM; )
OLDNEW
« no previous file with comments | « gm/complexclip3.cpp ('k') | gm/constcolorprocessor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698