History log of /external/skia/src/pdf/SkPDFShader.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
7e872caaf618c8c5fc376515143a3176e09bced2 19-Jul-2017 Hal Canary <halcanary@google.com> SkPDF: SkPDFMakeShader takes the paint color.

This allows alpha blending and also alpha shaders with color blended in.

fixes GMs: composeshader_alpha, composeshader_bitmap

Change-Id: I3ab9cbef216f7733798d2e29541b4211c627dab2
Reviewed-on: https://skia-review.googlesource.com/24760
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
4f29c20f20ce62150998786be8b9f8a81a901d72 18-Jul-2017 Hal Canary <halcanary@google.com> SkPDF: Re-use Jpeg Image Shaders

Also, de-dup shader better.

- SkBitmapKeyFromImage function factors out image de-dup code.
- SkPDFUtils::ToBitmap funtion factors out to-bitmap code
- make_image_shader function now takes Image rather than Bitmap.

All tests render the same. Some are significantly smaller PDFs.

Change-Id: Id8dd36b31c8e573f44a5e9f6058d5a1d622b6385
Reviewed-on: https://skia-review.googlesource.com/24081
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
ec2576864139967dc0359c5ec5223625123354fb 06-Jul-2017 Hal Canary <halcanary@google.com> SkPDF: Change some identifiers.

s/SkPDFShader::GetPDFShader/SkPDFMakeShader/g
s/SkPDFShader::State/SkPDFImageShaderKey/g
s/state/key/g

Change-Id: I86dc932c3407c73f387c972fb6674dc09ea0be3c
Reviewed-on: https://skia-review.googlesource.com/21661
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
94fd66cc2502383628b2c5fb72a445460b752c35 05-Jul-2017 Hal Canary <halcanary@google.com> SkPDF: Refactor PDFShader to use ShTHashMap<>

my tests run ~14% faster.

- Split out gradient shaders from image shaders. new compilation
unit: SkPDFGradientShader
- Common functions InverseTransformBBox and PopulateTilingPatternDict
moved to SkPDFUtils
- Split SkPDFShader::State into image and gradient structures.
- SkPDFCanon is now a simpler structure, with no logic of its own.
I am considering just moving all of its fields into SkPDFDocument
- SkPDFShader::State (the image/fallback shader) now is POD, making
the use of a hashmap for canonicalization straightforward.
Formerly, we used a linear search.
- Do not bother trying to canonicalize the falback image shader.
- SkPDFGradientShader::Key is not POD; comparison of two objects
requires looking at the contents of two variable-sized arrays.
We now pre-calculate the hash of the arrays using SkOpts::hash and
store a hash for the object in the fHash field.
Using that hash, we can now canonicalize using a hashmap instead
of a linar search!
- several static functions renamed to follow style guidelines
- stop using codeFunction function pointer; I find that less
clear than it could be.
- operator==() for SkPDFShader::State and SkPDFGradientShader::Key is
now much simpler and can now be inlined.
- SkArrayEqual template in SkPDFUtils.h

No change to PDF output.

BUG=skia:3585
Change-Id: I354ad1b600be6d6749abccb58d13db257370bc0b
Reviewed-on: https://skia-review.googlesource.com/21376
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
a062258e76e28ef0ec88ef827ae84a90730393cc 30-Jun-2017 Hal Canary <halcanary@google.com> SkPDF: clean up fRasterDpi

- PDFDevice no longer has a fRasterDpi; simply queries document.
- #define DPI_FOR_RASTER_SCALE_ONE becomes constexpr float.
- PDFShader::GetPDFShader no longer takes rasterScale or dpi
- Remove un-needed factory functions. We're all adults here.

Change-Id: Id2ce75d4e61af385763ccfb1db210465a1600067
Reviewed-on: https://skia-review.googlesource.com/21348
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
51329c944c3021d8eb594fcb79989e6a25545c67 27-Jun-2017 Hal Canary <halcanary@google.com> SkPDF: clean up PDFDevice.

Motivation: factor out some code for later re-use; clean up.

- mask_to_greyscale_image()
- addSMaskGraphicState()
- clearMaskOnGraphicState()
- stop using bare pointer to indicate ownership.
- add ScopedContentEntry::stream()

Change-Id: I7abe7ff9eab89e1002692017000cda2ca7642631
Reviewed-on: https://skia-review.googlesource.com/20978
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
d12a67626da4f5919b48c513fee80974f603473e 26-May-2017 Hal Canary <halcanary@google.com> SkPDF: Draw paths with mask filters; color filter.

Also:
- drawPaint, drawPath w/ perspective shaders
- text with mask filters, stroking, path effect.
- SkPDFUtils::GetShaderLocalMatrix

BUG=skia:237
BUG=skia:238
BUG=skia:5607
Change-Id: Iffeaf2d7abbde13fd2577ce9feaa178657f48364
Reviewed-on: https://skia-review.googlesource.com/18200
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
4edb5d219eb99aa1e8fbe5e37260d3b34314e54b 17-Apr-2017 Mike Reed <reed@google.com> hide lockpixels api behind flag

guarded by SK_SUPPORT_OBSOLETE_LOCKPIXELS

needs https://codereview.chromium.org/2820873002/# to land first
Bug: skia:6481
Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09

Change-Id: I1c39902cbf6fe99f622adfa8192733b95f7fea09
Reviewed-on: https://skia-review.googlesource.com/13580
Reviewed-by: Florin Malita <fmalita@chromium.org>
Reviewed-by: Leon Scroggins <scroggo@google.com>
Commit-Queue: Mike Reed <reed@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
fafe135349bd34961a12bfd8185733709cd0e45e 11-Apr-2017 Hal Canary <halcanary@google.com> SkSize can be aggregate-initialized

