History log of /external/skia/src/pdf/SkPDFGraphicState.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.cpp
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.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/SkPDFGraphicState.cpp
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.cpp
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.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/SkPDFGraphicState.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/SkPDFGraphicState.cpp
67ec1f8eecfb48bc0a6ba04c0057f103c1c9696f 27-Jun-2014 halcanary <halcanary@google.com> Switch SkPDFStream's internal storage from SkStream to SkData

Motivation: This makes SkPDFStream thread-safe for two threads
serializing it at once, since a SkStream has an internal position.

Updated SkPDFFont, SkPDFGraphicState, and SkPDFPage's use of
SkPDFStream to use the SkData constructor rather than the SkStream
constructor (saving a memcpy).

BUG=skia:2683

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

R=mtklein@google.com, djsollen@google.com, rmistry@google.com, robertphillips@google.com

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/340783013
/external/skia/src/pdf/SkPDFGraphicState.cpp
e1c55869f37bf7c5f365fddc38207dc3ec336b6c 26-Jun-2014 rmistry <rmistry@google.com> Revert of Switch SkPDFStream's internal storage from SkStream to SkData (https://codereview.chromium.org/340783013/)

Reason for revert:
Causes canary failures

Original issue's description:
> Switch SkPDFStream's internal storage from SkStream to SkData
>
> Motivation: This makes SkPDFStream thread-safe for two threads
> serializing it at once, since a SkStream has an internal position.
>
> Updated SkPDFFont, SkPDFGraphicState, and SkPDFPage's use of
> SkPDFStream to use the SkData constructor rather than the SkStream
> constructor (saving a memcpy).
>
> BUG=skia:2683
>
> Committed: https://skia.googlesource.com/skia/+/c1dfa14b645ae274780f026dd86c9b633fbdad06

R=mtklein@google.com, djsollen@google.com, halcanary@google.com
TBR=djsollen@google.com, halcanary@google.com, mtklein@google.com
NOTREECHECKS=true
NOTRY=true
BUG=skia:2683

Author: rmistry@google.com

Review URL: https://codereview.chromium.org/354043005
/external/skia/src/pdf/SkPDFGraphicState.cpp
c1dfa14b645ae274780f026dd86c9b633fbdad06 26-Jun-2014 halcanary <halcanary@google.com> Switch SkPDFStream's internal storage from SkStream to SkData

Motivation: This makes SkPDFStream thread-safe for two threads
serializing it at once, since a SkStream has an internal position.

Updated SkPDFFont, SkPDFGraphicState, and SkPDFPage's use of
SkPDFStream to use the SkData constructor rather than the SkStream
constructor (saving a memcpy).

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

Author: halcanary@google.com

Review URL: https://codereview.chromium.org/340783013
/external/skia/src/pdf/SkPDFGraphicState.cpp
b83f6c3cbdabc14d8290b00d9f38ba59bf6719a1 09-Jun-2014 mtklein <mtklein@chromium.org> Add assertHeld() to SkMutex.

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

Author: mtklein@chromium.org

Review URL: https://codereview.chromium.org/313823004
/external/skia/src/pdf/SkPDFGraphicState.cpp
3b416216d1e90cb8b1bba41bb95806fe2d40da88 30-Oct-2013 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Improve complex xfer mode support.

Xfer mode applies only to the shape of the source drawing, not everything in the clip as in currently implemented. It's just that the current gm examples draw a shape that fills the visible layer.

R=edisonn@google.com, reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@12034 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.cpp
64334352cc3f29f52dfa07225d65eb218d2fd830 06-Mar-2013 skia.committer@gmail.com <skia.committer@gmail.com@2bbb7eff-a529-9590-31e7-b0007b416f81> Sanitizing source files in Skia_Periodic_House_Keeping

git-svn-id: http://skia.googlecode.com/svn/trunk@8003 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
b24f89353ed7a45b27ab0ffc69c222b81bbf87c3 05-Mar-2013 commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Added support for non-separable blending modes.
Fixed scalar issue from https://codereview.appspot.com/7346044

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

git-svn-id: http://skia.googlecode.com/svn/trunk@7984 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.cpp
394c8854b3fc8949ae87408471fc517645302d64 04-Feb-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> add kMultiply_Mode to switch statement (fix warning)



git-svn-id: http://skia.googlecode.com/svn/trunk@7556 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
8d3cd7a170c810e3816bf00220cbef51e7b16795 30-Jan-2013 reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> clone of https://codereview.appspot.com/7208043/
Review URL: https://codereview.appspot.com/7232062

git-svn-id: http://skia.googlecode.com/svn/trunk@7476 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.cpp
918352f86e939fe042495aad4f5ff33c4ecec9ed 30-Oct-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF: Fix bug in weak pointer pattern.

For Canonicalized objects, only remove an object from the canonical list if it is the canonical object and not if it is an instance equal to the canonical object.

BUG=381
TBR=reed@google.com

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

git-svn-id: http://skia.googlecode.com/svn/trunk@2559 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
769fa6a013baca6d7404e2bf096a34a7e3635fa5 20-Aug-2011 ctguil@chromium.org <ctguil@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> No effect cleanup in pdf code.
Review URL: http://codereview.appspot.com/4927042

