Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(158)

Unified Diff: src/core/SkPictureRecord.h

Issue 1409373011: Dedup SkPaths by gen-ID when going to .skp (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: comment Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPictureRecord.h
diff --git a/src/core/SkPictureRecord.h b/src/core/SkPictureRecord.h
index c305f101d760856972987229dfef7c66c6f155ce..7e21fab1120892f1fc6775af9e8801cfaaf8ea9e 100644
--- a/src/core/SkPictureRecord.h
+++ b/src/core/SkPictureRecord.h
@@ -14,6 +14,7 @@
#include "SkPictureData.h"
#include "SkTArray.h"
#include "SkTDArray.h"
+#include "SkTHash.h"
#include "SkWriter32.h"
// These macros help with packing and unpacking a single byte value and
@@ -226,7 +227,11 @@ private:
SkTArray<SkBitmap> fBitmaps;
SkTArray<SkPaint> fPaints;
- SkTArray<SkPath> fPaths;
+
+ struct PathHash {
+ uint32_t operator()(const SkPath& p) { return p.getGenerationID(); }
+ };
+ SkTHashMap<SkPath, int, PathHash> fPaths;
SkWriter32 fWriter;
« no previous file with comments | « src/core/SkPictureData.cpp ('k') | src/core/SkPictureRecord.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698