History log of /external/skia/src/pdf/SkPDFGraphicState.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/SkPDFGraphicState.h
c02de0b844fdb04e28e45ed5bbdd5eb0935c42d2 28-Jun-2017 Hal Canary <halcanary@google.com> SkPDF: Clean up

- Use clearMaskOnGraphicState()
- SkPDFGraphicState::MakeNoSmaskGraphicState now moved to only caller.
- Get rid of clunky SkPDFUtils::GetCachedT

Change-Id: If76a1e915fc31e3ce2654fbe620ff44c1820c0e7
Reviewed-on: https://skia-review.googlesource.com/21142
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.h
374772bd61951f01bf84fe17bf53d8867681c9ae 06-Oct-2016 reed <reed@google.com> Revert[8] "replace SkXfermode obj with SkBlendMode enum in paints"

This reverts commit c245574ba3d0e2ade6c94b2812de3baa383bf4c4.

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

TBR=

Review-Url: https://codereview.chromium.org/2396953002
/external/skia/src/pdf/SkPDFGraphicState.h
c245574ba3d0e2ade6c94b2812de3baa383bf4c4 05-Oct-2016 Mike Reed <reed@google.com> Revert[7] "replace SkXfermode obj with SkBlendMode enum in paints"

This reverts commit Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8.

Reason for revert: new assert from 100K bot

Original change's description:
> Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints"
>
> - perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter
> This reverts commit 3ed485f4249e17abb4b11f5018d03175fd1afb44.
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2992
>
> Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8
> Reviewed-on: https://skia-review.googlesource.com/2992
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
>

TBR=reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I848e5a69c5cd67f2c14889f4f0a346652578c4ff
Reviewed-on: https://skia-review.googlesource.com/3023
Commit-Queue: Mike Reed <reed@google.com>
Reviewed-by: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.h
2b2fc7db4f8a4a4d4a51d7eb4df6aa62e309928d 05-Oct-2016 Mike Reed <reed@google.com> Revert[6] "replace SkXfermode obj with SkBlendMode enum in paints"

- perform version check in CreateProc for XfermodeImageFilter and ArithmeticImageFilter
This reverts commit 3ed485f4249e17abb4b11f5018d03175fd1afb44.

BUG=skia:

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

Change-Id: Ib4a154cdd5f5d1dcac921ef50d53b79a2d6a1be8
Reviewed-on: https://skia-review.googlesource.com/2992
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.h
3ed485f4249e17abb4b11f5018d03175fd1afb44 04-Oct-2016 Mike Reed <reed@google.com> Revert[5] "replace SkXfermode obj with SkBlendMode enum in paints"

This reverts commit I0fa5c58af428f3da8565465d1219a34ef8417d9a.

Reason for revert: failing to deserialize some of the 100K

Original change's description:
> Revert[4] "replace SkXfermode obj with SkBlendMode enum in paints"
>
> This reverts commit 2cbcd12281ee807214df094964c584c78932e10b.
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2924
>
> Change-Id: I0fa5c58af428f3da8565465d1219a34ef8417d9a
> Reviewed-on: https://skia-review.googlesource.com/2924
> Reviewed-by: Mike Reed <reed@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
>

TBR=reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I1805a57eef5ebcac203da5989c8539345ecf806f
Reviewed-on: https://skia-review.googlesource.com/2962
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.h
1834242ec6e3cd62669227d394bc79e1cd66dcfb 04-Oct-2016 Mike Reed <reed@google.com> Revert[4] "replace SkXfermode obj with SkBlendMode enum in paints"

This reverts commit 2cbcd12281ee807214df094964c584c78932e10b.

BUG=skia:

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

Change-Id: I0fa5c58af428f3da8565465d1219a34ef8417d9a
Reviewed-on: https://skia-review.googlesource.com/2924
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.h
2cbcd12281ee807214df094964c584c78932e10b 03-Oct-2016 Mike Reed <reed@google.com> Revert "Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints"""

This reverts commit I86875511a13497112827cbaed1dbd7639e9e3d10.

legacy (100K) skp failure

Original change's description:
> Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints""
>
> This reverts commit ce02e7175872abde3721df9e5d3ec0ab8384cd8e.
>
> BUG=skia:
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2878
>
> Change-Id: I86875511a13497112827cbaed1dbd7639e9e3d10
> Reviewed-on: https://skia-review.googlesource.com/2878
> Reviewed-by: Matt Sarett <msarett@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
>

