diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-12 19:03:29 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2012-12-12 19:03:29 +0000 |
commit | 9b0fd9aa663612c983e4dfa1323cecda6e1e9029 (patch) | |
tree | eab7a38bb17e1d267b16cdfe3d99aa0ef8cbb6f5 | |
parent | 68d61ed83ec7b6e98e9623c2f5c9e7b1a32d25bb (diff) |
part of prev CL for rrect
git-svn-id: http://skia.googlecode.com/svn/trunk@6763 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | include/core/SkReader32.h | 6 | ||||
-rw-r--r-- | include/core/SkWriter32.h | 7 |
2 files changed, 12 insertions, 1 deletions
diff --git a/include/core/SkReader32.h b/include/core/SkReader32.h index 4f6809fd9e..7a8d22a80c 100644 --- a/include/core/SkReader32.h +++ b/include/core/SkReader32.h @@ -13,6 +13,7 @@ #include "SkMatrix.h" #include "SkPath.h" #include "SkRegion.h" +#include "SkRRect.h" #include "SkScalar.h" class SkString; @@ -117,6 +118,11 @@ public: (void)this->skip(size); } + SkRRect* readRRect(SkRRect* rrect) { + rrect->readFromMemory(this->skip(SkRRect::kSizeInMemory)); + return rrect; + } + void readRegion(SkRegion* rgn) { size_t size = rgn->readFromMemory(this->peek()); SkASSERT(SkAlign4(size) == size); diff --git a/include/core/SkWriter32.h b/include/core/SkWriter32.h index 3b9bdfca8f..9368126f4e 100644 --- a/include/core/SkWriter32.h +++ b/include/core/SkWriter32.h @@ -16,6 +16,7 @@ #include "SkPath.h" #include "SkPoint.h" #include "SkRect.h" +#include "SkRRect.h" #include "SkMatrix.h" #include "SkRegion.h" @@ -108,7 +109,11 @@ public: void writeRect(const SkRect& rect) { *(SkRect*)this->reserve(sizeof(rect)) = rect; } - + + void writeRRect(const SkRRect& rrect) { + rrect.writeToMemory(this->reserve(SkRRect::kSizeInMemory)); + } + void writePath(const SkPath& path) { size_t size = path.writeToMemory(NULL); SkASSERT(SkAlign4(size) == size); |