part of prev CL for rrect
authorreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 12 Dec 2012 19:03:29 +0000 (19:03 +0000)
committerreed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Wed, 12 Dec 2012 19:03:29 +0000 (19:03 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@6763 2bbb7eff-a529-9590-31e7-b0007b416f81

include/core/SkReader32.h
include/core/SkWriter32.h

index 4f6809f..7a8d22a 100644 (file)
@@ -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);
index 3b9bdfc..9368126 100644 (file)
@@ -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);