diff options
author | halcanary <halcanary@google.com> | 2015-02-20 07:21:05 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-20 07:21:05 -0800 |
commit | 792c80f5a7b66e75d42664ccb298f31962c6654c (patch) | |
tree | fc98395a0a8b9860677b9465ca2c5b662f89ee78 /src/pdf/SkPDFFont.h | |
parent | d08ea5fdae990ee7829e3755abddfab9740eab99 (diff) |
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
Diffstat (limited to 'src/pdf/SkPDFFont.h')
-rw-r--r-- | src/pdf/SkPDFFont.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/pdf/SkPDFFont.h b/src/pdf/SkPDFFont.h index 81ffd90403..105ae8d25e 100644 --- a/src/pdf/SkPDFFont.h +++ b/src/pdf/SkPDFFont.h @@ -18,6 +18,7 @@ #include "SkTypeface.h" class SkPaint; +class SkPDFCanon; class SkPDFCatalog; class SkPDFFont; @@ -126,7 +127,9 @@ public: * @param typeface The typeface to find. * @param glyphID Specify which section of a large font is of interest. */ - static SkPDFFont* GetFontResource(SkTypeface* typeface, uint16_t glyphID); + static SkPDFFont* GetFontResource(SkPDFCanon* canon, + SkTypeface* typeface, + uint16_t glyphID); /** Subset the font based on usage set. Returns a SkPDFFont instance with * subset. @@ -148,8 +151,12 @@ public: uint16_t searchGlyphID); protected: + SkPDFCanon* const fCanon; + // Common constructor to handle common members. - SkPDFFont(const SkAdvancedTypefaceMetrics* fontInfo, SkTypeface* typeface, + SkPDFFont(SkPDFCanon* canon, + const SkAdvancedTypefaceMetrics* fontInfo, + SkTypeface* typeface, SkPDFDict* relatedFontDescriptor); // Accessors for subclass. @@ -176,8 +183,10 @@ protected: void populateToUnicodeTable(const SkPDFGlyphSet* subset); // Create instances of derived types based on fontInfo. - static SkPDFFont* Create(const SkAdvancedTypefaceMetrics* fontInfo, - SkTypeface* typeface, uint16_t glyphID, + static SkPDFFont* Create(SkPDFCanon* canon, + const SkAdvancedTypefaceMetrics* fontInfo, + SkTypeface* typeface, + uint16_t glyphID, SkPDFDict* relatedFontDescriptor); static bool Find(uint32_t fontID, uint16_t glyphID, int* index); |