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

Issue 1790023003: SkPDF: add drop() virtual to release resources early. (Closed)

Created:
4 years, 9 months ago by hal.canary
Modified:
4 years, 9 months ago
Reviewers:
djsollen, mtklein, tomhudson
CC:
reviews_skia.org
Base URL:
https://skia.googlesource.com/skia.git@skpdf-global
Target Ref:
refs/heads/master
Project:
skia
Visibility:
Public.

Description

SkPDF: add drop() virtual to release resources early. Call drop() after calling emitObject() on top-level objects. In Debug mode, assert that each object is emited exactly once by asserting that emitObject is never called after drop(). Same for addResources(). To make sure that top level objects don't get deleted prematurely, SkPDFObjNumMap takes a reference. Motivation: save RAM. Allow even earlier serialization with later changes. Also: Switch some SkTDArrays to SkTArrays. BUG=skia:5087 GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1790023003 Committed: https://skia.googlesource.com/skia/+/bae235eb07cdfeb6dd92efa2b2143fa9e91d9d04

Patch Set 1 #

Patch Set 2 : 2016-03-12 (Saturday) 16:04:48 EST #

Patch Set 3 : Record move fns #

Total comments: 24

Patch Set 4 : 2016-03-18 (Friday) 16:56:13 EDT #

Patch Set 5 : 2016-03-18 (Friday) 17:17:54 EDT #

Patch Set 6 : free → release #

Unified diffs Side-by-side diffs Delta from patch set Stats (+122 lines, -67 lines) Patch
M bench/PDFBench.cpp View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M src/pdf/SkPDFBitmap.cpp View 1 2 3 4 3 chunks +11 lines, -5 lines 0 comments Download
M src/pdf/SkPDFDocument.cpp View 1 2 3 3 chunks +3 lines, -2 lines 0 comments Download
M src/pdf/SkPDFFont.h View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/pdf/SkPDFFont.cpp View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M src/pdf/SkPDFStream.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M src/pdf/SkPDFStream.cpp View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M src/pdf/SkPDFTypes.h View 1 2 3 4 10 chunks +28 lines, -25 lines 0 comments Download
M src/pdf/SkPDFTypes.cpp View 1 2 3 4 5 8 chunks +64 lines, -34 lines 0 comments Download

Messages

Total messages: 37 (16 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1790023003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1790023003/1
4 years, 9 months ago (2016-03-12 20:32:25 UTC) #3
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-GCC-Arm7-Debug-Android-Trybot/builds/7058)
4 years, 9 months ago (2016-03-12 20:33:36 UTC) #5
hal.canary
please take a look. depends on http://crrev.com/1788263002 further changes will allow some objects to be ...
4 years, 9 months ago (2016-03-12 20:34:20 UTC) #7
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1790023003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1790023003/20001
4 years, 9 months ago (2016-03-12 21:05:26 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: Build-Win-MSVC-x86-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Win-MSVC-x86-Debug-Trybot/builds/7075)
4 years, 9 months ago (2016-03-12 21:08:57 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1790023003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1790023003/40001
4 years, 9 months ago (2016-03-13 22:37:44 UTC) #13
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 9 months ago (2016-03-13 22:46:54 UTC) #15
hal.canary
Adding tom.
4 years, 9 months ago (2016-03-14 23:05:17 UTC) #17
tomhudson
https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp File src/pdf/SkPDFBitmap.cpp (right): https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp#newcode385 src/pdf/SkPDFBitmap.cpp:385: PDFAlphaBitmap(const SkImage* image) : fImage(SkRef(image)) { SkASSERT(image); } You ...
4 years, 9 months ago (2016-03-18 13:59:38 UTC) #18
mtklein
https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFTypes.h File src/pdf/SkPDFTypes.h (right): https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFTypes.h#newcode59 src/pdf/SkPDFTypes.h:59: virtual void dump() {} We usually use dump() to ...
4 years, 9 months ago (2016-03-18 14:03:26 UTC) #20
tomhudson
https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFTypes.h File src/pdf/SkPDFTypes.h (right): https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFTypes.h#newcode59 src/pdf/SkPDFTypes.h:59: virtual void dump() {} On 2016/03/18 14:03:26, mtklein wrote: ...
4 years, 9 months ago (2016-03-18 14:11:55 UTC) #21
hal.canary
https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp File src/pdf/SkPDFBitmap.cpp (right): https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp#newcode385 src/pdf/SkPDFBitmap.cpp:385: PDFAlphaBitmap(const SkImage* image) : fImage(SkRef(image)) { SkASSERT(image); } On ...
4 years, 9 months ago (2016-03-18 21:18:07 UTC) #22
tomhudson
https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp File src/pdf/SkPDFBitmap.cpp (right): https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp#newcode386 src/pdf/SkPDFBitmap.cpp:386: ~PDFAlphaBitmap() {} On 2016/03/18 21:18:07, Hal Canary wrote: > ...
4 years, 9 months ago (2016-03-21 13:54:30 UTC) #24
mtklein
https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp File src/pdf/SkPDFBitmap.cpp (right): https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp#newcode386 src/pdf/SkPDFBitmap.cpp:386: ~PDFAlphaBitmap() {} On 2016/03/21 13:54:30, tomhudson wrote: > On ...
4 years, 9 months ago (2016-03-21 14:11:15 UTC) #25
tomhudson
On 2016/03/21 14:11:15, mtklein wrote: > https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp > File src/pdf/SkPDFBitmap.cpp (right): > > https://codereview.chromium.org/1790023003/diff/40001/src/pdf/SkPDFBitmap.cpp#newcode386 > ...
4 years, 9 months ago (2016-03-21 14:37:49 UTC) #26
tomhudson
lgtm
4 years, 9 months ago (2016-03-21 14:38:05 UTC) #27
mtklein
> Thanks, Mike. It feels like patching over all the holes in my modern C++ ...
4 years, 9 months ago (2016-03-21 14:44:45 UTC) #28
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1790023003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1790023003/80001
4 years, 9 months ago (2016-03-21 16:46:43 UTC) #30
commit-bot: I haz the power
Try jobs failed on following builders: Build-Ubuntu-Clang-x86_64-Debug-Trybot on client.skia.compile (JOB_FAILED, http://build.chromium.org/p/client.skia.compile/builders/Build-Ubuntu-Clang-x86_64-Debug-Trybot/builds/7237)
4 years, 9 months ago (2016-03-21 16:48:30 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1790023003/100001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1790023003/100001
4 years, 9 months ago (2016-03-21 16:55:40 UTC) #35
commit-bot: I haz the power
4 years, 9 months ago (2016-03-21 17:05:26 UTC) #37
Message was sent while issue was closed.
Committed patchset #6 (id:100001) as
https://skia.googlesource.com/skia/+/bae235eb07cdfeb6dd92efa2b2143fa9e91d9d04

Powered by Google App Engine
This is Rietveld 408576698