History log of /external/skia/src/pdf/SkPDFTypes.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
c5b94988915920ed359eecec34d4fbd6bdc0a3fd 03-Oct-2017 Hal Canary <halcanary@google.com> SkPDF: consolidate two functions in SkPDFObjNumMap

Change-Id: Id815920e664ba986258867b7c35a7618a6927b0f
Reviewed-on: https://skia-review.googlesource.com/54360
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFTypes.h
80fa7cea93974b0480f35f7a5260ce78ba50420f 28-Jun-2017 Hal Canary <halcanary@google.com> SkPDF: simplify SkPDFGraphicState

- Separate graphic state objects for Stroke and Fill.
- SkPDFGraphicState::GetGraphicStateForPaint simplified.
- No more SkPDFGraphicState objects.Simplify SkPDFCanon.

All PDFs render the same. Most PDFs are slightly smaller, especially
those from captured web pages.

Change-Id: Id9605c1d7495645da558d5f378ba585cdc201bba
Reviewed-on: https://skia-review.googlesource.com/21343
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFTypes.h
5c1b360a89f85accd7dc446670f6f062c73e7e77 17-Apr-2017 Hal Canary <halcanary@google.com> src/pdf: code cleanup

* SkPDFCanon: remove unnecessary abstraction
* Make use of SkTHashMap<K, sk_sp<T>>.
* Remove unncessary struct constructors.
* More factory fns return sk_sp<T>
* SkPDFUtility::GetCachedT<T> factored out.

Change-Id: I4055a131b43fe2588fd042b769cd09fff8a3466c
Reviewed-on: https://skia-review.googlesource.com/13655
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFTypes.h
d3b65972aad96453ff4510caa3e25a2b847c6d1e 22-Mar-2017 Brian Salomon <bsalomon@google.com> Mark overridden destructors with 'override' and remove 'virtual'

This silences a new warning in clang 5.0

Change-Id: Ieb5b75a6ffed60107c3fd16075d2ecfd515b55e8
Reviewed-on: https://skia-review.googlesource.com/10006
Commit-Queue: Brian Salomon <bsalomon@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
/external/skia/src/pdf/SkPDFTypes.h
530032a18e373ee673ae96fdbfa1fae6292f8f08 18-Aug-2016 halcanary <halcanary@google.com> SkPDF: in-place font subsetting

Motivation: gross code simplification, also no bitset lookups at draw time.

SkPDFFont owns its glyph useage bitset.

SkPDFSubstituteMap goes away.

SkPDFObject interface is simplified.

SkPDFDocument tracks font usage (as hash set), not glyph usage.

SkPDFFont gets a simpler constructor.

SkPDFFont has first and last glyph set in constructor, not adjusted later.

SkPDFFont implementations are simplified.

SkPDFGlyphSet is replaced with simple SkBitSet.

SkPDFFont sizes its SkBitSets based on glyph count.

SkPDFGlyphSetMap goes away.

SkBitSet is now non-copyable.

SkBitSet now how utility methods to match old SkPDFGlyphSet.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2253283004

CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Release-GDI-Trybot,Test-Win-MSVC-GCE-CPU-AVX2-x86_64-Debug-GDI-Trybot

Review-Url: https://codereview.chromium.org/2253283004
/external/skia/src/pdf/SkPDFTypes.h
9be372041ec331f1b04c99890f92d24c59bf9dad 08-Aug-2016 halcanary <halcanary@google.com> std::move(SkTDArray)

Since we don't support MSVC2013 anymore, we can be more
succinct when defining move constructors of compound types.

GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2227673002

Review-Url: https://codereview.chromium.org/2227673002
/external/skia/src/pdf/SkPDFTypes.h
dabd4f0b799318cb6e90b69ae1ec0ed0b6d32f60 03-Aug-2016 halcanary <halcanary@google.com> SkPDF: PDFShader code modernized.

Motivation: reduce code complexity.

SkCanon stores SkPDFShader::State next to SkDFObject, not inside.

many places use sk_sp<T> rather than T* to represent ownership.

SkPDFShader::State no longer holds bitmap.

SkPDFShader::State gets move constructor, no longer heap-allocated.

Classes removed:
SkPDFFunctionShader
SkPDFAlphaFunctionShader
SkPDFImageShader

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2193973002

Review-Url: https://codereview.chromium.org/2193973002
/external/skia/src/pdf/SkPDFTypes.h
fa25106f02f26d7a149cfe57c1d4756372e0755c 29-Jul-2016 halcanary <halcanary@google.com> SkPDF: PDFStream has-a not is-a PDFDict

Motivation:
SkPDFStream and SkPDFSharedStream now work the same.

