aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPictureRecord.h
diff options
context:
space:
mode:
authorGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-01 21:23:07 +0000
committerGravatar junov@chromium.org <junov@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-06-01 21:23:07 +0000
commit4866cc0afb7571309d9fdecb221d919f663054c0 (patch)
tree3696433e73defaa1a3d8ec92da58b9877ba7fc91 /src/core/SkPictureRecord.h
parent898e7b568f535fc62a92acda3c22a68cb6e04dcc (diff)
Adding option to serialize mutable bitmaps in SkPicture
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;