aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecord.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/SkPictureRecord.h')
-rw-r--r--src/core/SkPictureRecord.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index 96809bf45c..4d0e96296f 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -86,12 +86,27 @@ public:
}
void reset();
+ void setFlags(uint32_t recordFlags) {
+ fRecordFlags = recordFlags;
+ }
const SkWriter32& writeStream() const {
return fWriter;
}
+ bool shouldFlattenPixels(const SkBitmap&) const;
private:
+ struct PixelRefDictionaryEntry {
+ uint32_t fKey; // SkPixelRef GenerationID.
+ uint32_t fIndex; // Index of corresponding flattened bitmap in fBitmaps.
+ bool operator < (const PixelRefDictionaryEntry& other) const {
+ return this->fKey < other.fKey;
+ }
+ bool operator != (const PixelRefDictionaryEntry& other) const {
+ return this->fKey != other.fKey;
+ }
+ };
+
SkTDArray<uint32_t> fRestoreOffsetStack;
int fFirstSavedLayerIndex;
enum {
@@ -127,6 +142,8 @@ private:
void addRegion(const SkRegion& region);
void addText(const void* text, size_t byteLength);
+ int find(const SkBitmap& bitmap);
+
#ifdef SK_DEBUG_DUMP
public:
void dumpMatrices();
@@ -163,6 +180,8 @@ public:
private:
SkChunkAlloc fHeap;
+
+ SkTDArray<PixelRefDictionaryEntry> fPixelRefDictionary;
SkBitmapDictionary fBitmaps;
SkMatrixDictionary fMatrices;
SkPaintDictionary fPaints;