make paint flatten unflatten private

SkPaint flatten and unflatten rely
on interfaces that are not public,
SkReadBuffer and SkWriteBuffer.

R=reed@google.com
Bug: skia:6172
Change-Id: I487af9f8931c78daf763c51d9e0d3ff8ff440b22
Reviewed-on: https://skia-review.googlesource.com/112561
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Cary Clark <caryclark@skia.org>
diff --git a/include/core/SkPaint.h b/include/core/SkPaint.h
index 829388b..5cd05a2 100644
--- a/include/core/SkPaint.h
+++ b/include/core/SkPaint.h
@@ -20,8 +20,6 @@
 class SkData;
 class SkDescriptor;
 class SkDrawLooper;
-class SkReadBuffer;
-class SkWriteBuffer;
 class SkGlyph;
 struct SkRect;
 class SkGlyphCache;
@@ -161,24 +159,6 @@
     */
     uint32_t getHash() const;
 
-    /** Serializes SkPaint into a buffer. A companion unflatten() call
-        can reconstitute the paint at a later time.
-
-        @param buffer  SkWriteBuffer receiving the flattened SkPaint data
-    */
-    void flatten(SkWriteBuffer& buffer) const;
-
-    /** Populates SkPaint, typically from a serialized stream, created by calling
-        flatten() at an earlier time.
-
-        SkReadBuffer class is not public, so unflatten() cannot be meaningfully called
-        by the client.
-
-        @param buffer  serialized data describing SkPaint content
-        @return        false if the buffer contains invalid data
-    */
-    bool unflatten(SkReadBuffer& buffer);
-
     /** Sets all SkPaint contents to their initial values. This is equivalent to replacing
         SkPaint with the result of SkPaint().
     */
@@ -1725,6 +1705,7 @@
     friend class SkCanonicalizePaint;
     friend class SkCanvas;
     friend class SkDraw;
+    friend class SkPaintPriv;
     friend class SkPDFDevice;
     friend class SkScalerContext;  // for computeLuminanceColor()
     friend class SkTextBaseIter;