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

Side by Side Diff: samplecode/SampleSubpixelTranslate.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/SamplePictFile.cpp ('k') | site/dev/contrib/style.md » ('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 17 matching lines...) Expand all
28 fVerticalVelocity(verticalVelocity) { 28 fVerticalVelocity(verticalVelocity) {
29 SkString resourcePath = GetResourcePath(imageFilename); 29 SkString resourcePath = GetResourcePath(imageFilename);
30 SkImageDecoder* codec = NULL; 30 SkImageDecoder* codec = NULL;
31 SkFILEStream stream(resourcePath.c_str()); 31 SkFILEStream stream(resourcePath.c_str());
32 if (stream.isValid()) { 32 if (stream.isValid()) {
33 codec = SkImageDecoder::Factory(&stream); 33 codec = SkImageDecoder::Factory(&stream);
34 } 34 }
35 if (codec) { 35 if (codec) {
36 stream.rewind(); 36 stream.rewind();
37 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecode Pixels_Mode); 37 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDecode Pixels_Mode);
38 SkDELETE(codec); 38 delete codec;
39 } else { 39 } else {
40 fBM.allocN32Pixels(1, 1); 40 fBM.allocN32Pixels(1, 1);
41 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad 41 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
42 } 42 }
43 fCurPos = SkPoint::Make(0,0); 43 fCurPos = SkPoint::Make(0,0);
44 fSize = 200; 44 fSize = 200;
45 } 45 }
46 46
47 protected: 47 protected:
48 SkBitmap fBM; 48 SkBitmap fBM;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 } 113 }
114 114
115 private: 115 private:
116 typedef SampleView INHERITED; 116 typedef SampleView INHERITED;
117 }; 117 };
118 118
119 ////////////////////////////////////////////////////////////////////////////// 119 //////////////////////////////////////////////////////////////////////////////
120 120
121 static SkView* MyFactory() { return new SubpixelTranslateView("mandrill_256.png" , .05f, .05f); } 121 static SkView* MyFactory() { return new SubpixelTranslateView("mandrill_256.png" , .05f, .05f); }
122 static SkViewRegister reg(MyFactory); 122 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « samplecode/SamplePictFile.cpp ('k') | site/dev/contrib/style.md » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698