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

Side by Side Diff: samplecode/SampleIdentityScale.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 | « samplecode/SampleHT.cpp ('k') | samplecode/SampleLua.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 9
10 #include "Resources.h" 10 #include "Resources.h"
(...skipping 15 matching lines...) Expand all
26 IdentityScaleView(const char imageFilename[]) { 26 IdentityScaleView(const char imageFilename[]) {
27 SkString resourcePath = GetResourcePath(imageFilename); 27 SkString resourcePath = GetResourcePath(imageFilename);
28 SkImageDecoder* codec = NULL; 28 SkImageDecoder* codec = NULL;
29 SkFILEStream stream(resourcePath.c_str()); 29 SkFILEStream stream(resourcePath.c_str());
30 if (stream.isValid()) { 30 if (stream.isValid()) {
31 codec = SkImageDecoder::Factory(&stream); 31 codec = SkImageDecoder::Factory(&stream);
32 } 32 }
33 if (codec) { 33 if (codec) {
34 stream.rewind(); 34 stream.rewind();
35 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecode Pixels_Mode); 35 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecode Pixels_Mode);
36 SkDELETE(codec); 36 delete codec;
37 } else { 37 } else {
38 fBM.allocN32Pixels(1, 1); 38 fBM.allocN32Pixels(1, 1);
39 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad 39 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
40 } 40 }
41 } 41 }
42 42
43 protected: 43 protected:
44 SkBitmap fBM; 44 SkBitmap fBM;
45 45
46 // overrides from SkEventSink 46 // overrides from SkEventSink
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 } 84 }
85 85
86 private: 86 private:
87 typedef SampleView INHERITED; 87 typedef SampleView INHERITED;
88 }; 88 };
89 89
90 ////////////////////////////////////////////////////////////////////////////// 90 //////////////////////////////////////////////////////////////////////////////
91 91
92 static SkView* MyFactory() { return new IdentityScaleView("mandrill_256.png"); } 92 static SkView* MyFactory() { return new IdentityScaleView("mandrill_256.png"); }
93 static SkViewRegister reg(MyFactory); 93 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SampleHT.cpp ('k') | samplecode/SampleLua.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698