OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 #include "SampleCode.h" | 8 #include "SampleCode.h" |
9 #include "SkDumpCanvas.h" | 9 #include "SkDumpCanvas.h" |
10 #include "SkView.h" | 10 #include "SkView.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 #include "SkStream.h" | 28 #include "SkStream.h" |
29 #include "SkXMLParser.h" | 29 #include "SkXMLParser.h" |
30 | 30 |
31 /////////////////////////////////////////////////////////////////////////////// | 31 /////////////////////////////////////////////////////////////////////////////// |
32 | 32 |
33 #include "SkImageRef_GlobalPool.h" | 33 #include "SkImageRef_GlobalPool.h" |
34 | 34 |
35 static SkBitmap load_bitmap() { | 35 static SkBitmap load_bitmap() { |
36 SkBitmap bm; | 36 SkBitmap bm; |
37 SkStream* stream = SkStream::NewFromFile("/skimages/sesame_street_ensemble-h
p.jpg"); | 37 SkStreamAsset* stream = SkStream::NewFromFile("/skimages/sesame_street_ensem
ble-hp.jpg"); |
38 if (stream) { | 38 if (stream) { |
39 SkAutoUnref aur(stream); | 39 SkAutoUnref aur(stream); |
40 | 40 |
41 if (SkImageDecoder::DecodeStream(stream, &bm, SkBitmap::kNo_Config, | 41 if (SkImageDecoder::DecodeStream(stream, &bm, SkBitmap::kNo_Config, |
42 SkImageDecoder::kDecodeBounds_Mode)) { | 42 SkImageDecoder::kDecodeBounds_Mode)) { |
43 SkPixelRef* pr = new SkImageRef_GlobalPool(stream, bm.config(), 1); | 43 SkPixelRef* pr = new SkImageRef_GlobalPool(stream, bm.config(), 1); |
44 bm.setPixelRef(pr)->unref(); | 44 bm.setPixelRef(pr)->unref(); |
45 } | 45 } |
46 } | 46 } |
47 return bm; | 47 return bm; |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 SkPicture* fPicture; | 191 SkPicture* fPicture; |
192 SkPicture* fSubPicture; | 192 SkPicture* fSubPicture; |
193 | 193 |
194 typedef SampleView INHERITED; | 194 typedef SampleView INHERITED; |
195 }; | 195 }; |
196 | 196 |
197 ////////////////////////////////////////////////////////////////////////////// | 197 ////////////////////////////////////////////////////////////////////////////// |
198 | 198 |
199 static SkView* MyFactory() { return new PictureView; } | 199 static SkView* MyFactory() { return new PictureView; } |
200 static SkViewRegister reg(MyFactory); | 200 static SkViewRegister reg(MyFactory); |
OLD | NEW |