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

Side by Side Diff: gm/bitmaprect.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/bitmappremul.cpp ('k') | gm/bleed.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 2011 Google Inc. 2 * Copyright 2011 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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 canvas->drawBitmapRect(bitmap, srcR, dstR, nullptr, SkCanvas::kStrict_Sr cRectConstraint); 146 canvas->drawBitmapRect(bitmap, srcR, dstR, nullptr, SkCanvas::kStrict_Sr cRectConstraint);
147 } 147 }
148 148
149 private: 149 private:
150 typedef skiagm::GM INHERITED; 150 typedef skiagm::GM INHERITED;
151 }; 151 };
152 152
153 ////////////////////////////////////////////////////////////////////////////// 153 //////////////////////////////////////////////////////////////////////////////
154 static void make_big_bitmap(SkBitmap* bitmap) { 154 static void make_big_bitmap(SkBitmap* bitmap) {
155 155
156 static const int gXSize = 4096; 156 constexpr int gXSize = 4096;
157 static const int gYSize = 4096; 157 constexpr int gYSize = 4096;
158 static const int gBorderWidth = 10; 158 constexpr int gBorderWidth = 10;
159 159
160 bitmap->allocN32Pixels(gXSize, gYSize); 160 bitmap->allocN32Pixels(gXSize, gYSize);
161 for (int y = 0; y < gYSize; ++y) { 161 for (int y = 0; y < gYSize; ++y) {
162 for (int x = 0; x < gXSize; ++x) { 162 for (int x = 0; x < gXSize; ++x) {
163 if (x <= gBorderWidth || x >= gXSize-gBorderWidth || 163 if (x <= gBorderWidth || x >= gXSize-gBorderWidth ||
164 y <= gBorderWidth || y >= gYSize-gBorderWidth) { 164 y <= gBorderWidth || y >= gYSize-gBorderWidth) {
165 *bitmap->getAddr32(x, y) = SkPreMultiplyColor(0x88FFFFFF); 165 *bitmap->getAddr32(x, y) = SkPreMultiplyColor(0x88FFFFFF);
166 } else { 166 } else {
167 *bitmap->getAddr32(x, y) = SkPreMultiplyColor(0x88FF0000); 167 *bitmap->getAddr32(x, y) = SkPreMultiplyColor(0x88FF0000);
168 } 168 }
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 ////////////////////////////////////////////////////////////////////////////// 271 //////////////////////////////////////////////////////////////////////////////
272 272
273 DEF_GM( return new DrawBitmapRect2(false); ) 273 DEF_GM( return new DrawBitmapRect2(false); )
274 DEF_GM( return new DrawBitmapRect2(true); ) 274 DEF_GM( return new DrawBitmapRect2(true); )
275 DEF_GM( return new DrawBitmapRect3(); ) 275 DEF_GM( return new DrawBitmapRect3(); )
276 276
277 #ifndef SK_BUILD_FOR_ANDROID 277 #ifndef SK_BUILD_FOR_ANDROID
278 DEF_GM( return new DrawBitmapRect4(false); ) 278 DEF_GM( return new DrawBitmapRect4(false); )
279 DEF_GM( return new DrawBitmapRect4(true); ) 279 DEF_GM( return new DrawBitmapRect4(true); )
280 #endif 280 #endif
OLDNEW
« no previous file with comments | « gm/bitmappremul.cpp ('k') | gm/bleed.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698