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

Side by Side Diff: gm/clippedbitmapshaders.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/circulararcs.cpp ('k') | gm/colorcube.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 "SkBitmap.h" 9 #include "SkBitmap.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 19 matching lines...) Expand all
30 bmp.allocN32Pixels(2, 2); 30 bmp.allocN32Pixels(2, 2);
31 uint32_t* pixels = reinterpret_cast<uint32_t*>(bmp.getPixels()); 31 uint32_t* pixels = reinterpret_cast<uint32_t*>(bmp.getPixels());
32 pixels[0] = SkPreMultiplyColor(SK_ColorRED); 32 pixels[0] = SkPreMultiplyColor(SK_ColorRED);
33 pixels[1] = SkPreMultiplyColor(SK_ColorGREEN); 33 pixels[1] = SkPreMultiplyColor(SK_ColorGREEN);
34 pixels[2] = SkPreMultiplyColor(SK_ColorBLACK); 34 pixels[2] = SkPreMultiplyColor(SK_ColorBLACK);
35 pixels[3] = SkPreMultiplyColor(SK_ColorBLUE); 35 pixels[3] = SkPreMultiplyColor(SK_ColorBLUE);
36 36
37 return bmp; 37 return bmp;
38 } 38 }
39 39
40 static const SkScalar RECT_SIZE = 64; 40 constexpr SkScalar RECT_SIZE = 64;
41 static const SkScalar SLIDE_SIZE = 300; 41 constexpr SkScalar SLIDE_SIZE = 300;
42 42
43 class ClippedBitmapShadersGM : public GM { 43 class ClippedBitmapShadersGM : public GM {
44 public: 44 public:
45 ClippedBitmapShadersGM(SkShader::TileMode mode, bool hq=false) 45 ClippedBitmapShadersGM(SkShader::TileMode mode, bool hq=false)
46 : fMode(mode), fHQ(hq) { 46 : fMode(mode), fHQ(hq) {
47 } 47 }
48 48
49 protected: 49 protected:
50 SkShader::TileMode fMode; 50 SkShader::TileMode fMode;
51 bool fHQ; 51 bool fHQ;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kRepeat_TileMode); ) 116 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kRepeat_TileMode); )
117 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kMirror_TileMode); ) 117 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kMirror_TileMode); )
118 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kClamp_TileMode); ) 118 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kClamp_TileMode); )
119 119
120 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kRepeat_TileMode, true); ) 120 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kRepeat_TileMode, true); )
121 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kMirror_TileMode, true); ) 121 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kMirror_TileMode, true); )
122 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kClamp_TileMode, true); ) 122 DEF_GM( return new ClippedBitmapShadersGM(SkShader::kClamp_TileMode, true); )
123 123
124 124
125 } 125 }
OLDNEW
« no previous file with comments | « gm/circulararcs.cpp ('k') | gm/colorcube.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698