Also:
- move SkPDFStream into SkPDFTypes (it's a fundamental PDF type).
- minor refactor of SkPDFSharedStream
- SkPDFSharedStream takes unique_ptr to represent ownership

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2190883003

Review-Url: https://codereview.chromium.org/2190883003
/external/skia/src/pdf/SkPDFTypes.h
eb92cb3e84f49b5eedb22b36acffd895d6a90e5a 15-Jul-2016 halcanary <halcanary@google.com> SkPdf: smaller color serialization

SkPDFUtils now has a special function (SkPDFUtils::AppendColorComponent)
just for writing out (color/255) as a decimal with three digits of
precision.

SkPDFUnion now has a type to represent a color component. It holds a
utint_8, but calls into AppendColorComponent to serialize.

Added a unit test that tests all possible input values.
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2151863003

Review-Url: https://codereview.chromium.org/2151863003
/external/skia/src/pdf/SkPDFTypes.h
b8d6af169bf631dcb68ba5a796436434ff78be65 29-Jun-2016 martina.kollarova <martina.kollarova@intel.com> Remove unnecessary includes in src/pdf/

Use forward declaration more.

BUG=None
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2110033002

Review-Url: https://codereview.chromium.org/2110033002
/external/skia/src/pdf/SkPDFTypes.h
b8fb9934a0707e8e5f9e725502974dc2d432a815 28-Mar-2016 halcanary <halcanary@google.com> SkPDF s/SkAutoTDelete/std::unique_ptr/

GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1837553002

Review URL: https://codereview.chromium.org/1837553002
/external/skia/src/pdf/SkPDFTypes.h
bae235eb07cdfeb6dd92efa2b2143fa9e91d9d04 21-Mar-2016 halcanary <halcanary@google.com> 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

Review URL: https://codereview.chromium.org/1790023003
/external/skia/src/pdf/SkPDFTypes.h
8103a34300c5de2e85793a96c4738a33fc6eb46d 09-Mar-2016 halcanary <halcanary@google.com> SkPDF: Add sk_sp setters; .release() becomes std::move()

Note to reviewers: Start with changes to SkPDFTypes.h

Many places that had a bare pointer owning a reference are refactored to
use a sk_sp.

There remain several places where a non-owning pointer `T*` should be
replaced with `const sk_sp<T>&` to eliminate the common pattern
`sk_sp<T>(SkRef(x))`.

Committed: https://skia.googlesource.com/skia/+/9904c9212074279380e21f96575078734dbbd308
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1775043002

Review URL: https://codereview.chromium.org/1775043002
/external/skia/src/pdf/SkPDFTypes.h
51d04d3c17954f9f8629e7d8a9fe870a7b19962f 08-Mar-2016 halcanary <halcanary@google.com> Revert of SkPDF: Add sk_sp setters; .release() becomes std::move() (patchset #2 id:20001 of https://codereview.chromium.org/1775043002/ )

Reason for revert:
https://build.chromium.org/p/client.skia/builders/Linux%20Builder/builds/6405/steps/compile/logs/stdio

Original issue's description:
> SkPDF: Add sk_sp setters; .release() becomes std::move()
>
> Note to reviewers: Start with changes to SkPDFTypes.h
>
> Many places that had a bare pointer owning a reference are refactored to
> use a sk_sp.
>
> There remain several places where a non-owning pointer `T*` should be
> replaced with `const sk_sp<T>&` to eliminate the common pattern
> `sk_sp<T>(SkRef(x))`.
>
> Committed: https://skia.googlesource.com/skia/+/9904c9212074279380e21f96575078734dbbd308

TBR=bungeman@google.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1775143002
/external/skia/src/pdf/SkPDFTypes.h
9904c9212074279380e21f96575078734dbbd308 08-Mar-2016 halcanary <halcanary@google.com> SkPDF: Add sk_sp setters; .release() becomes std::move()

Note to reviewers: Start with changes to SkPDFTypes.h

Many places that had a bare pointer owning a reference are refactored to
use a sk_sp.

There remain several places where a non-owning pointer `T*` should be
replaced with `const sk_sp<T>&` to eliminate the common pattern
`sk_sp<T>(SkRef(x))`.

Review URL: https://codereview.chromium.org/1775043002
/external/skia/src/pdf/SkPDFTypes.h
ece83924384b2e9e8cd422324c44797deb99ec90 08-Mar-2016 halcanary <halcanary@google.com> SkPDF: use sk_make_sp<T> when it makes sense.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1773033002

Review URL: https://codereview.chromium.org/1773033002
/external/skia/src/pdf/SkPDFTypes.h
48810a023705ffac466adb93efdb3861cf2e197a 07-Mar-2016 halcanary <halcanary@google.com> SkPDF: s/SkAutoTUnref/sk_sp/g

Review URL: https://codereview.chromium.org/1771073002
/external/skia/src/pdf/SkPDFTypes.h
fcad44bbb1e0384620e7b738a0f5904c940a6861 06-Mar-2016 halcanary <halcanary@google.com> SkPDF: AutoTUnref<T> changes in use

::detach() -> ::release()
::operator T*() -> ::get()

This makes all use of AutoTUnref work the same as sk_sp.
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1772493002

Review URL: https://codereview.chromium.org/1772493002
/external/skia/src/pdf/SkPDFTypes.h
70d1554d8ea08ddb887550f98b9cfd0afd395d65 22-Nov-2015 halcanary <halcanary@google.com> SkPDF: add `final` keyword to leaf classes

Review URL: https://codereview.chromium.org/1461403002
/external/skia/src/pdf/SkPDFTypes.h
34422610ac22adceeabb66023120f27b96cae953 12-Oct-2015 halcanary <halcanary@google.com> SkPDF: Optionally output PDF/A-2b archive format.

Note: this format does not yet pass validation tests.

Add skia_pdf_generate_pdfa GYP flag. Default to off for now.
PDF/A files are not reproducable, so they make correctness
testing harder.

Turn the Metadata struct into te SkPDFMetadata struct. This
splits out a lot of functionality around both kinds of metadata.

When PDF/A is used, add an ID entry to the trailer.

Add SkPDFObjNumMap::addObjectRecursively.

Test with

GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
ninja -C out/Release dm
out/Release/dm --config pdf --src skp gm -w /tmp/dm

With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs
generated from GMs and SKPs render identically in Pdfium.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1394263003
/external/skia/src/pdf/SkPDFTypes.h
21f99b7733c5d468deee9f8dadd59e77ed33d5ca 09-Oct-2015 bungeman <bungeman@google.com> Revert of SkPDF: Optionally output PDF/A-2b archive format. (patchset #5 id:80001 of https://codereview.chromium.org/1394263003/ )

Reason for revert:
SkMD5 is not really part of the Skia library. This is breaking the roll by using it, since Chromium doesn't build it.

Original issue's description:
> SkPDF: Optionally output PDF/A-2b archive format.
>
> Note: this format does not yet pass validation tests.
>
> Add skia_pdf_generate_pdfa GYP flag. Default to off for now.
> PDF/A files are not reproducable, so they make correctness
> testing harder.
>
> Turn the Metadata struct into te SkPDFMetadata struct. This
> splits out a lot of functionality around both kinds of metadata.
>
> When PDF/A is used, add an ID entry to the trailer.
>
> Add SkPDFObjNumMap::addObjectRecursively.
>
> Test with
>
> GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
> ninja -C out/Release dm
> out/Release/dm --config pdf --src skp gm -w /tmp/dm
>
> With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
> SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs
> generated from GMs and SKPs render identically in Pdfium.
>
> BUG=skia:3110
>
> Committed: https://skia.googlesource.com/skia/+/939c0fe51f157104758bcb268643c8b6d317a530

TBR=tomhudson@google.com,halcanary@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:3110

Review URL: https://codereview.chromium.org/1398193002
/external/skia/src/pdf/SkPDFTypes.h
939c0fe51f157104758bcb268643c8b6d317a530 09-Oct-2015 halcanary <halcanary@google.com> SkPDF: Optionally output PDF/A-2b archive format.

Note: this format does not yet pass validation tests.

Add skia_pdf_generate_pdfa GYP flag. Default to off for now.
PDF/A files are not reproducable, so they make correctness
testing harder.

Turn the Metadata struct into te SkPDFMetadata struct. This
splits out a lot of functionality around both kinds of metadata.

When PDF/A is used, add an ID entry to the trailer.

Add SkPDFObjNumMap::addObjectRecursively.

Test with

GYP_DEFINES=skia_pdf_generate_pdfa=1 bin/sync-and-gyp
ninja -C out/Release dm
out/Release/dm --config pdf --src skp gm -w /tmp/dm

With skia_pdf_generate_pdfa=0, all PDFs generated from GMs and
SKPs are identical. With skia_pdf_generate_pdfa=1, all PDFs
generated from GMs and SKPs render identically in Pdfium.

BUG=skia:3110

Review URL: https://codereview.chromium.org/1394263003
/external/skia/src/pdf/SkPDFTypes.h
7a14b310d6c618fa2151d93a43b29f9599adc32a 01-Oct-2015 halcanary <halcanary@google.com> SkPDF: Implement drawImage*() properly

drawImage calls now properly embeds the original jpeg.

NOTE: drawBitmap*() calls no longer embed JPEG files when
possible (this is in advance of eliminating bitmaps backed
by encoded data). Chromium has already moved from
drawBitmap to drawImage.

Comparisons:

control:
total PDF drawImage/drawBitmap calls: 8010
total PDF jpeg images: 0
total PDF regular images: 3581

experiament:
total PDF drawImage/drawBitmap calls: 8014
total PDF jpeg images: 271
total PDF regular images: 3311
total PDF regular images: 3582 (271 + 3311)

When comparing rendered output there were perceptual
differences in the following four GMs: colorcube, emboss,
colormatrix, and tablecolorfilter. All of these differences
were improvements (that is, closer to the 8888 rendering)
due fixing a bug with colorfilters and forgetting to call
notifyPixelsChanged.

No SKPs had perceptual differences.

Total PDF size dropped from 133964 kB to 126276 kB, a 5.7%
improvement (mostly due to restoring use of JPG images in
SKPs).

BUG=skia:4370

Review URL: https://codereview.chromium.org/1372783003
/external/skia/src/pdf/SkPDFTypes.h
385fe4d4b62d7d1dd76116dd570df3290a2f487b 26-Aug-2015 halcanary <halcanary@google.com> Style Change: SkNEW->new; SkDELETE->delete
DOCS_PREVIEW= https://skia.org/?cl=1316123003

Review URL: https://codereview.chromium.org/1316123003
/external/skia/src/pdf/SkPDFTypes.h
725c62054354dc0c7fb699bcd69687ec78083ae8 20-Aug-2015 halcanary <halcanary@google.com> SkPDF: Memory improvements for PDF Streams

ΔMEM = -15%
ΔCPU = -7%

BUG=skia:3030

Review URL: https://codereview.chromium.org/1227913008
/external/skia/src/pdf/SkPDFTypes.h
99fe82260633fcf5d92cca38d12ef0937ecca61c 20-Aug-2015 bungeman <bungeman@google.com> Use static_assert instead of SK_COMPILE_ASSERT.

Now that static_assert is allowed, there is no need to use a non-
standard compile time assertion

Review URL: https://codereview.chromium.org/1306443004
/external/skia/src/pdf/SkPDFTypes.h
a060eba0836f98902ca078d5f9fc6191ba0c0a52 19-Aug-2015 halcanary <halcanary@google.com> SkPDF: Simplify PDFStream / emitObject() const

Compress SkPDFStream's data on setData(), not emitObject(); no longer stateful.

SkPDFObject::emitObject is now const. This makes it easier to reason about state.

Minimal performance gains.

Review URL: https://codereview.chromium.org/1304493002
/external/skia/src/pdf/SkPDFTypes.h
2766c00fc0b6a07d46e5f74cdad45da2ef625237 26-Jun-2015 mtklein <mtklein@chromium.org> remove SkInstCnt

It's been outclassed by Valgrind and leak sanitizer,
and it seems to be causing problems for external folks building Skia.

I'm not sure why our own builds seem unaffected.

Latest thread:
https://groups.google.com/forum/#!topic/skia-discuss/oj9FsQwwSF0

BUG=skia:

Review URL: https://codereview.chromium.org/1217573002
/external/skia/src/pdf/SkPDFTypes.h
bc4696b9176e05940a7c2d6778276cdbc55ccd61 06-May-2015 halcanary <halcanary@google.com> SkPDF: Move utility fns to SkPDFUtils

BUG=skia:3585

Review URL: https://codereview.chromium.org/1124193003
/external/skia/src/pdf/SkPDFTypes.h
002653e78c1eef4430abe457f6f91add24a69093 05-May-2015 halcanary <halcanary@google.com> SkPDF: Remove unused deprecated functions in SkPDFTypes

depends on:
http://crrev.com/1107923002
http://crrev.com/1103163002
http://crrev.com/1110533002
http://crrev.com/1107913002
http://crrev.com/1106163002

BUG=skia:3585

Review URL: https://codereview.chromium.org/1113583002
/external/skia/src/pdf/SkPDFTypes.h
f7a169e225b6c5c7e79e14f6713256b4b8b9ab7f 01-May-2015 halcanary <halcanary@google.com> SkPDF: clean up uses of deprecated calls in tests

BUG=skia:3585

Review URL: https://codereview.chromium.org/1106163002
/external/skia/src/pdf/SkPDFTypes.h
f4219ddf31b2171a5576ab98d1fd2deab4d816fd 28-Apr-2015 tfarina <tfarina@chromium.org> Update more directories under src/ to follow C++11 style rule for {virtual,override}.

The Google style guide states that only one of {virtual,override,final}
should be used for each declaration, since override implies virtual and
final implies both virtual and override.

The entries were found using the following command line:

$ find src/ -iname "*.h" -o -iname "*.cpp" | xargs pcregrep -M
"[^\n/]+virtual\ [^;{]+\ [a-zA-Z0-9_]+\([^;{]+\ override[ \n]*[;{]"

The regex was a courtesy of nick@chromium.org

BUG=None
R=mtklein@google.com

Review URL: https://codereview.chromium.org/1110013002
/external/skia/src/pdf/SkPDFTypes.h
a25b3371a7209105e6c05f7bbb53d19e2b14498b 27-Apr-2015 halcanary <halcanary@google.com> SkPDF: clean up uses of deprecated calls in other SkPDF classes

BUG=skia:3585

Review URL: https://codereview.chromium.org/1107923002
/external/skia/src/pdf/SkPDFTypes.h
130444fdaf737c5931a934018ab50b0c91a3499e 25-Apr-2015 halcanary <halcanary@google.com> SkPDF: Refactor SkPDFObject heiararchy.

Flatten and use a tagged union type

Δmemory ~= -2.4% ± 0.5%
Δtime ~= -1.2% ± 0.2%

BUG=skia:3585

Review URL: https://codereview.chromium.org/1069103003
/external/skia/src/pdf/SkPDFTypes.h
2ad228e8ff3ad7050c58d563879b9831c688e2f1 08-Apr-2015 halcanary <halcanary@google.com> SkPDF: Remove Array's unused set(i) and get(i) (leaving only append())

BUG=skia:3585

Review URL: https://codereview.chromium.org/1071583003
/external/skia/src/pdf/SkPDFTypes.h
bb264b775004be3df72f0bb5ee613761a328a6c3 07-Apr-2015 halcanary <halcanary@google.com> SkPDF: SkPDFString is no longer aware of wide strings.

Since wide strings are only used in SkPDFDevice, I have moved the
function that manages them to that directory.

Motivation: The SkPDFString will be refactored later along with the
other SkPFObject heirarchy.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1064013003
/external/skia/src/pdf/SkPDFTypes.h
37c46cad21632cfc1411b08d73af37a1fffe2944 31-Mar-2015 halcanary <halcanary@google.com> SkPDF: Factor SkPDFCatalog into SkPDFObjNumMap and SkPDFSubstituteMap

Motivation: Keep separate features separate. Also, future
linearization work will need to have several objNumMap
objects share a substituteMap. Also "catalog" has a
specific meaning in PDF. This catalog did not map to that
catalog.

- Modify SkPDFObject::emitObject and SkPDFObject::addResources
interface to requiore SkPDFObjNumMap and SkPDFSubstituteMap.
- SkPDFObjNumMap const in SkPDFObject::emitObject.
- Remove SkPDFCatalog.cpp/.h
- Modify SkDocument_PDF.cpp to use new functions
- Fold in SkPDFStream::populate
- Fold in SkPDFBitmap::emitDict
- Move SkPDFObjNumMap and SkPDFSubstituteMap to SkPDFTypes.h
- Note (via assert) that SkPDFArray & SkPDFDict don't need to
check substitutes.
- Remove extra space from SkPDFDict serialization.
- SkPDFBitmap SkPDFType0Font SkPDFGraphicState SkPDFStream
updated to new interface.
- PDFPrimitivesTest updated for new interface.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1049753002
/external/skia/src/pdf/SkPDFTypes.h
36352bf5e38f45a70ee4f4fc132a38048d38206d 26-Mar-2015 mtklein <mtklein@chromium.org> C++11 override should now be supported by all of {bots,Chrome,Android,Mozilla}

NOPRESUBMIT=true

BUG=skia:
DOCS_PREVIEW= https://skia.org/?cl=1037793002

Review URL: https://codereview.chromium.org/1037793002
/external/skia/src/pdf/SkPDFTypes.h
d4714af018158c15e13439bef2c9b5bafc25c1d7 25-Mar-2015 halcanary <halcanary@google.com> SkPDF SkPDFObject::addResources signature simplified

- SkPDFcatalog keeps a ordered list of object pointers
- Elimiante SkTSet template class
- SkPDFObject::addResources signature changes

BUG=skia:3585

Review URL: https://codereview.chromium.org/1038523004
/external/skia/src/pdf/SkPDFTypes.h
c1b71d6c30041f01675dd54a77adc9c177afdf44 20-Feb-2015 halcanary <halcanary@google.com> PDF: remove unnecessary mutexes.

We now force all SkPDFObjects to stay on one thread.

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/942153002
/external/skia/src/pdf/SkPDFTypes.h
bf799cd228282431e6311900dd383083f8af7164 10-Feb-2015 halcanary <halcanary@google.com> Simplify reference management in SkPDF

Prior to this change, SkPDFObject subclasses were required
to track their resources separately from the document
structure. (An object has a resource if it depends, via an
indirect reference, on another object). This led to a lot
of extra code to duplicate effort. I replace the
getResources() function with the much simpler addResources()
function. I only define a non-trivial addResources() method
on arrays, dictionaries, and indirect object references.
All other specialized classes simply rely on their parent
class's implementation.

SkPDFObject::addResources() works by recursively walking the
directed graph of object (direct and indirect) references
and adding resources to a set. It doesn't matter that there
are closed loops in the graph, since we check the set before
walking down a branch.

- Add SkPDFObject::addResources() virtual function, with
four implementations
- Remove SkPDFObject::getResources() virtual function and
all implementations.
- Remove SkPDFObject::GetResourcesHelper()
- Remove SkPDFObject::AddResourceHelper()
- In SkPDFCatalog::findObjectIndex(), add an object to the
catalog if it doesn't exist yet.
- SkPDFCatalog::setSubstitute() no longer sets up resources
- SkPDFDocument.cpp no longer needs the Streamer object
- SkPDFDocument.cpp calls fDocCatalog->addResources to build
the resource list.
- SkPDFFont::addResource() removed
- All SkPDF-::fResource sets removed (they are redundant).
- removed SkPDFImage::addSMask() function
- SkPDFResourceDict::getReferencedResources() removed.

Motivation: this removes quite a bit of code and makes the
objects slightly slimmer in memory. Most importantly, this
will lead the way towards removing SkPDFObject's inheritance
from SkRefCnt, which will greatly simplify everything.

Testing: I usually test changes to the PDF backend by
comparing checksums of PDF files rendered from GMs and SKPs
before and after the change. This change both re-orders and
re-numbers the indirect PDF objects. I used the qpdf
program to normalize the PDFs and then compared the
normalized outputs from before and after the change; they
matched.

Review URL: https://codereview.chromium.org/870333002
/external/skia/src/pdf/SkPDFTypes.h
7b274c78fbeefa3818af68099545f2839c854847 03-Feb-2015 mtklein <mtklein@chromium.org> Port SkRefCnt.h to new SkAtomics.h

This adds sk_memory_barrier(), implemented using sk_atomic_fetch_add() on an uninitialized variable. If that becomes a problem we can drop this to the porting layer, using std::atomic_thread_fence() / __atomic_thread_fence() / __sync_synchronize().

The big win is that ref() doesn't generate a memory barrier any more on ARM.
This is an instance of SkSafeRef() in SkPaint(const SkPaint&) after this CL:
4d0: 684a ldr r2, [r1, #4]
4d2: 6018 str r0, [r3, #0]
4d4: b13a cbz r2, 4e6 <_ZN7SkPaintC1ERKS_+0x2e>
4d6: 1d10 adds r0, r2, #4
4d8: e850 4f00 ldrex r4, [r0]
4dc: 3401 adds r4, #1
4de: e840 4500 strex r5, r4, [r0]
4e2: 2d00 cmp r5, #0
4e4: d1f8 bne.n 4d8 <_ZN7SkPaintC1ERKS_+0x20>

Here's the before, pretty much the same with two memory barriers surrounding the ref():
4d8: 684a ldr r2, [r1, #4]
4da: 6018 str r0, [r3, #0]
4dc: b15a cbz r2, 4f6 <_ZN7SkPaintC1ERKS_+0x3e>
4de: 1d10 adds r0, r2, #4
4e0: f3bf 8f5f dmb sy
4e4: e850 4f00 ldrex r4, [r0]
4e8: 3401 adds r4, #1
4ea: e840 4500 strex r5, r4, [r0]
4ee: 2d00 cmp r5, #0
4f0: d1f8 bne.n 4e4 <_ZN7SkPaintC1ERKS_+0x2c>
4f2: f3bf 8f5f dmb sy

The miscellaneous files in here are just fixups to explicitly include SkMutex.h,
instead of leeching it off SkRefCnt.h.

No public API changes.
TBR=reed@google.com

Build trybots seem hosed.
NOTRY=true

BUG=skia:

Review URL: https://codereview.chromium.org/896803002
/external/skia/src/pdf/SkPDFTypes.h
6a144345d742a53ffb15bbd83f2718022fca8df5 23-Jan-2015 halcanary <halcanary@google.com> Cleanup SkPDFObject::emit*

Review URL: https://codereview.chromium.org/869783003
/external/skia/src/pdf/SkPDFTypes.h
f361b714390422a5c2a8b1dacb8e67502d0e40bb 13-Jan-2015 halcanary <halcanary@google.com> In SkPDFDocument::emitPDF(), stop pre-calculating file offsets.

* Add Streamer utility class which measures the current
pdf offset by calling SkWStream::bytesWritten(). Calls
SkPDFCatalog::setFileOffset() and SkPDFObject::emit() at
the same time to guarantee that everything works out.

* SkPDFCatalog::setFileOffset() no longer calculates the
object's size.

* SkPDFCatalog::setSubstituteResourcesOffsets() removed.

* SkPDFCatalog::emitSubstituteResources() removed and
getSubstituteList() made public in its place.

* Remove SkPDFPage::getPageSize and SkPDFPage::emitPage.
Replace with SkPDFPage::getContentStream().

* SkPDFObject::getOutputSize no longer virtual, only used in
unit tests. All SkPDFObject subclasses getOutputSize()
overrides removed.

* SkPDFObject::getIndirectOutputSize removed.

* PDFPrimitivesTest updated for new functions.

Review URL: https://codereview.chromium.org/846023003
/external/skia/src/pdf/SkPDFTypes.h
4fc48af0d7bec93a911d32330f251386a8adec98 12-Jan-2015 halcanary <halcanary@google.com> Change function signature of SkPDFObject::emitObject.

Replace virutal SkPDFObject::emitObject(s, c, true) with non-virtual
SkPDFObject::emitIndirectObject(s, c), since none of the subclasses do
(or should do) anything different.

Replace object->emitObject(s, c, false) with object->emitObject(s, c)

This is one step in simplifying the SkPDFObject interface to allow for
the next step in refactoring.

Review URL: https://codereview.chromium.org/827733004
/external/skia/src/pdf/SkPDFTypes.h
1f8ed022226c9f960b9fc95af9297d5111a07ead 27-Jun-2014 halcanary <halcanary@google.com> Add lock to SkPDFDict

Add mutex lock to all functions. Remove dictionary iterator, and
replace with new thread-safe functions.

BUG=skia:2683
R=mtklein@google.com, djsollen@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/360473005
/external/skia/src/pdf/SkPDFTypes.h
aec406650cbfa4ef65d83db5ff4f82572e8e098f 18-Apr-2014 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix int/size_t warnings

patch from issue 239933002

BUG=skia:
R=bungeman@google.com

Review URL: https://codereview.chromium.org/242113010

git-svn-id: http://skia.googlecode.com/svn/trunk@14259 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
6addb1930013ebb2f984045141650fd7afcfa90f 02-Apr-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the meantime we
added capability to collect minidump and callstack if buildbot fails with heap
coruption in windows, and a NPE bug was fixed in SkPDFDocument, when document was destroyed without ever beeing used and a field was NULL + a few minor conflicts have been resolved)

git-svn-id: http://skia.googlecode.com/svn/trunk@8487 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
acef3c408216f7ef41bad1532f7946dc067f2bae 20-Mar-2013 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Reverting r8233 (Use SkSet in PDF)



git-svn-id: http://skia.googlecode.com/svn/trunk@8255 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
66bedbb02dbd252f46c1fad862d0561a0bb3f94b 19-Mar-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> resubmit https://code.google.com/p/skia/source/detail?r=7883 (in the meantime we added capability to collect minidump and callstack if buildbot fails with heap coruption in windows. a few minor conflicts have been resolved)
Review URL: https://codereview.chromium.org/12840004

git-svn-id: http://skia.googlecode.com/svn/trunk@8233 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
aa537d4bdb2384cdcd0644a02a2ab7fb0ecdd3b3 28-Feb-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Make SkTDArray accessors const-friendly.

This change creates const and non-const versions of SkTDArray::begin(), end(), operator[]() and getAt(). This will keep us from inadvertently changing a const SkTDArray, which the previous signatures allowed.

Review URL: https://chromiumcodereview.appspot.com/12315131

git-svn-id: http://skia.googlecode.com/svn/trunk@7902 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
5bd26d32ab85d09dccabbdc6dd944ef36ac32423 28-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> revert r7892

git-svn-id: http://skia.googlecode.com/svn/trunk@7896 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
194b7cdb5024719aeb7e2878f69b8f4b144aa9c4 27-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> resubmit after fixing assert issue: https://codereview.appspot.com/6744050

git-svn-id: http://skia.googlecode.com/svn/trunk@7892 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
d1c53aae59ee44377be8bc0cc15e54d46aa530ce 27-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert r7883

git-svn-id: http://skia.googlecode.com/svn/trunk@7884 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
676aef05ab1b8e913032648470ff483185e92b51 27-Feb-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Use SkSet to fix issue when pdf generates an exp number of resources.

The problem fixed - http://code.google.com/p/skia/issues/detail?id=940 - is that getResources will recursively obtain all child resource recursively without checking for duplicates.

If we have lots of duplicates, then we try to build a very large vector (exponential with the number of nodes usually) and sooner or later we end up using too much memory and crash.

A possible solution could have been to make sure resources do not have duplicates, but that requirement is impractical, and it this leaves the solution fragile, if there is any issue in the tree, we crash.

When we emit the pdf, the large number of duplicates is not an issue, because SkPDFCatalog::addObject will deal with duplicates.

I have run the gm with --config pdf, and the images are 100% same bits, while the pdfs have the same size but some very small changes, the order of some objects.
Review URL: https://codereview.appspot.com/6744050

git-svn-id: http://skia.googlecode.com/svn/trunk@7883 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
d96d17b9c113ac694138224249ff2ce643e961dd 04-Jan-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SkRefPtr

(resubmit of https://codereview.appspot.com/7030059/)
TBR=junov@google.com

Review URL: https://codereview.appspot.com/7030065

git-svn-id: http://skia.googlecode.com/svn/trunk@7030 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
6eb549e8ca3d88d7536859fd5aa3343fc3011f2f 04-Jan-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Remove SkRefPtr" - r7021

samplecode/ still needs to be updated.

Review URL: https://codereview.appspot.com/7032048

git-svn-id: http://skia.googlecode.com/svn/trunk@7022 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
e8a76ae8edc4f90456f9d8f90e56bf97f2657f3a 04-Jan-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Remove SkRefPtr

Review URL: https://codereview.appspot.com/7030059

git-svn-id: http://skia.googlecode.com/svn/trunk@7021 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
d6176b0dcacb124539e0cfd051e6d93a9782f020 23-Aug-2012 rmistry@google.com <rmistry@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Result of running tools/sanitize_source_files.py (which was added in https://codereview.appspot.com/6465078/)

This CL is part II of IV (I broke down the 1280 files into 4 CLs).
Review URL: https://codereview.appspot.com/6474054

git-svn-id: http://skia.googlecode.com/svn/trunk@5263 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
3b429984664e88e0530eb6a1461a828898d8d96b 26-Jun-2012 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> stick SkInstCnt in more classes, to help track down leaks



git-svn-id: http://skia.googlecode.com/svn/trunk@4341 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
4d73ac22a1b99402fc8cff78a4eb4b27aa8fe019 13-Jun-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Version 2 of the Instance Counting system. This one simplifies the print out of information.

http://codereview.appspot.com/6296069/



git-svn-id: http://skia.googlecode.com/svn/trunk@4255 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
7d6c8f997f8fe2c222f9d6d31f984c2e7cf16cc5 22-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Move most of the headers to be private.

Compute font stats in SkPDFDocument in order to make more of the headers private.

Previous review: https://codereview.appspot.com/5868049/

Review URL: https://codereview.appspot.com/5875049

git-svn-id: http://skia.googlecode.com/svn/trunk@3470 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
76d6de0845910f18306125bbcaef7edf6e8f6649 21-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "[PDF] Move most of the headers to be private."

This reverts r3457

TBR=epoger@google.com

Review URL: https://codereview.appspot.com/5866051

git-svn-id: http://skia.googlecode.com/svn/trunk@3458 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
bd960c7f1915c73ceec1c1ee7cd23b48107cb0bd 21-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Move most of the headers to be private.

Compute font stats in SkPDFDocument in order to make more of the headers private.

Previous review: https://codereview.appspot.com/5865048/

Review URL: https://codereview.appspot.com/5868049

git-svn-id: http://skia.googlecode.com/svn/trunk@3457 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
008c498b58e674c6fe595a359e3adbafddd05540 21-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "[PDF] Move most of the headers to be private."

This reverts r3453

TBR=epoger@google.com

Review URL: https://codereview.appspot.com/5869048

git-svn-id: http://skia.googlecode.com/svn/trunk@3454 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h
f7f9aa8bd957766ebf6a296360a2d5857abed265 21-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Move most of the headers to be private.

Compute font stats in SkPDFDocument in order to make more of the headers private.

Review URL: https://codereview.appspot.com/5865048

git-svn-id: http://skia.googlecode.com/svn/trunk@3453 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFTypes.h