TBR=msarett@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: Ife6f0cf3a22b3e8cf885a188f7f44e1ff62e06a5
Reviewed-on: https://skia-review.googlesource.com/2881
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.h
70cdb396eb5ffbbed128b902532e9292b5ec0e9d 03-Oct-2016 Mike Reed <reed@google.com> Revert "Revert "replace SkXfermode obj with SkBlendMode enum in paints""

This reverts commit ce02e7175872abde3721df9e5d3ec0ab8384cd8e.

BUG=skia:

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

Change-Id: I86875511a13497112827cbaed1dbd7639e9e3d10
Reviewed-on: https://skia-review.googlesource.com/2878
Reviewed-by: Matt Sarett <msarett@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.h
ce02e7175872abde3721df9e5d3ec0ab8384cd8e 03-Oct-2016 Mike Reed <reed@google.com> Revert "replace SkXfermode obj with SkBlendMode enum in paints"

This reverts commit I4fb489ba6b3f77b458f7e4a99f79c7ad10859135.

Reason for revert: <INSERT REASONING HERE>

Original change's description:
> replace SkXfermode obj with SkBlendMode enum in paints
>
> BUG=skia:5814
>
> GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2714
>
> Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
> Reviewed-on: https://skia-review.googlesource.com/2714
> Reviewed-by: Florin Malita <fmalita@chromium.org>
> Reviewed-by: Brian Salomon <bsalomon@google.com>
> Commit-Queue: Mike Reed <reed@google.com>
>

TBR=bsalomon@google.com,fmalita@chromium.org,fmalita@google.com,reed@google.com,reviews@skia.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Change-Id: I3e43f79ef5c1709929663fe63cc1f67cd78270b7
Reviewed-on: https://skia-review.googlesource.com/2871
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.h
0591897548c8fcb7d53cc94053e01702e58f1ac5 03-Oct-2016 Mike Reed <reed@google.com> replace SkXfermode obj with SkBlendMode enum in paints

BUG=skia:5814

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

Change-Id: I4fb489ba6b3f77b458f7e4a99f79c7ad10859135
Reviewed-on: https://skia-review.googlesource.com/2714
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.h
4e97607d9a1cef66fac16f347c5ca813ec4f9515 08-Aug-2016 mtklein <mtklein@chromium.org> Use sse4.2 CRC32 instructions to hash when available.

About 9x faster than Murmur3 for long inputs.

Most of this is a mechanical change from SkChecksum::Murmur3(...) to SkOpts::hash(...).

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2208903002
CQ_INCLUDE_TRYBOTS=master.client.skia:Test-Ubuntu-GCC-GCE-CPU-AVX2-x86_64-Release-SKNX_NO_SIMD-Trybot;master.client.skia.compile:Build-Ubuntu-GCC-x86_64-Release-CMake-Trybot,Build-Mac-Clang-x86_64-Release-CMake-Trybot

Review-Url: https://codereview.chromium.org/2208903002
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.h
4b1e17edc78c0313d5cb8a415f816f654cdfa417 27-Jul-2016 halcanary <halcanary@google.com> SkPdf: SkPDFFormXObject de-class-ified.

We don't need an object, just a few standard fields on the
base class; the change lets us get rid of a bunch of
boilerplate code.

I think this also reduces the cognitive load of the SkPDF
internals.

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

Review-Url: https://codereview.chromium.org/2185803003
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.h
9d524f22bfde5dc3dc8f48e1be39bdebd3bb0304 29-Mar-2016 halcanary <halcanary@google.com> Style bikeshed - remove extraneous whitespace

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

Review URL: https://codereview.chromium.org/1842753002
/external/skia/src/pdf/SkPDFGraphicState.h
1437c1eea8f40f7a43bfe6e80a8d3f6cd61a3643 14-Mar-2016 halcanary <halcanary@google.com> SkPDF: remove all globally references SkPDFObjects

Move these singletons into SkPDFCanon (there is still a single object
per document; output PDF size will not change).

Motivation: After this change, all indirectly-referenced SkPDFObjects
are serialized exactly once. The next CL will add a memory saving
feature: a method to purge an object's resources immediately after
serialization. After that, further changes wil allow some objects to be
serialized *before* SkDocument::close(), leading to potentially very
large memory savings.

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

Review URL: https://codereview.chromium.org/1788263002
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.h
f3c15b7cfc4eed2528f7db87ea6c1444b55ee856 19-Aug-2015 bungeman <bungeman@google.com> Move SkTemplates.h to private.

SkTemplates.h contains a number of Skia specific utilities which are
not designed for external use. In addition to reducing the external
support burden, this will allow Skia to freely refactor this file.

Review URL: https://codereview.chromium.org/1272293004
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.h
be27a118c277af23377d38e9b3bfd3fcc276114f 01-Apr-2015 halcanary <halcanary@google.com> SkPDF: SkPDFGraphicState Lookup hashtabled

