OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 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 "SkBitmap.h" | 8 #include "SkBitmap.h" |
9 #include "SkCanvas.h" | 9 #include "SkCanvas.h" |
10 #include "SkGraphics.h" | 10 #include "SkGraphics.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 } | 31 } |
32 printf("version:%d width:%d height:%d\n", header[0], header[1], header[2
]); | 32 printf("version:%d width:%d height:%d\n", header[0], header[1], header[2
]); |
33 } | 33 } |
34 | 34 |
35 stream.rewind(); | 35 stream.rewind(); |
36 auto pic = SkPicture::MakeFromStream(&stream); | 36 auto pic = SkPicture::MakeFromStream(&stream); |
37 if (nullptr == pic) { | 37 if (nullptr == pic) { |
38 SkDebugf("Could not create SkPicture: %s\n", path); | 38 SkDebugf("Could not create SkPicture: %s\n", path); |
39 return nullptr; | 39 return nullptr; |
40 } | 40 } |
41 printf("picture cullRect: [%f %f %f %f]\n", | 41 printf("picture cullRect: [%f %f %f %f]\n", |
42 pic->cullRect().fLeft, pic->cullRect().fTop, | 42 pic->cullRect().fLeft, pic->cullRect().fTop, |
43 pic->cullRect().fRight, pic->cullRect().fBottom); | 43 pic->cullRect().fRight, pic->cullRect().fBottom); |
44 return pic; | 44 return pic; |
45 } | 45 } |
46 | 46 |
47 static void dumpOps(SkPicture* pic) { | 47 static void dumpOps(SkPicture* pic) { |
48 #ifdef SK_DEVELOPER | 48 #ifdef SK_DEVELOPER |
49 SkDebugfDumper dumper; | 49 SkDebugfDumper dumper; |
50 SkDumpCanvas canvas(&dumper); | 50 SkDumpCanvas canvas(&dumper); |
51 canvas.drawPicture(pic); | 51 canvas.drawPicture(pic); |
(...skipping 28 matching lines...) Expand all Loading... |
80 } | 80 } |
81 } | 81 } |
82 return 0; | 82 return 0; |
83 } | 83 } |
84 | 84 |
85 #if !defined SK_BUILD_FOR_IOS | 85 #if !defined SK_BUILD_FOR_IOS |
86 int main(int argc, char * const argv[]) { | 86 int main(int argc, char * const argv[]) { |
87 return tool_main(argc, (char**) argv); | 87 return tool_main(argc, (char**) argv); |
88 } | 88 } |
89 #endif | 89 #endif |
OLD | NEW |