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

Side by Side Diff: gm/filterbitmap.cpp

Issue 351133003: Cleanup usage of GetResourcePath() after commit bcbc1788b478b1e54079318ad073e8490aa66fae. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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/factory.cpp ('k') | gm/filterindiabox.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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 187
188 protected: 188 protected:
189 SkString fFilename; 189 SkString fFilename;
190 int fSize; 190 int fSize;
191 191
192 SkScalar getScale() SK_OVERRIDE { 192 SkScalar getScale() SK_OVERRIDE {
193 return 192.f/fSize; 193 return 192.f/fSize;
194 } 194 }
195 195
196 void makeBitmap() SK_OVERRIDE { 196 void makeBitmap() SK_OVERRIDE {
197 SkString resourcePath = GetResourcePath();
198 resourcePath.append("/");
199 resourcePath.append(fFilename);
200
201 SkImageDecoder* codec = NULL; 197 SkImageDecoder* codec = NULL;
198 SkString resourcePath = GetResourcePath(fFilename.c_str());
202 SkFILEStream stream(resourcePath.c_str()); 199 SkFILEStream stream(resourcePath.c_str());
203 if (stream.isValid()) { 200 if (stream.isValid()) {
204 codec = SkImageDecoder::Factory(&stream); 201 codec = SkImageDecoder::Factory(&stream);
205 } 202 }
206 if (codec) { 203 if (codec) {
207 stream.rewind(); 204 stream.rewind();
208 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode); 205 codec->decode(&stream, &fBM, kN32_SkColorType, SkImageDecoder::kDe codePixels_Mode);
209 SkDELETE(codec); 206 SkDELETE(codec);
210 } else { 207 } else {
211 fBM.allocN32Pixels(1, 1); 208 fBM.allocN32Pixels(1, 1);
(...skipping 14 matching lines...) Expand all
226 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); ) 223 DEF_GM( return new FilterBitmapCheckerboardGM(32,32); )
227 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); ) 224 DEF_GM( return new FilterBitmapCheckerboardGM(32,8); )
228 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); ) 225 DEF_GM( return new FilterBitmapCheckerboardGM(32,2); )
229 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); ) 226 DEF_GM( return new FilterBitmapCheckerboardGM(192,192); )
230 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); ) 227 DEF_GM( return new FilterBitmapImageGM("mandrill_16.png"); )
231 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); ) 228 DEF_GM( return new FilterBitmapImageGM("mandrill_32.png"); )
232 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); ) 229 DEF_GM( return new FilterBitmapImageGM("mandrill_64.png"); )
233 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); ) 230 DEF_GM( return new FilterBitmapImageGM("mandrill_128.png"); )
234 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); ) 231 DEF_GM( return new FilterBitmapImageGM("mandrill_256.png"); )
235 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); ) 232 DEF_GM( return new FilterBitmapImageGM("mandrill_512.png"); )
OLDNEW
« no previous file with comments | « gm/factory.cpp ('k') | gm/filterindiabox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698