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

Side by Side Diff: gm/filterindiabox.cpp

Issue 1316233002: Style Change: NULL->nullptr (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-27 (Thursday) 10:25:06 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/filterfastbounds.cpp ('k') | gm/fontcache.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 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 92
93 protected: 93 protected:
94 SkString fFilename; 94 SkString fFilename;
95 int fSize; 95 int fSize;
96 96
97 SkScalar getScale() { 97 SkScalar getScale() {
98 return 192.f/fSize; 98 return 192.f/fSize;
99 } 99 }
100 100
101 void makeBitmap() { 101 void makeBitmap() {
102 SkImageDecoder* codec = NULL; 102 SkImageDecoder* codec = nullptr;
103 SkString resourcePath = GetResourcePath(fFilename.c_str()); 103 SkString resourcePath = GetResourcePath(fFilename.c_str());
104 SkFILEStream stream(resourcePath.c_str()); 104 SkFILEStream stream(resourcePath.c_str());
105 if (stream.isValid()) { 105 if (stream.isValid()) {
106 codec = SkImageDecoder::Factory(&stream); 106 codec = SkImageDecoder::Factory(&stream);
107 } 107 }
108 if (codec) { 108 if (codec) {
109 stream.rewind(); 109 stream.rewind();
110 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode); 110 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode);
111 delete codec; 111 delete codec;
112 } else { 112 } else {
113 fBM.allocN32Pixels(1, 1); 113 fBM.allocN32Pixels(1, 1);
114 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad 114 *(fBM.getAddr32(0,0)) = 0xFF0000FF; // red == bad
115 } 115 }
116 fSize = fBM.height(); 116 fSize = fBM.height();
117 } 117 }
118 private: 118 private:
119 typedef skiagm::GM INHERITED; 119 typedef skiagm::GM INHERITED;
120 }; 120 };
121 121
122 ////////////////////////////////////////////////////////////////////////////// 122 //////////////////////////////////////////////////////////////////////////////
123 123
124 124
125 DEF_GM( return new FilterIndiaBoxGM("box.gif"); ) 125 DEF_GM( return new FilterIndiaBoxGM("box.gif"); )
OLDNEW
« no previous file with comments | « gm/filterfastbounds.cpp ('k') | gm/fontcache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698