SkPDF: Fix skia:8397, reduce RAM use, stop copying ClipStacks.
In particular:
- GraphicStateEntry no longer holds copy of SkClipStack.
- ContentEntries are now usually concatinated together and include
serialized GraphicStateEntry deltas.
- One GraphicStackState is kept on the pdfdevice, for the currently
active ContentEntry.
16% reduction in RAM use for running all GMs through SkPDF.
97% reduction in RAM use for a particular test case:
SkRandom rand;
SkPaint paint;
for (int i = 400000; i-- > 0;) {
SkPoint p0 = {0, (float)rand.nextRangeU(0, 792)};
SkPoint p1 = {612, (float)rand.nextRangeU(0, 792)};
canvas->drawLine(p0, p1, paint);
}
Bug: skia:8397
Change-Id: Ieb86c0eabac45b120a97fe5c749fdb26d8a85267
Reviewed-on: https://skia-review.googlesource.com/157340
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
6 files changed