aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkReader32.h
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2016-03-03 08:13:54 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-03 08:13:54 -0800
commit0eda2587cc9233066cb3f3fec08f35c061780f8e (patch)
treed48efc9eaa40406d0dc8e8b7931629b049ad1909 /src/core/SkReader32.h
parentc6663dc36b157e40c8225130f5970a346f9ba7c3 (diff)
move annotations to canvas virtual
In an effort to do it all at once, this change assumes that its ok to ignore annotations that were previously stored on paints in old SKP files (since this feature is only interesting to PDF printing). BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1744103002 Review URL: 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());