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

Side by Side Diff: samplecode/SamplePicture.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/filterindiabox.cpp ('k') | samplecode/SampleSubpixelTranslate.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 19 matching lines...) Expand all
30 #include "SkTypeface.h" 30 #include "SkTypeface.h"
31 #include "SkUtils.h" 31 #include "SkUtils.h"
32 #include "SkView.h" 32 #include "SkView.h"
33 #include "SkXMLParser.h" 33 #include "SkXMLParser.h"
34 #include "SkXfermode.h" 34 #include "SkXfermode.h"
35 35
36 /////////////////////////////////////////////////////////////////////////////// 36 ///////////////////////////////////////////////////////////////////////////////
37 37
38 static SkBitmap load_bitmap() { 38 static SkBitmap load_bitmap() {
39 SkBitmap bm; 39 SkBitmap bm;
40 SkString resourcePath = GetResourcePath(); 40 SkString pngFilename = GetResourcePath("mandrill_512.png");
41 SkString path = SkOSPath::SkPathJoin(resourcePath.c_str(), "mandrill_512.png "); 41 SkAutoDataUnref data(SkData::NewFromFileName(pngFilename.c_str()));
42 SkAutoDataUnref data(SkData::NewFromFileName(path.c_str()));
43 if (data.get() != NULL) { 42 if (data.get() != NULL) {
44 SkInstallDiscardablePixelRef(SkDecodingImageGenerator::Create( 43 SkInstallDiscardablePixelRef(SkDecodingImageGenerator::Create(
45 data, SkDecodingImageGenerator::Options()), &bm); 44 data, SkDecodingImageGenerator::Options()), &bm);
46 } 45 }
47 return bm; 46 return bm;
48 } 47 }
49 48
50 static void drawCircle(SkCanvas* canvas, int r, SkColor color) { 49 static void drawCircle(SkCanvas* canvas, int r, SkColor color) {
51 SkPaint paint; 50 SkPaint paint;
52 paint.setAntiAlias(true); 51 paint.setAntiAlias(true);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 SkPicture* fPicture; 192 SkPicture* fPicture;
194 SkPicture* fSubPicture; 193 SkPicture* fSubPicture;
195 194
196 typedef SampleView INHERITED; 195 typedef SampleView INHERITED;
197 }; 196 };
198 197
199 ////////////////////////////////////////////////////////////////////////////// 198 //////////////////////////////////////////////////////////////////////////////
200 199
201 static SkView* MyFactory() { return new PictureView; } 200 static SkView* MyFactory() { return new PictureView; }
202 static SkViewRegister reg(MyFactory); 201 static SkViewRegister reg(MyFactory);
OLDNEW
« no previous file with comments | « gm/filterindiabox.cpp ('k') | samplecode/SampleSubpixelTranslate.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698