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

Side by Side Diff: gm/samplerstress.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/rrects.cpp ('k') | gm/shadertext.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 "SkBlurMaskFilter.h" 9 #include "SkBlurMaskFilter.h"
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 24 matching lines...) Expand all
35 } 35 }
36 36
37 /** 37 /**
38 * Create a red & green stripes on black texture 38 * Create a red & green stripes on black texture
39 */ 39 */
40 void createTexture() { 40 void createTexture() {
41 if (fTextureCreated) { 41 if (fTextureCreated) {
42 return; 42 return;
43 } 43 }
44 44
45 static const int xSize = 16; 45 constexpr int xSize = 16;
46 static const int ySize = 16; 46 constexpr int ySize = 16;
47 47
48 fTexture.allocN32Pixels(xSize, ySize); 48 fTexture.allocN32Pixels(xSize, ySize);
49 SkPMColor* addr = fTexture.getAddr32(0, 0); 49 SkPMColor* addr = fTexture.getAddr32(0, 0);
50 50
51 for (int y = 0; y < ySize; ++y) { 51 for (int y = 0; y < ySize; ++y) {
52 for (int x = 0; x < xSize; ++x) { 52 for (int x = 0; x < xSize; ++x) {
53 addr[y*xSize+x] = SkPreMultiplyColor(SK_ColorBLACK); 53 addr[y*xSize+x] = SkPreMultiplyColor(SK_ColorBLACK);
54 54
55 if ((y % 5) == 0) { 55 if ((y % 5) == 0) {
56 addr[y*xSize+x] = SkPreMultiplyColor(SK_ColorRED); 56 addr[y*xSize+x] = SkPreMultiplyColor(SK_ColorRED);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 142
143 typedef GM INHERITED; 143 typedef GM INHERITED;
144 }; 144 };
145 145
146 ////////////////////////////////////////////////////////////////////////////// 146 //////////////////////////////////////////////////////////////////////////////
147 147
148 static GM* MyFactory(void*) { return new SamplerStressGM; } 148 static GM* MyFactory(void*) { return new SamplerStressGM; }
149 static GMRegistry reg(MyFactory); 149 static GMRegistry reg(MyFactory);
150 150
151 } 151 }
OLDNEW
« no previous file with comments | « gm/rrects.cpp ('k') | gm/shadertext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698