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

Unified Diff: fuzz/fuzz.cpp

Issue 2148023002: Port FuzzPathop from chromium (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Rebase Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fuzz/FuzzPathop.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fuzz/fuzz.cpp
diff --git a/fuzz/fuzz.cpp b/fuzz/fuzz.cpp
index b8375d344a1e9a6ce1099d97d5661f9562e74a94..4ca253343d2f1db222475eaacc653c5a3b2253cf 100644
--- a/fuzz/fuzz.cpp
+++ b/fuzz/fuzz.cpp
@@ -14,6 +14,8 @@
#include "SkImageEncoder.h"
#include "SkMallocPixelRef.h"
#include "SkPicture.h"
+#include "SkPicture.h"
+#include "SkPicture.h"
#include "SkStream.h"
#include <cmath>
@@ -404,6 +406,12 @@ Fuzz::Fuzz(SkData* bytes) : fBytes(SkSafeRef(bytes)), fNextByte(0) {}
void Fuzz::signalBug () { SkDebugf("Signal bug\n"); raise(SIGSEGV); }
void Fuzz::signalBoring() { SkDebugf("Signal boring\n"); exit(0); }
+size_t Fuzz::size() { return fBytes->size(); }
+
+size_t Fuzz::remaining() {
+ return fBytes->size() - fNextByte;
+}
+
template <typename T>
T Fuzz::nextT() {
if (fNextByte + sizeof(T) > fBytes->size()) {
« no previous file with comments | « fuzz/FuzzPathop.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698