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

Side by Side Diff: gm/alphagradients.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/aaxfermodes.cpp ('k') | gm/anisotropic.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 "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGradientShader.h" 10 #include "SkGradientShader.h"
(...skipping 20 matching lines...) Expand all
31 paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2, 31 paint.setShader(SkGradientShader::MakeLinear(pts, colors, nullptr, 2,
32 SkShader::kClamp_TileMode, flags, nullptr)); 32 SkShader::kClamp_TileMode, flags, nullptr));
33 canvas->drawRect(r, paint); 33 canvas->drawRect(r, paint);
34 34
35 paint.setShader(nullptr); 35 paint.setShader(nullptr);
36 paint.setStyle(SkPaint::kStroke_Style); 36 paint.setStyle(SkPaint::kStroke_Style);
37 canvas->drawRect(r, paint); 37 canvas->drawRect(r, paint);
38 } 38 }
39 39
40 void onDraw(SkCanvas* canvas) override { 40 void onDraw(SkCanvas* canvas) override {
41 static const struct { 41 constexpr struct {
42 SkColor fColor0; 42 SkColor fColor0;
43 SkColor fColor1; 43 SkColor fColor1;
44 } gRec[] = { 44 } gRec[] = {
45 { 0xFFFFFFFF, 0x00000000 }, 45 { 0xFFFFFFFF, 0x00000000 },
46 { 0xFFFFFFFF, 0x00FF0000 }, 46 { 0xFFFFFFFF, 0x00FF0000 },
47 { 0xFFFFFFFF, 0x00FFFF00 }, 47 { 0xFFFFFFFF, 0x00FFFF00 },
48 { 0xFFFFFFFF, 0x00FFFFFF }, 48 { 0xFFFFFFFF, 0x00FFFFFF },
49 { 0xFFFF0000, 0x00000000 }, 49 { 0xFFFF0000, 0x00000000 },
50 { 0xFFFF0000, 0x00FF0000 }, 50 { 0xFFFF0000, 0x00FF0000 },
51 { 0xFFFF0000, 0x00FFFF00 }, 51 { 0xFFFF0000, 0x00FFFF00 },
(...skipping 17 matching lines...) Expand all
69 canvas->restore(); 69 canvas->restore();
70 canvas->translate(r.width() + 10, 0); 70 canvas->translate(r.width() + 10, 0);
71 } 71 }
72 } 72 }
73 73
74 private: 74 private:
75 typedef skiagm::GM INHERITED; 75 typedef skiagm::GM INHERITED;
76 }; 76 };
77 77
78 DEF_GM(return new AlphaGradientsGM;) 78 DEF_GM(return new AlphaGradientsGM;)
OLDNEW
« no previous file with comments | « gm/aaxfermodes.cpp ('k') | gm/anisotropic.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698