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

Side by Side Diff: fuzz/Fuzz.h

Issue 2333713002: change SkStreams to work with sk_sp<SkData> instead of SkData* (Closed)
Patch Set: fix xpsdevice Created 4 years, 3 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
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | fuzz/fuzz.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2016 Google Inc. 2 * Copyright 2016 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 #ifndef Fuzz_DEFINED 8 #ifndef Fuzz_DEFINED
9 #define Fuzz_DEFINED 9 #define Fuzz_DEFINED
10 10
11 #include "SkData.h" 11 #include "SkData.h"
12 #include "SkTRegistry.h" 12 #include "SkTRegistry.h"
13 #include "SkTypes.h" 13 #include "SkTypes.h"
14 14
15 class Fuzz : SkNoncopyable { 15 class Fuzz : SkNoncopyable {
16 public: 16 public:
17 explicit Fuzz(SkData*); 17 explicit Fuzz(sk_sp<SkData>);
18 18
19 // Returns the total number of "random" bytes available. 19 // Returns the total number of "random" bytes available.
20 size_t size(); 20 size_t size();
21 // Returns the total number of "random" bytes remaining for randomness. 21 // Returns the total number of "random" bytes remaining for randomness.
22 size_t remaining(); 22 size_t remaining();
23 23
24 template <typename T> 24 template <typename T>
25 bool next(T* n); 25 bool next(T* n);
26 26
27 bool nextBool(); 27 bool nextBool();
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 const char* name; 66 const char* name;
67 void (*fn)(Fuzz*); 67 void (*fn)(Fuzz*);
68 }; 68 };
69 69
70 #define DEF_FUZZ(name, f) \ 70 #define DEF_FUZZ(name, f) \
71 static void fuzz_##name(Fuzz*); \ 71 static void fuzz_##name(Fuzz*); \
72 SkTRegistry<Fuzzable> register_##name({#name, fuzz_##name}); \ 72 SkTRegistry<Fuzzable> register_##name({#name, fuzz_##name}); \
73 static void fuzz_##name(Fuzz* f) 73 static void fuzz_##name(Fuzz* f)
74 74
75 #endif//Fuzz_DEFINED 75 #endif//Fuzz_DEFINED
OLDNEW
« no previous file with comments | « dm/DMSrcSink.cpp ('k') | fuzz/fuzz.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698