Previosly, SkSize had a base class, which prevented it.

Also removes unused SkISize::clampNegToZero() and
SkSize::clampNegToZero().

Change-Id: I7b93b42f6f6381c66e294bbedee99ad53c6c3436
Reviewed-on: https://skia-review.googlesource.com/13187
Reviewed-by: Ben Wagner <bungeman@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
cf2e8c6139ead6a64be743e5ab2a5517ac479aba 02-Mar-2017 Hal Canary <halcanary@google.com> SkPDF: empty shader boxes bad

BUG=skia:6315
Change-Id: I48172b4deb4c55b08310e8e3d68089cfafeaa951
Reviewed-on: https://skia-review.googlesource.com/9156
Commit-Queue: Hal Canary <halcanary@google.com>
Reviewed-by: Kevin Lubick <kjlubick@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
8be952ad8c9deefe19cff36f9ad217563400f817 14-Feb-2017 Mike Reed <reed@google.com> SkScalarMul is deprecated

BUG=skia:

Change-Id: I88ecfe9d4c72506f6b1a0e0dfadd2a5c171a6cb6
Reviewed-on: https://skia-review.googlesource.com/8353
Commit-Queue: Ben Wagner <bungeman@google.com>
Reviewed-by: Ben Wagner <bungeman@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
c8f918004a86a11ac8518b56c6ce77f434205987 13-Feb-2017 Hal Canary <halcanary@google.com> SkPDF: skip shader lookup for SkShader::kColor_GradientType

Also: SkPDFShader::State isi now zero-initilized.

No change in PDF tests.

BUG=chromium:690875
Change-Id: Ibc56cc9435362733adf50cbb51b11c9413572e7f
Reviewed-on: https://skia-review.googlesource.com/8355
Reviewed-by: Florin Malita <fmalita@chromium.org>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
f50ff39f47850b86251b44381983d3b3b4f929b3 30-Sep-2016 Hal Canary <halcanary@google.com> SkPDF: subset drawImageRect while still deduping

- Replace SkImageBitmap with SkImageSubset

- SkBitmapKey becomes trivial for simplicity.

- SkPDFCanvas::onDraw(Bitmap|Image)Rect now clip and call
SkCanvas::onDraw(Bitmap|Image)Rect.

- SkPDFDevice::draw(Bitmap|BitmapRect|Sprite) now convert bitmap
into SkImageSubset via make_image_subset function.

- SkPDFDevice::draw(Image|Bitmap)Rect now implemented again.

- SkPDFDevice::internalDrawImage now performs image subsetting
as needed, while still deduping properly.

BUG=633528

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

Change-Id: I063346d12b0e9c6b6c0c4943ee25400c88aa1a44
Reviewed-on: https://skia-review.googlesource.com/2785
Reviewed-by: Ben Wagner <bungeman@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
47bf4c0009f1f2c86e831447e69475e50cbfc958 28-Sep-2016 Hal Canary <halcanary@google.com> SkPDF: use SkImage::isAImage

output size savings = ~0.4% with effected gms and skps.

BUG=568816
BUG=skia:5592

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

Change-Id: Ifead46ea5789e18aa3ddea9ca3986717296a6391
Reviewed-on: https://skia-review.googlesource.com/2760
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Hal Canary <halcanary@google.com>
/external/skia/src/pdf/SkPDFShader.cpp
d0c38315e81b399a5ea9b5ffd8661270d209203d 10-Aug-2016 halcanary <halcanary@google.com> SkPDF: bikeshed: use `auto` less

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

Review-Url: https://codereview.chromium.org/2234623002
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
f1ac18229c3f0f813a128a10111766c991f9dfcf 01-Aug-2016 reed <reed@google.com> implement isABitmap for imageshader, return localmatrix for bitmap's impl

For imageshader, I only return true if the image is explicitly raster-backed. I do not return true for texture, nor for generator (i.e. lazy/picture) backed. Is that ok?

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

Review-Url: https://codereview.chromium.org/2197323002
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
5abbb44f682038abe01b8ee63fb22439af861dda 29-Jul-2016 halcanary <halcanary@google.com> SkPDF: flip saveLayer rightside up

Broken in https://skia.googlesource.com/skia/+/4b1e17e

BUG=632574
TBR=tomhudson@google.com
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2197623002

Review-Url: https://codereview.chromium.org/2197623002
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
ac0e00dceca10dc7ce30c5be66001bd6960ebf5c 27-Jul-2016 halcanary <halcanary@google.com> SkPDF: SkPDFStream takes a unique_ptr

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

Review-Url: https://codereview.chromium.org/2188623004
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
29ed2ae2daa843c8ef955df34b26e672c67b14f3 29-Jun-2016 halcanary <halcanary@google.com> SkPDF: SkPDFStream takes only SkStreamAsset

This is possible since https://crrev.com/869763002. Later, I'll clean
up the logic and class constructors. For now, I assert everywhere I
expect a SkStreamAsset to be well-behaved (duplcate, hasLength).
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2098393002

Review-Url: https://codereview.chromium.org/2098393002
/external/skia/src/pdf/SkPDFShader.cpp
e75cdcb85b73c4484a992bf5531394632e757870 17-Jun-2016 cabanier <cabanier@adobe.com> SkPDF: Use type 2/3 shading for gradient shaders

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

Review-Url: https://codereview.chromium.org/1925233003
/external/skia/src/pdf/SkPDFShader.cpp
895f3f0544ce38d35999771754cbb1d876c14b5a 01-Apr-2016 halcanary <halcanary@google.com> SkPDF: properly dedup bitmaps in shaders

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