In Release, running `dm --src skp --config pdf`, I get a
speedup of about 1.2%.

SkPDFGraphicState class:
- Holds the subset of SkPaint that maps to a PDF Graphics
State
- These fields are easily comparable, making hashtable
comparisons easy.

SkPDFCanon:
- findGraphicState() takes a SkPDFGraphicState, not a SkPaint
- fGraphicStateRecords is a SkHashSet, not a SkTDArray

SkPDFGraphicState:
- mode_for_pdf() replaces logic inside equivalent(), but is
only called once per lookup.
- emitObject() no longer modifies the SkPDFGraphicState to
cache the SkPDFDict stucture. (Since it is de-duped,
this get no speedup).
- Static Functions that don't use the canon return a plain
SkPDFDict now. No need for fPopulated.

SkTHash.h
- SkHashSet::forall added

SkPDFDevice; SkPDFShader
- Updated for new SkPDFGraphicState interface.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1046293002
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.h
2e3f9d8a9309686eeb4c76ccfde5800da87a68b3 27-Feb-2015 halcanary <halcanary@google.com> PDF: Canon now owns a reference to all interned objects

Add SkPDFCanon::reset function to unref all objects.

No longer possible to remove object from canon

Motivation: this doesn't change these object's lifetime, (they will
still be fully unrefed when SkDocument::close() is called, but we no
longer have to remove them from the array when their destructor is
called.

Review URL: https://codereview.chromium.org/966863002
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.h
792c80f5a7b66e75d42664ccb298f31962c6654c 20-Feb-2015 halcanary <halcanary@google.com> PDF: Now threadsafe!

The PDF canvas is now just as threadsafe as any other Skia canvas.

DM updated to thread PDF tests.

SkDocument_PDF now owns SkPDFCanon, and pointers to that canon are
passed around to all classes that need access to the canon.

BUG=skia:2683

Review URL: https://codereview.chromium.org/944643002
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.h
e6ea244717feda4265b7062a0462267a0d9e1753 21-Jan-2015 halcanary <halcanary@google.com> Use SkLazyPtr in SkPDFGraphicState.cpp

Motivation: currently we rely on mutexes for guarding static
initialization. These mutexes will go away.

Review URL: https://codereview.chromium.org/815223005
/external/skia/src/pdf/SkPDFGraphicState.h
fb62b3d423fa34c672df42f47017dbef087d19e9 21-Jan-2015 halcanary <halcanary@google.com> SkPDFCanon

SkPDFCanon's fields and methods will eventually become part of
SkPDFDocument/SkDocument_PDF. For now, it exists as a singleton to
preflight that transition. This replaces three global arrays in
SkPDFFont, SkPDFShader, and SkPDFGraphicsContext. This code is still
thread-unsafe (http://skbug.com/2683), but moving this functionality
into SkPDFDocument will fix that.

This CL does not change pdf output from either GMs or SKPs.

This change also simplifies some code around the SkPDFCanon methods.

BUG=skia:2683

Review URL: https://codereview.chromium.org/842253003
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.h
ab1c13864df34aecfd4840ea7d1e4f8730b44f4e 05-Dec-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix compilation with SK_ENABLE_INST_COUNT=1

Add INHERITED declarations to class declarations that prevent
compilation with the flag.

Remove SK_DEFINE_INST_COUNT from all class implementations. Instead,
use function-local static variables in the reference count helper
classes to create the global instances to store the needed info. The
accessor functions are defined inline in the helper classes, so
definitions are not needed. The initialization point of the variables
should be as well defined as previously.

Remove SK_DECLARE_INST_COUNT_TEMPLATE and use SK_DECLARE_INST_COUNT
instead. This avoids possible future compilation errors further.

For SK_ENABLE_INST_COUNT=0 compilation, add an empty static member
function to all classes that use SK_DECLARE_INST_COUNT and
SK_DECLARE_INST_COUNT_ROOT macros. The function ensures that classes
contain public INHERITED typedef. This member function seems to be
compiled away. This shouĺd ensure that part of the compilation errors
are caught earlier.

Also adds DSK_DECLARE_INST_COUNT to few SkPDFDict subclasses.

R=robertphillips@google.com, richardlin@chromium.org, bsalomon@google.com

Author: kkinnunen@nvidia.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12501 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.h
93a2e213441c75033b04365c7d68c8d3887288ac 24-Jul-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Implemented transparent gradients

R=vandebo@chromium.org, edisonn@google.com

Author: richardlin@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10297 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.h