OLD | NEW |
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 Loading... |
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 Loading... |
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); |
OLD | NEW |