aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkBuffer.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkBuffer.h')
-rw-r--r--src/core/SkBuffer.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/core/SkBuffer.h b/src/core/SkBuffer.h
index dd7f95aa3c..7dfe2bb65e 100644
--- a/src/core/SkBuffer.h
+++ b/src/core/SkBuffer.h
@@ -9,6 +9,7 @@
#ifndef SkBuffer_DEFINED
#define SkBuffer_DEFINED
+#include "SkSafeMath.h"
#include "SkScalar.h"
#include "SkTypes.h"
@@ -60,6 +61,12 @@ public:
bool readS32(int32_t* x) { return this->read(x, 4); }
bool readU32(uint32_t* x) { return this->read(x, 4); }
+ // returns nullptr on failure
+ const void* skip(size_t bytes);
+ template <typename T> const T* skipCount(size_t count) {
+ return static_cast<const T*>(this->skip(SkSafeMath::Mul(count, sizeof(T))));
+ }
+
private:
const char* fData;
const char* fPos;