git-svn-id: http://skia.googlecode.com/svn/trunk@2146 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.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/SkPDFGraphicState.cpp
19e3c1ed1b20ce93cc092d25c3637b62f90c5bc5 25-May-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Reuse the invert function object for xform object masks.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@1417 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
6112c215fbdd53388e64ece36e6c7bba0fe3a451 13-May-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add support for SrcIn, SrcOut, DstIn, DstOut xfermodes.

This change uses the soft mask (aka soft clip) functionality of PDF to implement the xfermodes. It has to put existing content (dst) into a form xobject as well as putting the new (src) content into a different form xobject. It then draws one of them with the other as the soft mask.
To accomplish this, we add a call to finishContentEntry after each call to setUpContentEntry - this is kind of a hack, but I don't see a better way to extract src.
Unfortunately, soft mask is specified in the Graphic State PDF object (and not in the form xobject), so when handling one of these modes, we add a one time GS object to set the soft mask and invoke a simple GS to reset the soft mask when done.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@1320 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
69d4ca32ec0d6e61061f7d3c321f1b9ced6dd3ea 09-May-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Fix bug in graphic state comparison.

SkPDFGraphicState::GSCanonicalEntry::operator== was out of sync with SkPDFGraphicState::populateDict leading to graphic state objects with the same value.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@1278 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
25adce81ce24702174ede33445c414a8d21d8a23 09-May-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add support for Clear, Src, Dst, DstOver xfermodes.

This uses the refactoring in http://codereview.appspot.com/4459041/ to add support for additional xfer modes. Calling setupContentEntry may affect previous content entries (removing, reordering, or modifying their clip) and indicates to the caller if it should draw the new item or not.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@1271 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
f71b2103d56dde247605b718a0c89123ad8f0094 04-Apr-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Make the NOT_IMPLEMENTED macro not print anything by default.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@1050 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
48543277728fdf66b993f17421f65fba532a23a2 08-Feb-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Add support for xfermodes / blend modes.

- Change SkGraphicState to track and set the blend mode (xfermode) for modes built in to PDF (non porter duff modes + src over).
- Add SkXfermode::asMode() to retrieve xfermode as an enum for non porter duff modes.
- Move SkXfermode.cpp around a bit to support asMode() -- Generally move utility functions toward the top of the file.
- Make SkPDFFormXObject an isolated transparency group, as it used for saveLayer, which draws on transparent, not the device background.
- Set the graphic state in drawDevice and drawBitmap in order to get the right xfermode and alpha.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@774 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
f7c157610ff85f7323f5e213b62478dcc66edbec 01-Feb-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Clean up ref counting.

Return ref'd objs where possible enabling removal of many SkRefPtr<> variables.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@750 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
1cfa2c458626abe952a63b1a9397d8e496a134d6 31-Jan-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> [PDF] Support image alpha channel plus a couple small fixes.

Fix bug in rendering paths with cubic segments.
Only compress data if the compressed size is smaller than the uncompressed size.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@747 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
2a22e10ab2946c5590cd2a258427ce3ccfca9bfa 25-Jan-2011 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> Add Truetype and Type 1 font embedding support

Sorry this is such a large CL. It was very exploratory for me to make this
work.

- Add an interface to SkFontHost to retrieve font information and provide NULL implementations on all platforms except Linux.
- Segment large Type 1 fonts into fonts with shared resources with 255 glyphs each.
- Convert the various Type 1 formats to the form PDF wants.
- Update font as we draw text instead of as part of the graphical state.
- Remove built-in font support, we can't really use it.

Other changes I can pull out to a separate CL if you like.

- Add SkTScopedPtr class.
- Fix double free of resources.
- Fix bug in resource unique-ifying code.
- Don't print anything for any empty clip path.
- Fix copy paste error - MiterLimit.
- Fix sign extension bug in SkPDFString
- Fix FlateTest rename that was missed on a previous commit.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@728 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
28be72b63e457c680c192a34fb9f58e1c693363f 11-Nov-2010 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> PDF: Add text support with a font framework (font embedding to come).

Supports fakeBold, underline, strikethrough, mode (fill, stroke, both), size, skew, alignment (left, center, right).
Missing is drawFontOnPath and font lookup and embedding.
Changed SkPDFString to support how it is used from drawText methods.
Moved compile assert into SkTypes.
Moved constants and utility function used to support fakeBold, underline, and strikethrough into higher level locations.

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

git-svn-id: http://skia.googlecode.com/svn/trunk@624 2bbb7eff-a529-9590-31e7-b0007b416f81
/external/skia/src/pdf/SkPDFGraphicState.cpp
9b49dc0db8254e3dcdc2de4a1e0add4f8a7ac5a8 21-Oct-2010 vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> First pieces of SkPDFDevice. Supports:

Matrix transforms.
Rendering bitmaps.
Basic paint parameters.
Rendering rectangles, points, lines, polygons.
Render a paint to the page.

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

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