Review URL: https://codereview.chromium.org/1848383002
/external/skia/src/pdf/SkPDFShader.cpp
389666bf1fed53a92b8c320157ee5fc0d5173552 01-Apr-2016 halcanary <halcanary@google.com> SkPDF: PDFShader does not hold images/bitmaps

motivation: measurable memory savings.

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

Review URL: https://codereview.chromium.org/1851123002
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
fe63045f075165b1be5d3e7fc5c710021d85f53b 25-Mar-2016 reed <reed@google.com> move setshader to sk_sp, re-using SK_SUPPORT_LEGACY_CREATESHADER_PTR

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

Review URL: https://codereview.chromium.org/1829303002
/external/skia/src/pdf/SkPDFShader.cpp
d11c7268a2a4303e842f4ba16da98fcd0a2b7555 25-Mar-2016 halcanary <halcanary@google.com> SkPDF: speed up SkPDFShader generation.

Stop using SkString::append() when SkDynamicMemoryWStream
works better.

Also add a bench to prove that this speeds things up:
before:
micros bench
59.33 ? PDFShader nonrendering
after:
micros bench
34.55 ? PDFShader nonrendering
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1833793002

Review URL: https://codereview.chromium.org/1833793002
/external/skia/src/pdf/SkPDFShader.cpp
989da4a32cd6823359f31c971c3b3f31425e905e 21-Mar-2016 halcanary <halcanary@google.com> SkPDF: SkPDFDevice has ptr to SkPDFDocument

This is necessary for pre-serialization of images.

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

Review URL: https://codereview.chromium.org/1802963002
/external/skia/src/pdf/SkPDFShader.cpp
18300a3aa7cb6eb55d21bb0450dffa58b6fc062c 16-Mar-2016 mtklein <mtklein@chromium.org> detach -> release

The C++ standard library uses the name "release" for the operation we call "detach".

Rewriting each "detach(" to "release(" brings us a step closer to using standard library types directly (e.g. std::unique_ptr instead of SkAutoTDelete).

This was a fairly blind transformation. There may have been unintentional conversions in here, but it's probably for the best to have everything uniformly say "release".

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

Review URL: https://codereview.chromium.org/1809733002
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
e94ea625fbce6979b7ef59255c7598e81d37f546 09-Mar-2016 halcanary <halcanary@google.com> SkPDF: use sk_ref_sp

s/sk_sp<[^>]*>(SkRef(\([^)]*\)))/sk_ref_sp(\1)/

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

Review URL: https://codereview.chromium.org/1777923002
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
6c59d80858f453a426df9b07fdf3a8cc01e0b906 09-Sep-2015 mtklein <mtklein@chromium.org> Port uses of SkLazyPtr to SkOncePtr.

This gives SkOncePtr a non-trivial destructor that uses std::default_delete
by default. This is overrideable, as seen in SkColorTable.

SK_DECLARE_STATIC_ONCE_PTR still just leaves its pointers hanging at EOP.

BUG=skia:

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

Committed: https://skia.googlesource.com/skia/+/a1254acdb344174e761f5061c820559dab64a74c

