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

Side by Side Diff: gm/gradients_no_texture.cpp

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 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/gm.h ('k') | gm/imagefiltersbase.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 "SkGradientShader.h" 8 #include "SkGradientShader.h"
9 9
10 using namespace skiagm; 10 using namespace skiagm;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 /////////////////////////////////////////////////////////////////////////////// 122 ///////////////////////////////////////////////////////////////////////////////
123 123
124 struct ColorPos { 124 struct ColorPos {
125 SkColor* fColors; 125 SkColor* fColors;
126 SkScalar* fPos; 126 SkScalar* fPos;
127 int fCount; 127 int fCount;
128 128
129 ColorPos() : fColors(NULL), fPos(NULL), fCount(0) {} 129 ColorPos() : fColors(NULL), fPos(NULL), fCount(0) {}
130 ~ColorPos() { 130 ~ColorPos() {
131 SkDELETE_ARRAY(fColors); 131 delete[] fColors;
132 SkDELETE_ARRAY(fPos); 132 delete[] fPos;
133 } 133 }
134 134
135 void construct(const SkColor colors[], const SkScalar pos[], int count) { 135 void construct(const SkColor colors[], const SkScalar pos[], int count) {
136 fColors = SkNEW_ARRAY(SkColor, count); 136 fColors = new SkColor[count];
137 memcpy(fColors, colors, count * sizeof(SkColor)); 137 memcpy(fColors, colors, count * sizeof(SkColor));
138 if (pos) { 138 if (pos) {
139 fPos = SkNEW_ARRAY(SkScalar, count); 139 fPos = new SkScalar[count];
140 memcpy(fPos, pos, count * sizeof(SkScalar)); 140 memcpy(fPos, pos, count * sizeof(SkScalar));
141 fPos[0] = 0; 141 fPos[0] = 0;
142 fPos[count - 1] = 1; 142 fPos[count - 1] = 1;
143 } 143 }
144 fCount = count; 144 fCount = count;
145 } 145 }
146 }; 146 };
147 147
148 static void make0(ColorPos* rec) { 148 static void make0(ColorPos* rec) {
149 #if 0 149 #if 0
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
241 canvas->translate(0, r.height() + 20); 241 canvas->translate(0, r.height() + 20);
242 } 242 }
243 } 243 }
244 244
245 private: 245 private:
246 typedef GM INHERITED; 246 typedef GM INHERITED;
247 }; 247 };
248 248
249 /////////////////////////////////////////////////////////////////////////////// 249 ///////////////////////////////////////////////////////////////////////////////
250 250
251 DEF_GM( return SkNEW(GradientsNoTextureGM)); 251 DEF_GM(return new GradientsNoTextureGM);
252 DEF_GM( return SkNEW(GradientsManyColorsGM)); 252 DEF_GM(return new GradientsManyColorsGM);
OLDNEW
« no previous file with comments | « gm/gm.h ('k') | gm/imagefiltersbase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698