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

Side by Side Diff: gm/drawatlascolor.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/distantclip.cpp ('k') | gm/drawbitmaprect.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 2015 Google Inc. 2 * Copyright 2015 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 "SkRSXform.h" 10 #include "SkRSXform.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 gModes[i].fMode, nullptr, nullptr); 155 gModes[i].fMode, nullptr, nullptr);
156 canvas->translate(0.0f, numColors*(target.height()+kPad)); 156 canvas->translate(0.0f, numColors*(target.height()+kPad));
157 // w a paint 157 // w a paint
158 canvas->drawAtlas(fAtlas.get(), xforms, rects, quadColors, numColors , 158 canvas->drawAtlas(fAtlas.get(), xforms, rects, quadColors, numColors ,
159 gModes[i].fMode, nullptr, &paint); 159 gModes[i].fMode, nullptr, &paint);
160 canvas->restore(); 160 canvas->restore();
161 } 161 }
162 } 162 }
163 163
164 private: 164 private:
165 static const int kNumXferModes = 29; 165 static constexpr int kNumXferModes = 29;
166 static const int kNumColors = 4; 166 static constexpr int kNumColors = 4;
167 static const int kAtlasSize = 30; 167 static constexpr int kAtlasSize = 30;
168 static const int kPad = 2; 168 static constexpr int kPad = 2;
169 static const int kTextPad = 8; 169 static constexpr int kTextPad = 8;
170 170
171 171
172 sk_sp<SkImage> fAtlas; 172 sk_sp<SkImage> fAtlas;
173 173
174 typedef GM INHERITED; 174 typedef GM INHERITED;
175 }; 175 };
176 DEF_GM( return new DrawAtlasColorsGM; ) 176 DEF_GM( return new DrawAtlasColorsGM; )
OLDNEW
« no previous file with comments | « gm/distantclip.cpp ('k') | gm/drawbitmaprect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698