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

Side by Side Diff: gm/xfermodes2.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/xfermodeimagefilter.cpp ('k') | gm/xfermodes3.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 #include "gm.h" 7 #include "gm.h"
8 #include "SkBitmap.h" 8 #include "SkBitmap.h"
9 #include "SkShader.h" 9 #include "SkShader.h"
10 #include "SkXfermode.h" 10 #include "SkXfermode.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 x += w + SkIntToScalar(10); 77 x += w + SkIntToScalar(10);
78 if ((m % W) == W - 1) { 78 if ((m % W) == W - 1) {
79 x = 0; 79 x = 0;
80 y += h + SkIntToScalar(30); 80 y += h + SkIntToScalar(30);
81 } 81 }
82 } 82 }
83 } 83 }
84 84
85 private: 85 private:
86 void onOnceBeforeDraw() override { 86 void onOnceBeforeDraw() override {
87 static const uint32_t kCheckData[] = { 87 const uint32_t kCheckData[] = {
88 SkPackARGB32(0xFF, 0x42, 0x41, 0x42), 88 SkPackARGB32(0xFF, 0x42, 0x41, 0x42),
89 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), 89 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6),
90 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6), 90 SkPackARGB32(0xFF, 0xD6, 0xD3, 0xD6),
91 SkPackARGB32(0xFF, 0x42, 0x41, 0x42) 91 SkPackARGB32(0xFF, 0x42, 0x41, 0x42)
92 }; 92 };
93 SkBitmap bg; 93 SkBitmap bg;
94 bg.allocN32Pixels(2, 2, true); 94 bg.allocN32Pixels(2, 2, true);
95 memcpy(bg.getPixels(), kCheckData, sizeof(kCheckData)); 95 memcpy(bg.getPixels(), kCheckData, sizeof(kCheckData));
96 96
97 SkMatrix lm; 97 SkMatrix lm;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 138
139 typedef GM INHERITED; 139 typedef GM INHERITED;
140 }; 140 };
141 141
142 ////////////////////////////////////////////////////////////////////////////// 142 //////////////////////////////////////////////////////////////////////////////
143 143
144 static GM* MyFactory(void*) { return new Xfermodes2GM; } 144 static GM* MyFactory(void*) { return new Xfermodes2GM; }
145 static GMRegistry reg(MyFactory); 145 static GMRegistry reg(MyFactory);
146 146
147 } 147 }
OLDNEW
« no previous file with comments | « gm/xfermodeimagefilter.cpp ('k') | gm/xfermodes3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698