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

Side by Side Diff: gm/downsamplebitmap.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/discard.cpp ('k') | gm/emboss.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 7
8 #include "gm.h" 8 #include "gm.h"
9 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 void make_bitmap() override { 173 void make_bitmap() override {
174 SkImageDecoder* codec = NULL; 174 SkImageDecoder* codec = NULL;
175 SkString resourcePath = GetResourcePath(fFilename.c_str()); 175 SkString resourcePath = GetResourcePath(fFilename.c_str());
176 SkFILEStream stream(resourcePath.c_str()); 176 SkFILEStream stream(resourcePath.c_str());
177 if (stream.isValid()) { 177 if (stream.isValid()) {
178 codec = SkImageDecoder::Factory(&stream); 178 codec = SkImageDecoder::Factory(&stream);
179 } 179 }
180 if (codec) { 180 if (codec) {
181 stream.rewind(); 181 stream.rewind();
182 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode); 182 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode);
183 SkDELETE(codec); 183 delete codec;
184 } else { 184 } else {
185 fBM.allocN32Pixels(1, 1); 185 fBM.allocN32Pixels(1, 1);
186 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad 186 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
187 } 187 }
188 fSize = fBM.height(); 188 fSize = fBM.height();
189 } 189 }
190 private: 190 private:
191 typedef DownsampleBitmapGM INHERITED; 191 typedef DownsampleBitmapGM INHERITED;
192 }; 192 };
193 193
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kLow_SkFilterQuality) ; ) 264 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kLow_SkFilterQuality) ; )
265 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kLow_SkFilterQual ity); ) 265 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kLow_SkFilterQual ity); )
266 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", 266 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
267 kLow_SkFilterQuality); ) 267 kLow_SkFilterQuality); )
268 268
269 DEF_GM( return new DownsampleBitmapTextGM(72, kNone_SkFilterQuality); ) 269 DEF_GM( return new DownsampleBitmapTextGM(72, kNone_SkFilterQuality); )
270 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kNone_SkFilterQuality ); ) 270 DEF_GM( return new DownsampleBitmapCheckerboardGM(512,256, kNone_SkFilterQuality ); )
271 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kNone_SkFilterQua lity); ) 271 DEF_GM( return new DownsampleBitmapImageGM("mandrill_512.png", kNone_SkFilterQua lity); )
272 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc", 272 DEF_GM( return new DownsampleBitmapImageGM("mandrill_132x132_12x12.astc",
273 kNone_SkFilterQuality); ) 273 kNone_SkFilterQuality); )
OLDNEW
« no previous file with comments | « gm/discard.cpp ('k') | gm/emboss.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698