aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkReader32.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-04 16:36:20 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-04 16:36:20 -0800
commitf70b531daaf47db1ee95c70da9843f1dd1f418d3 (patch)
tree85965584497549d7729c301075ff2ec9d1dc2c81 /src/core/SkReader32.h
parente77875aa425d51cc8db3463343a6308f9d2aadcc (diff)
Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/1744103002/ )"
Diffstat (limited to 'src/core/SkReader32.h')
-rw-r--r--src/core/SkReader32.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/core/SkReader32.h b/src/core/SkReader32.h
index 68dda23c6e..645d64cc24 100644
--- a/src/core/SkReader32.h
+++ b/src/core/SkReader32.h
@@ -1,4 +1,3 @@
-
/*
* Copyright 2008 The Android Open Source Project
*
@@ -10,6 +9,7 @@
#ifndef SkReader32_DEFINED
#define SkReader32_DEFINED
+#include "SkData.h"
#include "SkMatrix.h"
#include "SkPath.h"
#include "SkRegion.h"
@@ -135,6 +135,14 @@ public:
*/
size_t readIntoString(SkString* copy);
+ SkData* readData() {
+ uint32_t byteLength = this->readU32();
+ if (0 == byteLength) {
+ return SkData::NewEmpty();
+ }
+ return SkData::NewWithCopy(this->skip(byteLength), byteLength);
+ }
+
private:
template <typename T> bool readObjectFromMemory(T* obj) {
size_t size = obj->readFromMemory(this->peek(), this->available());