No deduping dictionaries for matrices and regions.
There's little benefit to deduping matrices and regions: they're infrequently
used, and doubly infrequently reused. Their use-weighted byte cost is tiny.
There is some downside to deduping matrices and regions. Even when they're not
used, we prepare dictionaries for deduping them for every picture. Each of
these dictionaries costs 160 bytes, so two unused dictionaries make a big chunk
of the ~1100 bytes it takes to allocate an SkPictureRecord. (~330 come from
parent class SkCanvas, 768 from SkPictureRecord itself, here reduced to 448).
One side benefit of not deduping these guys is that the change weighs -140 lines of code.
It may go without saying, but this breaks the picture format.
Testing: out/Debug/tests && out/Debug/dm (which runs all picture modes by default)
BUG=skia:1850
R=reed@google.com, bensong@google.com, robertphillips@google.com
Author: mtklein@google.com
Review URL: https://codereview.chromium.org/143883006
git-svn-id: http://skia.googlecode.com/svn/trunk@13149 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp
index 69afcfe..b83a451 100644
--- a/src/core/SkPathRef.cpp
+++ b/src/core/SkPathRef.cpp
@@ -105,11 +105,7 @@
SkDEBUGCODE((*dst)->validate();)
}
-SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer
-#ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V16_AND_ALL_OTHER_INSTANCES_TOO
- , bool newFormat, int32_t oldPacked
-#endif
- ) {
+SkPathRef* SkPathRef::CreateFromBuffer(SkRBuffer* buffer) {
SkPathRef* ref = SkNEW(SkPathRef);
bool isOval;
uint8_t segmentMask;
@@ -121,18 +117,8 @@
}
ref->fIsFinite = (packed >> kIsFinite_SerializationShift) & 1;
-
-#ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V16_AND_ALL_OTHER_INSTANCES_TOO
- if (newFormat) {
-#endif
- segmentMask = (packed >> kSegmentMask_SerializationShift) & 0xF;
- isOval = (packed >> kIsOval_SerializationShift) & 1;
-#ifndef DELETE_THIS_CODE_WHEN_SKPS_ARE_REBUILT_AT_V16_AND_ALL_OTHER_INSTANCES_TOO
- } else {
- segmentMask = (oldPacked >> SkPath::kOldSegmentMask_SerializationShift) & 0xF;
- isOval = (oldPacked >> SkPath::kOldIsOval_SerializationShift) & 1;
- }
-#endif
+ segmentMask = (packed >> kSegmentMask_SerializationShift) & 0xF;
+ isOval = (packed >> kIsOval_SerializationShift) & 1;
int32_t verbCount, pointCount, conicCount;
if (!buffer->readU32(&(ref->fGenerationID)) ||