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

Side by Side Diff: gm/patchgrid.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/occludedrrectblur.cpp ('k') | gm/pathcontourstart.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 2014 Google Inc. 2 * Copyright 2014 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 "SkPatchGrid.h" 9 #include "SkPatchGrid.h"
10 10
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
98 98
99 SkPoint vrtCtrl[6][5] = { 99 SkPoint vrtCtrl[6][5] = {
100 {{50,75},{150,75},{250,75},{350,75},{450,75}}, 100 {{50,75},{150,75},{250,75},{350,75},{450,75}},
101 {{50,125},{150,125},{250,125},{350,125},{450,125}}, 101 {{50,125},{150,125},{250,125},{350,125},{450,125}},
102 {{50,175},{150,175},{220,225},{350,175},{470,225}}, 102 {{50,175},{150,175},{220,225},{350,175},{470,225}},
103 {{50,225},{150,225},{220,175},{350,225},{470,155}}, 103 {{50,225},{150,225},{220,175},{350,225},{470,155}},
104 {{50,275},{150,275},{250,275},{350,275},{400,305}}, 104 {{50,275},{150,275},{250,275},{350,275},{400,305}},
105 {{50,325},{150,325},{250,325},{350,325},{450,325}} 105 {{50,325},{150,325},{250,325},{350,325},{450,325}}
106 }; 106 };
107 107
108 static const int kRows = 3; 108 constexpr int kRows = 3;
109 static const int kCols = 4; 109 constexpr int kCols = 4;
110 110
111 canvas->scale(3, 3); 111 canvas->scale(3, 3);
112 SkPatchGrid grid(kRows, kCols, SkPatchGrid::kColors_VertexType, nullptr) ; 112 SkPatchGrid grid(kRows, kCols, SkPatchGrid::kColors_VertexType, nullptr) ;
113 for (int i = 0; i < kRows; i++) { 113 for (int i = 0; i < kRows; i++) {
114 for (int j = 0; j < kCols; j++) { 114 for (int j = 0; j < kCols; j++) {
115 SkPoint points[12]; 115 SkPoint points[12];
116 116
117 //set corners 117 //set corners
118 points[SkPatchUtils::kTopP0_CubicCtrlPts] = vertices[i][j]; 118 points[SkPatchUtils::kTopP0_CubicCtrlPts] = vertices[i][j];
119 points[SkPatchUtils::kTopP3_CubicCtrlPts] = vertices[i][j + 1]; 119 points[SkPatchUtils::kTopP3_CubicCtrlPts] = vertices[i][j + 1];
(...skipping 30 matching lines...) Expand all
150 } 150 }
151 } 151 }
152 } 152 }
153 153
154 private: 154 private:
155 typedef GM INHERITED; 155 typedef GM INHERITED;
156 }; 156 };
157 157
158 DEF_GM(return new SkPatchGridGM;) 158 DEF_GM(return new SkPatchGridGM;)
159 } 159 }
OLDNEW
« no previous file with comments | « gm/occludedrrectblur.cpp ('k') | gm/pathcontourstart.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698