Collapse matrix & clip stack in PictureRecord
https://codereview.chromium.org/137093004/
git-svn-id: http://skia.googlecode.com/svn/trunk@13402 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index 6d14c62..0df120b 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -10,6 +10,9 @@
#include "SkCanvas.h"
#include "SkFlattenable.h"
+#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
+#include "SkMatrixClipStateMgr.h"
+#endif
#include "SkPathHeap.h"
#include "SkPicture.h"
#include "SkPictureFlat.h"
@@ -111,11 +114,13 @@
int recordRestoreOffsetPlaceholder(SkRegion::Op);
void fillRestoreOffsetPlaceholdersForCurrentStackLevel(uint32_t restoreOffset);
+#ifndef SK_COLLAPSE_MATRIX_CLIP_STATE
SkTDArray<int32_t> fRestoreOffsetStack;
int fFirstSavedLayerIndex;
enum {
kNoSavedLayerIndex = -1
};
+#endif
/*
* Write the 'drawType' operation and chunk size to the skp. 'size'
@@ -250,7 +255,7 @@
int recordClipRegion(const SkRegion& region, SkRegion::Op op);
void recordSave(SaveFlags flags);
void recordSaveLayer(const SkRect* bounds, const SkPaint* paint, SaveFlags flags);
- void recordRestore();
+ void recordRestore(bool fillInSkips = true);
// 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.
@@ -261,6 +266,9 @@
SkBitmapHeap* fBitmapHeap;
private:
+ friend class MatrixClipState; // for access to *Impl methods
+ friend class SkMatrixClipStateMgr; // for access to *Impl methods
+
SkChunkFlatController fFlattenableHeap;
SkPaintDictionary fPaints;
@@ -277,6 +285,10 @@
friend class SkPicturePlayback;
friend class SkPictureTester; // for unit testing
+#ifdef SK_COLLAPSE_MATRIX_CLIP_STATE
+ SkMatrixClipStateMgr fMCMgr;
+#endif
+
typedef SkCanvas INHERITED;
};