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

Side by Side Diff: gm/texteffects.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/textblobuseaftergpufree.cpp ('k') | gm/texturedomaineffect.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 "SkBlurMask.h" 9 #include "SkBlurMask.h"
10 #include "SkBlurMaskFilter.h" 10 #include "SkBlurMaskFilter.h"
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
139 139
140 p.setPathEffect(nullptr); 140 p.setPathEffect(nullptr);
141 p.setXfermode(nullptr); 141 p.setXfermode(nullptr);
142 p.setStyle(SkPaint::kStroke_Style); 142 p.setStyle(SkPaint::kStroke_Style);
143 p.setStrokeWidth(SK_Scalar1); 143 p.setStrokeWidth(SK_Scalar1);
144 rastBuilder->addLayer(p); 144 rastBuilder->addLayer(p);
145 } 145 }
146 146
147 typedef void (*raster_proc)(SkLayerRasterizer::Builder*, SkPaint&); 147 typedef void (*raster_proc)(SkLayerRasterizer::Builder*, SkPaint&);
148 148
149 static const raster_proc gRastProcs[] = { 149 constexpr raster_proc gRastProcs[] = {
150 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9 150 r0, r1, r2, r3, r4, r5, r6, r7, r8, r9
151 }; 151 };
152 152
153 #include "SkXfermode.h" 153 #include "SkXfermode.h"
154 154
155 static void apply_shader(SkPaint* paint, int index) { 155 static void apply_shader(SkPaint* paint, int index) {
156 raster_proc proc = gRastProcs[index]; 156 raster_proc proc = gRastProcs[index];
157 if (proc) { 157 if (proc) {
158 SkPaint p; 158 SkPaint p;
159 SkLayerRasterizer::Builder rastBuilder; 159 SkLayerRasterizer::Builder rastBuilder;
(...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after
489 489
490 SkScalar start = textPt.fX; 490 SkScalar start = textPt.fX;
491 SkScalar end = posX; 491 SkScalar end = posX;
492 SkScalar uPos = pos[0].fY + uWidth; 492 SkScalar uPos = pos[0].fY + uWidth;
493 SkPath underline = create_underline(intersections, start, end, uPos, uWi dth, textSize); 493 SkPath underline = create_underline(intersections, start, end, uPos, uWi dth, textSize);
494 paint.setStyle(SkPaint::kStroke_Style); 494 paint.setStyle(SkPaint::kStroke_Style);
495 canvas->drawPath(underline, paint); 495 canvas->drawPath(underline, paint);
496 canvas->translate(0, textSize * 1.3f); 496 canvas->translate(0, textSize * 1.3f);
497 } 497 }
498 } 498 }
OLDNEW
« no previous file with comments | « gm/textblobuseaftergpufree.cpp ('k') | gm/texturedomaineffect.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698