Review URL: https://codereview.chromium.org/1322933005
/external/skia/src/pdf/SkPDFShader.cpp
2ac6793efc9b33f6104f9c39810bee5714bdc208 09-Sep-2015 mtklein <mtklein@google.com> Revert of Port uses of SkLazyPtr to SkOncePtr. (patchset #7 id:110001 of https://codereview.chromium.org/1322933005/ )

Reason for revert:
Breaks Chrome roll.

obj/skia/ext/skia_chrome.skia_memory_dump_provider.o
does not have -I include/private on its include path, but transitively includes SkMessageBus.h.

Original issue's description:
> Port uses of SkLazyPtr to SkOncePtr.
>
> This gives SkOncePtr a non-trivial destructor that uses std::default_delete
> by default. This is overrideable, as seen in SkColorTable.
>
> SK_DECLARE_STATIC_ONCE_PTR still just leaves its pointers hanging at EOP.
>
> BUG=skia:
>
> No public API changes.
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/a1254acdb344174e761f5061c820559dab64a74c

TBR=herb@google.com,mtklein@chromium.org
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1334523002
/external/skia/src/pdf/SkPDFShader.cpp
a1254acdb344174e761f5061c820559dab64a74c 09-Sep-2015 mtklein <mtklein@chromium.org> Port uses of SkLazyPtr to SkOncePtr.

This gives SkOncePtr a non-trivial destructor that uses std::default_delete
by default. This is overrideable, as seen in SkColorTable.

SK_DECLARE_STATIC_ONCE_PTR still just leaves its pointers hanging at EOP.

BUG=skia:

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

Review URL: https://codereview.chromium.org/1322933005
/external/skia/src/pdf/SkPDFShader.cpp
96fcdcc219d2a0d3579719b84b28bede76efba64 27-Aug-2015 halcanary <halcanary@google.com> Style Change: NULL->nullptr
DOCS_PREVIEW= https://skia.org/?cl=1316233002

Review URL: https://codereview.chromium.org/1316233002
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
f5822825ec2d5dd24ab476fdd42db2a6573f9756 19-Aug-2015 reed <reed@google.com> change asABitmap to isABitmap on shader

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1287263005
/external/skia/src/pdf/SkPDFShader.cpp
80ea19ca4bdd68c1493666a5fe7e4ce9d43ded8b 12-May-2015 reed <reed@google.com> Revert of Revert of stop calling SkScalarDiv (patchset #1 id:1 of https://codereview.chromium.org/1138263002/)

Reason for revert:
android patched, blink has rolled

Original issue's description:
> Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)
>
> Reason for revert:
> need to wait for Blink roll (and patch android)
>
> Original issue's description:
> > stop calling SkScalarDiv
> >
> > BUG=skia:
> > TBR=
> >
> > Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a
>
> TBR=
> NOPRESUBMIT=true
> NOTREECHECKS=true
> NOTRY=true
> BUG=skia:
>
> Committed: https://skia.googlesource.com/skia/+/2629697933b5cc975e45d2a45c48f803fc6cbcec

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1135693003
/external/skia/src/pdf/SkPDFShader.cpp
2629697933b5cc975e45d2a45c48f803fc6cbcec 12-May-2015 reed <reed@google.com> Revert of stop calling SkScalarDiv (patchset #4 id:60001 of https://codereview.chromium.org/1135053002/)

Reason for revert:
need to wait for Blink roll (and patch android)

Original issue's description:
> stop calling SkScalarDiv
>
> BUG=skia:
> TBR=
>
> Committed: https://skia.googlesource.com/skia/+/67d71c898249a7af3523b16c6a69895a63bfae0a

TBR=
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=skia:

Review URL: https://codereview.chromium.org/1138263002
/external/skia/src/pdf/SkPDFShader.cpp
67d71c898249a7af3523b16c6a69895a63bfae0a 12-May-2015 reed <reed@google.com> stop calling SkScalarDiv

BUG=skia:
TBR=

Review URL: https://codereview.chromium.org/1135053002
/external/skia/src/pdf/SkPDFShader.cpp
71a6cbfc585959738dc0b375603696ca7f60605f 04-May-2015 reed <reed@google.com> remove redundant/deprecated TwoPointRadial gradiet -- use TwoPointConical

This CL derived from https://codereview.chromium.org/1114243005/

BUG=skia:

Review URL: https://codereview.chromium.org/1117423003
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
2b86155b42c2493ff0c558ce105a464769962274 09-Apr-2015 halcanary <halcanary@google.com> SkPDF: ResourceDict replaced by factory function

Motivation: Having a class here was unnecessary, since the only thing
that set this class apart was how it is created, not how it behaves.

BUG=skia:3585

Review URL: https://codereview.chromium.org/1068343003
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
6d622703e578eddc64ab4e3340d0ab0033268799 25-Mar-2015 halcanary <halcanary@google.com> SkPDF: skpdfdocument and skpdfpage use skpdfdevice in a const way

BUG=skia:3585

Review URL: https://codereview.chromium.org/1035513003
/external/skia/src/pdf/SkPDFShader.cpp
f5b17fbd9406ea276d62886a072872dbd48ca58a 24-Mar-2015 halcanary <halcanary@google.com> SkPDF: Fix leak in SkPDFShader

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/1006813010
/external/skia/src/pdf/SkPDFShader.cpp
547019e1a671b1b30746e69b9647b201500e1504 24-Mar-2015 halcanary <halcanary@google.com> SkPDF: clean up extra references

This cleans up code left behind from http://crrev.com/870333002

Review URL: https://codereview.chromium.org/1029263004
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
334fcbc167237f02058cb508cb5f51b718141461 24-Feb-2015 halcanary <halcanary@google.com> SkPDF: replace SkPDFDevice::copyContentToData

Motivation: remove copyToData(). Later we will stop caching
the data alltogether.

BUG=skia:

Review URL: https://codereview.chromium.org/958433003
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
a1f1ee98a1f6d0770f6243270ca2f0e6c92efaba 20-Feb-2015 halcanary <halcanary@google.com> PDF : New factory function for SkPDFDevice

SkPDFDevice now has factory function that matches what callers need.

Review URL: https://codereview.chromium.org/941023005
/external/skia/src/pdf/SkPDFShader.cpp
7b4d4c7a4668f771641aaed88b83d22d5efe6873 12-Feb-2015 fmalita <fmalita@chromium.org> [PDF] Fix shader fallback mapping when clipped

The bounding box used for our pattern sizing is in device coordinates,
but SkPDFImageShader::Create() runs it through the inverse CTM to map
into shader space (with a notable effect of vertical flipping).

In order not to implode, the fallback shader path needs to compute its
adjustments in a consistent space.

BUG=skia:3398, chromium:454591, chromium:455052
R=halcanary@google.com

Review URL: https://codereview.chromium.org/901303003
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
8de56326e3aa3b8780ccf2949c3f5a82a9882bbf 23-Jan-2015 halcanary <halcanary@google.com> minor changes left out of http://crrev.com/873543002

TBR=mtklein@google.com

Review URL: https://codereview.chromium.org/872643005
/external/skia/src/pdf/SkPDFShader.cpp
530ea8e24bc88f2d7973c35a703f18c1dafb56dc 23-Jan-2015 halcanary <halcanary@google.com> More changes to SkPDFShader to eliminate multiple inheritance!

Review URL: https://codereview.chromium.org/873543002
/external/skia/src/pdf/SkPDFShader.cpp
bc59ac6b12bbded2117fe3aa9643b2d138e5ddda 23-Jan-2015 halcanary <halcanary@google.com> Simplify SkPDFShader class. Now invalid objects are never created.

"Constructors should not do real work"

I have verified that all test PDFs render identically.

Review URL: https://codereview.chromium.org/862113004
/external/skia/src/pdf/SkPDFShader.cpp
a1193e4b0e34a7e4e1bd33e9708d7341679f8321 21-Jan-2015 scroggo <scroggo@google.com> Make SkStream *not* ref counted.

SkStream is a stateful object, so it does not make sense for it to have
multiple owners. Make SkStream inherit directly from SkNoncopyable.

Update methods which previously called SkStream::ref() (e.g.
SkImageDecoder::buildTileIndex() and SkFrontBufferedStream::Create(),
which required the existing owners to call SkStream::unref()) to take
ownership of their SkStream parameters and delete when done (including
on failure).

Switch all SkAutoTUnref<SkStream>s to SkAutoTDelete<SkStream>s. In some
cases this means heap allocating streams that were previously stack
allocated.

Respect ownership rules of SkTypeface::CreateFromStream() and
SkImageDecoder::buildTileIndex().

Update the comments for exceptional methods which do not affect the
ownership of their SkStream parameters (e.g.
SkPicture::CreateFromStream() and SkTypeface::Deserialize()) to be
explicit about ownership.

Remove test_stream_life, which tested that buildTileIndex() behaved
correctly when SkStream was a ref counted object. The test does not
make sense now that it is not.

In SkPDFStream, remove the SkMemoryStream member. Instead of using it,
create a new SkMemoryStream to pass to fDataStream (which is now an
SkAutoTDelete).

Make other pdf rasterizers behave like SkPDFDocumentToBitmap.

SkPDFDocumentToBitmap delete the SkStream, so do the same in the
following pdf rasterizers:

SkPopplerRasterizePDF
SkNativeRasterizePDF
SkNoRasterizePDF

Requires a change to Android, which currently treats SkStreams as ref
counted objects.

Review URL: https://codereview.chromium.org/849103004
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
c3796c7a74e103d9b367ad9449fcdacfa20d83e1 13-Jan-2015 fmalita <fmalita@chromium.org> Generic PDF shader fallback

Instead of ignoring unsupported shaders (and essentially filling with
solid black), convert them to bitmap shaders using on-the-fly
rasterization.

BUG=skia:3299
R=reed@google.com,halcanary@google.com

Review URL: https://codereview.chromium.org/841763005
/external/skia/src/pdf/SkPDFShader.cpp
72c9faab45124e08c85f70ca38536914862d947c 09-Jan-2015 mtklein <mtklein@chromium.org> Fix up all the easy virtual ... SK_OVERRIDE cases.

This fixes every case where virtual and SK_OVERRIDE were on the same line,
which should be the bulk of cases. We'll have to manually clean up the rest
over time unless I level up in regexes.

for f in (find . -type f); perl -p -i -e 's/virtual (.*)SK_OVERRIDE/\1SK_OVERRIDE/g' $f; end

BUG=skia:

Review URL: https://codereview.chromium.org/806653007
/external/skia/src/pdf/SkPDFShader.cpp
e8307dc0d0a568775e64515a8fff7b2a709f0834 15-Dec-2014 mtklein <mtklein@chromium.org> Add SK_OVERRIDE to a few places that are missing it.

This was done automatically by running clang-modernize -add-override -override-macros.

It's not clear to me whether include/ is already clean or I just can't get the tool to work for headers.

BUG=skia:

Review URL: https://codereview.chromium.org/808463002
/external/skia/src/pdf/SkPDFShader.cpp
c54d8db4d169ea5f2af2a9a2349df007bd428475 10-Dec-2014 Florin Malita <fmalita@google.com> Remove SkCanvas::drawBitmapMatrix()

R=mtklein@google.com, reed@google.com, robertphillips@google.com

Review URL: https://codereview.chromium.org/789033002
/external/skia/src/pdf/SkPDFShader.cpp
33a30503d76fdd989358cedd78445ba96bb809dd 11-Sep-2014 reed <reed@google.com> SkData can allocate room for its contents in the same block

BUG=skia:
R=bungeman@google.com, mtklein@google.com

Author: reed@google.com

Review URL: https://codereview.chromium.org/560653004
/external/skia/src/pdf/SkPDFShader.cpp
d6aeb6dc8fe21066f1a2c4813a4256a3acd3edf5 25-Jul-2014 bungeman <bungeman@google.com> Fix thread unsafe mutex initialization.

BUG=skia:2779
R=robertphillips@google.com, mtklein@google.com, reed@android.com, bsalomon@google.com

Author: bungeman@google.com

Review URL: https://codereview.chromium.org/419113002
/external/skia/src/pdf/SkPDFShader.cpp
24480bc71ef6c754030cb3f98672da1c8fb3a63b 20-Jun-2014 halcanary <halcanary@google.com> Use SkMutex::assertHeld in SkPDFFont and SkPDFShader.

R=mtklein@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/348113002
/external/skia/src/pdf/SkPDFShader.cpp
e1ca705cac4b946993f6cbf798e2a0ba27e739f3 17-Dec-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> deprecate SkScalarRound (and its ilk), use SkScalarRound[ToInt,ToScalar]. #define SK_SUPPORT_DEPRECATED_SCALARROUND for legacy clients

BUG=
R=robertphillips@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12719 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
83d8eda890def8c119794deeec6244c67da83ac8 24-Oct-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF: support perspective in simple shaders. (this version does not work well with tilling)

R=vandebo@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11937 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
dc37e20647b92528ba9e6a4074cb0f8cc7fbe6b5 18-Oct-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "PDF: support perspective in simple shaders. (this version does not work well with tilling)"

Accidentally committed the wrong git branch.

This reverts commit 76839c65670df8a863041a82a4b61502e78af043.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11865 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
eb5992c6cc14caec3682bee00140c5e1b9438da6 18-Oct-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF: support perspective in simple shaders. (this version does not work well with tilling)

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11864 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
5e00989a283111cef05bed8102e45c16651e43e4 14-Oct-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add SkPDFDeviceFlatenner which extends SkPDFDevice to add support to flatten the path and the text when we have perspective.
prepare to deprecate SkPDFDevice constructor, and route gm and render_pdfs to use SkDocument::Create pdf interface instead. - controlled by a flag
add comments where we are supposed to flatten other features (paint, shaders, ... )

R=reed@google.com, bungeman@google.com, scroggo@google.com, vandebo@chromium.org, bsalomon@google.com

Author: edisonn@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11751 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
8135323f70b38e465761ab3e9817183750e3864d 17-Sep-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> pdf: ifgnore shader colors applied for 0 range.

R=vandebo@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@11322 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
e324cc69be2be62a76cef52ba3562771af02f315 22-Aug-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Restyle SkPDFImageShader and support tiling bitmaps outside clip bounds

BUG=chromium:99458
R=edisonn@google.com, vandebo@chromium.org

Author: richardlin@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10870 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
47401354074549d8591da7fa115241766d3ee3d2 23-Jul-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix Clang build on SkPDFResourceDict (CL 18977002)

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

Author: richardlin@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10295 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
8e473760d7b495b06c600c5dc5e5fd42876e159f 23-Jul-2013 edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> If we fail to contruct the Pdf Image Shader, mark the object as busted, and dn't try to remove it from shaders list. Also, when we delete invalid shaders, remove the lock, otherwise we freeze (see CanonicalShadersMutex usage).

R=vandebo@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10290 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
fc1666707700e386746c1713077af2f9123aa267 22-Jul-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Adds SkPDFResourceDict class, refactor existing code to use it."

This reverts commit r10245

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10247 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
3a8dfc36ae16e995a252030474f2b65b61f757b6 22-Jul-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Adds SkPDFResourceDict class, refactor existing code to use it.

Committed: http://code.google.com/p/skia/source/detail?r=10202

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

Author: richardlin@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10245 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
d322cf4939872bbff063468d7357c76eb6250d0f 19-Jul-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "Adds SkPDFResourceDict class to manage resource dicts. Refactors existing code to use this class."

This reverts commit r10202

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10205 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
c84fb471d1428b254c2326d4ce68497c09d2ec45 19-Jul-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Adds SkPDFResourceDict class to manage resource dicts. Refactors existing code to use this class.

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

Author: richardlin@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@10202 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
ace2269edfed9dfd3097597f1698921aaddf80a1 12-Jun-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixed a bug with linear gradient PDF matrices and added test cases

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

Author: richardlin@chromium.org

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

git-svn-id: http://skia.googlecode.com/svn/trunk@9553 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
53648ab14e2f6a3cf07bd36b0964db8a0664b46a 03-Apr-2013 djsollen@google.com <djsollen@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix build error when building Android in Release mode with -O2.

This fixes the folowing error...

../../../src/pdf/SkPDFShader.cpp: In function 'void gradientFunctionCode(const SkShader::GradientInfo&, SkString*)':
../../../src/pdf/SkPDFShader.cpp:69:19: error: array subscript is above array bounds [-Werror=array-bounds]

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

git-svn-id: http://skia.googlecode.com/svn/trunk@8506 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
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/SkPDFShader.cpp
f94b3a4cebd4adab09c40ebe23c02a615e10c394 31-Oct-2012 bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Make SkShader store localM directly rather than as a separate alloc.

May cause very slight GM changes in gpu two pt radial/conical radients.
Review URL: https://codereview.appspot.com/6821056

git-svn-id: http://skia.googlecode.com/svn/trunk@6221 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
b862204352f1a6028e0bfafd25df1cbca114208b 22-Oct-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix gradient generation code (remove extra 'dup' in some cases)

Fixes http://crbug.com/157006

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

git-svn-id: http://skia.googlecode.com/svn/trunk@6035 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
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/SkPDFShader.cpp
91f319c5dc4493384f0a52aaeef3dcc311ef6ed0 25-Jul-2012 rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Use asNewCustomStage instead of asABitmap in SkGpuDevice, also removed now-unecessary twoPointRadialParams parameter from asABitmap.

In SkGpuDevice we still fall back on using asABitmap for effects that don't have asNewCustomStage implemented, but it still simplifies things a fair amount.
Review URL: https://codereview.appspot.com/6430060

git-svn-id: http://skia.googlecode.com/svn/trunk@4755 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
ab2fe82840f37e92e7c45a36cac725c6fd2512c7 10-Jul-2012 rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Replace all instances of 'clear' with 'pop's in conical gradient pdf impl, looks like the pdf spec doesn't support Postscript's 'clear' stack operator. Should fix some warnings on mac buildbots.

git-svn-id: http://skia.googlecode.com/svn/trunk@4521 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
6219728eec0819a2a28b4439d8553a70b9c232f6 10-Jul-2012 rileya@google.com <rileya@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Added pdf implementation of conical gradient.
Also fixed an erroneous comment in the gpu implementation.
Review URL: https://codereview.appspot.com/6351076

git-svn-id: http://skia.googlecode.com/svn/trunk@4520 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
da6c569334b5971e55dc95cb9bf85853d068e999 28-Jun-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix PDF code to not crash on SkComposeShader.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@4400 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
4908533aef9830dc1c18552c305ed6ccb286f4f2 11-Jun-2012 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix missing switch-statement handler (for conical gradient)



git-svn-id: http://skia.googlecode.com/svn/trunk@4229 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
83226976b532141b26ff3a40f381a5d08ce3259d 07-Jun-2012 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> extend asAGradient for Conical type (to be implemented by PDF and XPS)
Review URL: https://codereview.appspot.com/6308051

git-svn-id: http://skia.googlecode.com/svn/trunk@4207 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
05141c23ed2731bf04e7a1ca2a03ca23014b7222 27-Apr-2012 robertphillips@google.com <robertphillips@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Fixed minor c++ issues found by cppcheck

http://codereview.appspot.com/6127049/



git-svn-id: http://skia.googlecode.com/svn/trunk@3771 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
386dfc049baa400c13e4e98727d4c04d0242b7b8 18-Apr-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Handle failures of matrix inversion

Previously reviewed in https://codereview.appspot.com/6033047. Rolled back
because of unrelated fixed-point bugs.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@3715 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
c39c8674c94dba8b1ffe938cd99c825320cc1475 17-Apr-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix some fixed-point bugs.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@3714 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
8aa66b6f76f72b8e0a15323a932436ca462bf14d 17-Apr-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Revert "[PDF] Handle failures of matrix inversion" while I investigate fixed point failures.

This reverts commit r3711

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

git-svn-id: http://skia.googlecode.com/svn/trunk@3712 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
ebad2d9e2003c76a7c496e25c79e371277961ee8 17-Apr-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Handle failures of matrix inversion.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@3711 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
b054990307b7338e599a12d9af10eb2058b94051 13-Apr-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] If matrix inversion fails, use the identity matrix.

BUG=chrome:123078

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

git-svn-id: http://skia.googlecode.com/svn/trunk@3676 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
188838c20818307fda770ffc395a76ea63c1c8cc 09-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix memory hungry inefficiency in pdf resource tracking.

When moving the content of a device into a PDF object like SkPDFFormXObject
or SkPDFShader does, we only need the top level resources in the new object's
resource list, not the recursive set of objects. Otherwise, when you
put a form on a form on form, etc, references to the objects multiply.

This fixed http://crbug.com/117321

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

git-svn-id: http://skia.googlecode.com/svn/trunk@3360 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
54ff85c79d5a59ad9978a91b1aec1177e54104c5 09-Mar-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix some fixed/float-point mismatches for image shaders.

BUG=520

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

git-svn-id: http://skia.googlecode.com/svn/trunk@3356 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
1771cbf43d9a1334e3d870c635b4215bb888dd98 26-Jan-2012 digit@google.com <digit@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> posix: Avoid static initializers in static/global mutexes

This patch removes static initializers related to static and
global mutexes from the final library's machine code when
building on a pthread-capable system.

We use PTHREAD_MUTEX_INITIALIZER to perform POD-style
initialization. You need a line like the following to declare
a global mutex with it:

SkBaseMutex gMutex = { PTHREAD_MUTEX_INITIALIZER };

We introduce the SK_DECLARE_STATIC_MUTEX and SK_DECLARE_GLOBAL_MUTEX
macros to be able to declare static/global mutexes in the source tree
uniformly.

SkMutex is now defined as a sub-class of SkBaseMutex, with standard
construction/destruction semantics. This is useful if the mutex
object is a member of another C++ class, or allocated dynamically.

We also modify a few places to refer to SkBaseMutex instead of a
SkMutex, where it makes sense. Generally speaking, client code
should hold and use pointers to SkBaseMutex whenever they can
now.

We defined a new built-time macro named SK_USE_POSIX_THREADS
to indicate that we're using a pthread-based SkThread.h
interface. The macro will also be used in future patches
to implement other helper thread synchronization classes.

Finally, we inline the acquire() and release() functions in the
case of Posix to improve performance a bit.

Running: 'bench -repeat 10 -match mutex' on an Android device or
a 2.4GHz Xeon Linux desktop shows the following improvements:

Before After

Galaxy Nexus 1.64 1.45
Nexus S 1.47 1.16
Xoom 1.86 1.66
Xeon 0.36 0.31

This removes 5 static mutex initializers from the library
Review URL: https://codereview.appspot.com/5501066

git-svn-id: http://skia.googlecode.com/svn/trunk@3091 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
663515bc59325092c4e47f5189782bd6fcd0586a 05-Jan-2012 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix some scalar/int assumptions.

Review URL: http://codereview.appspot.com/5516043

git-svn-id: http://skia.googlecode.com/svn/trunk@2975 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
020798af6780ba29156f4daec87c29ae9e4f4a12 21-Dec-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Coverity: Add a default case in SkPDFShader. CID=101159

Code from thestig@chromium.org original CL: http://codereview.appspot.com/5498052/

Review URL: http://codereview.appspot.com/5502052

git-svn-id: http://skia.googlecode.com/svn/trunk@2913 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
a5c7234e81748f76cbeede40e619351146e5286a 16-Aug-2011 ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Address lint issues in pdf directories.
Review URL: http://codereview.appspot.com/4887042

git-svn-id: http://skia.googlecode.com/svn/trunk@2117 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
ec3ed6a5ebf6f2c406d7bcf94b6bc34fcaeb976e 28-Jul-2011 epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Automatic update of all copyright notices to reflect new license terms.

I have manually examined all of these diffs and restored a few files that
seem to require manual adjustment.

The following files still need to be modified manually, in a separate CL:

android_sample/SampleApp/AndroidManifest.xml
android_sample/SampleApp/res/layout/layout.xml
android_sample/SampleApp/res/menu/sample.xml
android_sample/SampleApp/res/values/strings.xml
android_sample/SampleApp/src/com/skia/sampleapp/SampleApp.java
android_sample/SampleApp/src/com/skia/sampleapp/SampleView.java
experimental/CiCarbonSampleMain.c
experimental/CocoaDebugger/main.m
experimental/FileReaderApp/main.m
experimental/SimpleCocoaApp/main.m
experimental/iOSSampleApp/Shared/SkAlertPrompt.h
experimental/iOSSampleApp/Shared/SkAlertPrompt.m
experimental/iOSSampleApp/SkiOSSampleApp-Base.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Debug.xcconfig
experimental/iOSSampleApp/SkiOSSampleApp-Release.xcconfig
gpu/src/android/GrGLDefaultInterface_android.cpp
gyp/common.gypi
gyp_skia
include/ports/SkHarfBuzzFont.h
include/views/SkOSWindow_wxwidgets.h
make.bat
make.py
src/opts/memset.arm.S
src/opts/memset16_neon.S
src/opts/memset32_neon.S
src/opts/opts_check_arm.cpp
src/ports/SkDebug_brew.cpp
src/ports/SkMemory_brew.cpp
src/ports/SkOSFile_brew.cpp
src/ports/SkXMLParser_empty.cpp
src/utils/ios/SkImageDecoder_iOS.mm
src/utils/ios/SkOSFile_iOS.mm
src/utils/ios/SkStream_NSData.mm
tests/FillPathTest.cpp
Review URL: http://codereview.appspot.com/4816058

git-svn-id: http://skia.googlecode.com/svn/trunk@1982 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
1feb33068b1313d2647c50b90ae8e0a3d510db2e 20-Jul-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> replace SkRefPtr for parameters with simple pointers



git-svn-id: http://skia.googlecode.com/svn/trunk@1913 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
421d6443fbd3a913dfa32b6492c4a2969bc6314b 20-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Make stream compression optional on a per device basis.

There are a lot of small pieces to make this change work:
- SkPDFDocument (and SkPDFCatalog) take flags to disable compression (and font embedding - not implemented yet, can disable font subsetting for now).
- SkPDFStream now defers compression until the size/emit step.
- Classes that *had* a stream (because they didn't know the stream size at construction time) now *are* streams to make the substitution work correctly.
- The SkPDFShader implementation got pulled apart into two classes, one that is a SkPDFDict, and one that is a SkPDFStream (making the common ancestor SkPDFObject).
- Added helper methods in SkPDFObject for children that have simple resource lists.
- Added an iterator to SkPDFDict so that a substitute SkPDFStream can get a copy of the stream dictionary.
- Change SkPDFDocument to have a pointer to an SkPDFCatalog to remove a new circular header reference.

Review URL: http://codereview.appspot.com/4700045

git-svn-id: http://skia.googlecode.com/svn/trunk@1911 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
f6c3ebdeb135dcdb9af225bd7af77f1fe1f92787 20-Jul-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> fix Capitalization of static methods



git-svn-id: http://skia.googlecode.com/svn/trunk@1910 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
c789cf1c6f3947283aeb34acb5a22e6204f8f6f5 20-Jul-2011 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> helpers for append and insert when the value is a POD.
reduces code-size and perf: fewer refs/unrefs



git-svn-id: http://skia.googlecode.com/svn/trunk@1909 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
b88cfe58e117ffe781e4ce2cba73cc4f7a795de7 18-Jul-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Make color shaders work correctly.

Make SkPDFShader correctly bail out for color shaders.
Fix the bail out handling code.

Review URL: http://codereview.appspot.com/4750045

git-svn-id: http://skia.googlecode.com/svn/trunk@1886 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
e1bc274295ec57cb3d3f01aaa8abff3b49c76c73 22-Jun-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Fix a batch of coverity defects, uninitialized class fields.

In SkClipStack::B2FIter::Clip, SkWriter32, SkClipStack::Rec, SkDeque::F2BIter, SkPDFShader::State
CID 15427,15433,15533,15532,16274,16740

Review URL: http://codereview.appspot.com/4630055

git-svn-id: http://skia.googlecode.com/svn/trunk@1669 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
be2048a371813259c46fc2260d53ccadc4ea8133 02-May-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix fallout from r1217.

The width and height we pass to SkDevice must be postive.
Shader can no longer use negative coordinates (without transform).
Shader unflip matrix should use same values as passed to SkPDFDevice (height).
Most Shader dictionary entries should be scalars and not ints.

Review URL: http://codereview.appspot.com/4454047

git-svn-id: http://skia.googlecode.com/svn/trunk@1219 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
152612938020fa46999f33668027d5bc0f7afd18 29-Apr-2011 ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF Device should report non-transformed size for width and height.
Review URL: http://codereview.appspot.com/4435074

git-svn-id: http://skia.googlecode.com/svn/trunk@1217 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
75f97e452e8f2ee55cd2b283df7d7734f48bc2bf 12-Apr-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Generalize the flip origin argument to the PDF device constructor.

The argument still has a default value that does what most users will want, but provides more flexibility.
Chrome will use this change to support an initial translation of the origin to simulate a margin and to scale the entire content (needed on Windows).

When landing to Chrome, this will need http://codereview.chromium.org/6820038

Review URL: http://codereview.appspot.com/4373052

git-svn-id: http://skia.googlecode.com/svn/trunk@1111 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
316338a4eb54b544409e3a98d97ea0a829aef706 10-Mar-2011 twiz@google.com <twiz@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Correction of the non-portable use of dynamically allocated stack arrays in the
pdf shader code.

I briefly looked into making use of alloca, but that is also non-portable, and
deprecated in many environments. Fell back to the SkTDArray class as a common
denominator.

This problem was introduce by the following CL:
http://codereview.appspot.com/4239061/



git-svn-id: http://skia.googlecode.com/svn/trunk@912 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp
da912d61ede86dd3dfa8f645c6f3977f2183812b 08-Mar-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add support for Shaders.

- Shaders, or as they are referred to in PDF, patterns, are drawn in the coordinate system of the initial page, so when we canonicalize them, we have to consider the current transform and where they are constructed.

- Image shaders are tiled by default, this makes repeat and mirror modes easy, but means we have to draw a pattern as large as the current clip to support clamp mode.

- Gradient shaders are implemented with type 4 functions, which are basically small snippets of post script code. I've tried to make the code generation modular and heavily commented to make it easy to understand or expand.

Review URL: http://codereview.appspot.com/4239061

git-svn-id: http://skia.googlecode.com/svn/trunk@905 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFShader.cpp