OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 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 "nanomsg/src/nn.h" | 8 #include "nanomsg/src/nn.h" |
9 #include "nanomsg/src/pipeline.h" | 9 #include "nanomsg/src/pipeline.h" |
10 #include "nanomsg/src/reqrep.h" | 10 #include "nanomsg/src/reqrep.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 sk_sp<SkPicture> pic = SkPicture::MakeFromStream(&stream); | 73 sk_sp<SkPicture> pic = SkPicture::MakeFromStream(&stream); |
74 | 74 |
75 SkDebugf(" from proccess %d:", header->pid); | 75 SkDebugf(" from proccess %d:", header->pid); |
76 | 76 |
77 nn_freemsg(msg); | 77 nn_freemsg(msg); |
78 return pic; | 78 return pic; |
79 } | 79 } |
80 | 80 |
81 static void client(const char* skpPath, const char* dataEndpoint) { | 81 static void client(const char* skpPath, const char* dataEndpoint) { |
82 // Read the .skp. | 82 // Read the .skp. |
83 SkAutoTUnref<const SkData> skp(SkData::NewFromFileName(skpPath)); | 83 sk_sp<SkData> skp(SkData::MakeFromFileName(skpPath)); |
84 if (!skp) { | 84 if (!skp) { |
85 SkDebugf("Couldn't read %s\n", skpPath); | 85 SkDebugf("Couldn't read %s\n", skpPath); |
86 exit(1); | 86 exit(1); |
87 } | 87 } |
88 SkMemoryStream stream(skp->data(), skp->size()); | 88 SkMemoryStream stream(skp->data(), skp->size()); |
89 sk_sp<SkPicture> picture(SkPicture::MakeFromStream(&stream)); | 89 sk_sp<SkPicture> picture(SkPicture::MakeFromStream(&stream)); |
90 | 90 |
91 PictureHeader header; | 91 PictureHeader header; |
92 SkRandom rand(picture->cullRect().width() * picture->cullRect().height()); | 92 SkRandom rand(picture->cullRect().width() * picture->cullRect().height()); |
93 SkScalar r = rand.nextRangeScalar(0, picture->cullRect().width()), | 93 SkScalar r = rand.nextRangeScalar(0, picture->cullRect().width()), |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 | 205 |
206 server(FLAGS_data[0], FLAGS_control[0], &canvas); | 206 server(FLAGS_data[0], FLAGS_control[0], &canvas); |
207 canvas.flush(); | 207 canvas.flush(); |
208 | 208 |
209 SkImageEncoder::EncodeFile(FLAGS_png[0], bitmap, SkImageEncoder::kPNG_Ty
pe, 100); | 209 SkImageEncoder::EncodeFile(FLAGS_png[0], bitmap, SkImageEncoder::kPNG_Ty
pe, 100); |
210 SkDebugf("Wrote %s.\n", FLAGS_png[0]); | 210 SkDebugf("Wrote %s.\n", FLAGS_png[0]); |
211 } | 211 } |
212 | 212 |
213 return 0; | 213 return 0; |
214 } | 214 } |
OLD | NEW |