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

Side by Side Diff: experimental/nanomsg/picture_demo.cpp

Issue 2206633004: Move off SK_SUPPORT_LEGACY_DATA_FACTORIES. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Gotta catch 'em all. Created 4 years, 4 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
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « experimental/SkV8Example/SkV8Example.cpp ('k') | fuzz/fuzz.cpp » ('j') | include/core/SkData.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698