diff options
-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); |