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

Unified Diff: src/core/SkReader32.h

Issue 1758023003: Move annotations to canvas virtual (patchset #8 id:140001 of https://codereview.chromium.org/174410… (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: manual rebase Created 4 years, 10 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 | « src/core/SkReadBuffer.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkReader32.h
diff --git a/src/core/SkReader32.h b/src/core/SkReader32.h
index 68dda23c6efcbd53fdc4c9758729229970b5a65c..645d64cc24590b5c6fc784b5be6878e0ff7b19fd 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());
« no previous file with comments | « src/core/SkReadBuffer.h ('k') | src/core/SkRecordDraw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698