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

Side by Side Diff: gm/filterbitmap.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/etc1bitmap.cpp ('k') | gm/filterfastbounds.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 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 void makeBitmap() override { 198 void makeBitmap() override {
199 SkImageDecoder* codec = NULL; 199 SkImageDecoder* codec = NULL;
200 SkString resourcePath = GetResourcePath(fFilename.c_str()); 200 SkString resourcePath = GetResourcePath(fFilename.c_str());
201 SkFILEStream stream(resourcePath.c_str()); 201 SkFILEStream stream(resourcePath.c_str());
202 if (stream.isValid()) { 202 if (stream.isValid()) {
203 codec = SkImageDecoder::Factory(&stream); 203 codec = SkImageDecoder::Factory(&stream);
204 } 204 }
205 if (codec) { 205 if (codec) {
206 stream.rewind(); 206 stream.rewind();
207 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode); 207 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode);
208 SkDELETE(codec); 208 delete codec;
209 } else { 209 } else {
210 fBM.allocN32Pixels(1, 1); 210 fBM.allocN32Pixels(1, 1);
211 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad 211 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
212 } 212 }
213 fSize = fBM.height(); 213 fSize = fBM.height();
214 if (fConvertToG8) { 214 if (fConvertToG8) {
215 SkBitmap tmp; 215 SkBitmap tmp;
216 fBM.copyTo(&tmp, kGray_8_SkColorType); 216 fBM.copyTo(&tmp, kGray_8_SkColorType);
217 fBM = tmp; 217 fBM = tmp;
218 } 218 }
(...skipping 15 matching lines...) Expand all
234 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) 234 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); )
235 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) 235 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); )
236 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) 236 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); )
237 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) 237 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); )
238 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) 238 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); )
239 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png", true); ) 239 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png", true); )
240 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) 240 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); )
241 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) 241 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); )
242 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) 242 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); )
243 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); ) 243 DEF_GM( return new FilterBitmapImageGM("color_wheel.png"); )
OLDNEW
« no previous file with comments | « gm/etc1bitmap.cpp ('k') | gm/filterfastbounds.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698