diff options
author | halcanary <halcanary@google.com> | 2015-01-21 09:59:14 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-21 09:59:14 -0800 |
commit | fb62b3d423fa34c672df42f47017dbef087d19e9 (patch) | |
tree | 014428ea2ca480f62b55d3d63db5115df577bff6 /src/pdf/SkPDFGraphicState.h | |
parent | 1c60dfe7ca0db010fa3118a1a2c7ff4c09136ab0 (diff) |
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
Diffstat (limited to 'src/pdf/SkPDFGraphicState.h')
-rw-r--r-- | src/pdf/SkPDFGraphicState.h | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/src/pdf/SkPDFGraphicState.h b/src/pdf/SkPDFGraphicState.h index 246f1db26e..cfc80ff548 100644 --- a/src/pdf/SkPDFGraphicState.h +++ b/src/pdf/SkPDFGraphicState.h @@ -71,30 +71,14 @@ public: */ static SkPDFGraphicState* GetNoSMaskGraphicState(); + bool equals(const SkPaint&) const; + private: const SkPaint fPaint; SkTDArray<SkPDFObject*> fResources; bool fPopulated; bool fSMask; - class GSCanonicalEntry { - public: - SkPDFGraphicState* fGraphicState; - const SkPaint* fPaint; - - bool operator==(const GSCanonicalEntry& b) const; - explicit GSCanonicalEntry(SkPDFGraphicState* gs) - : fGraphicState(gs), - fPaint(&gs->fPaint) {} - explicit GSCanonicalEntry(const SkPaint* paint) - : fGraphicState(NULL), - fPaint(paint) {} - }; - - // This should be made a hash table if performance is a problem. - static SkTDArray<GSCanonicalEntry>& CanonicalPaints(); - static SkBaseMutex& CanonicalPaintsMutex(); - SkPDFGraphicState(); explicit SkPDFGraphicState(const SkPaint& paint); @@ -102,7 +86,6 @@ private: static SkPDFObject* GetInvertFunction(); - static int Find(const SkPaint& paint); typedef SkPDFDict INHERITED; }; |