Update SkPictureRecord to allow some ops to be written separately

https://codereview.chromium.org/153883002/



git-svn-id: http://skia.googlecode.com/svn/trunk@13311 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index d098916..51ae0b2 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -108,9 +108,8 @@
 
 private:
     void handleOptimization(int opt);
-    void recordRestoreOffsetPlaceholder(SkRegion::Op);
-    void fillRestoreOffsetPlaceholdersForCurrentStackLevel(
-        uint32_t restoreOffset);
+    int recordRestoreOffsetPlaceholder(SkRegion::Op);
+    void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffset);
 
     SkTDArray<int32_t> fRestoreOffsetStack;
     int fFirstSavedLayerIndex;
@@ -237,6 +236,20 @@
                           const SkScalar xpos[], SkScalar constY,
                           const SkPaint& paint, const SkFlatData* flatPaintData);
 
+    int addPathToHeap(const SkPath& path);  // does not write to ops stream
+
+    // These entry points allow the writing of matrices, clips, saves & 
+    // restores to be deferred (e.g., if the MC state is being collapsed and
+    // only written out as needed).
+    void recordConcat(const SkMatrix& matrix);
+    int recordClipRect(const SkRect& rect, SkRegion::Op op, bool doAA);
+    int recordClipRRect(const SkRRect& rrect, SkRegion::Op op, bool doAA);
+    int recordClipPath(int pathID, SkRegion::Op op, bool doAA);
+    int recordClipRegion(const SkRegion& region, SkRegion::Op op);
+    void recordSave(SaveFlags flags);
+    void recordSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags);
+    void recordRestore();
+
     // These are set to NULL in our constructor, but may be changed by
     // subclasses, in which case they will be SkSafeUnref'd in our destructor.
     SkBBoxHierarchy* fBoundingHierarchy;