diff options
author | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-23 20:22:53 +0000 |
---|---|---|
committer | vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-07-23 20:22:53 +0000 |
commit | 6504cfdfc035f0a2cb854be9df352159873b9d62 (patch) | |
tree | 75f05c33e82b05edc130ae91bc0c39048d6bd7f2 /include/pdf/SkPDFDevice.h | |
parent | 0e35ca8382ae101187c7cb2e1bdcf5dff1fd9a6f (diff) |
[PDF] Refactor SkPDFFont to enable font/cmap subsetting.
Patch from Arthur Hsu, original CL: http://codereview.appspot.com/4633050/
Review URL: http://codereview.appspot.com/4811049
git-svn-id: http://skia.googlecode.com/svn/trunk@1943 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/pdf/SkPDFDevice.h')
-rw-r--r-- | include/pdf/SkPDFDevice.h | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h index 7a3e7bb7f1..1a0807aa67 100644 --- a/include/pdf/SkPDFDevice.h +++ b/include/pdf/SkPDFDevice.h @@ -30,6 +30,7 @@ class SkPDFDevice; class SkPDFDict; class SkPDFFont; class SkPDFFormXObject; +class SkPDFGlyphSetMap; class SkPDFGraphicState; class SkPDFObject; class SkPDFShader; @@ -150,11 +151,18 @@ public: * for calling data->unref() when it is finished. */ SK_API SkData* copyContentToData() const; - + SK_API const SkMatrix& initialTransform() const { return fInitialTransform; } + /** Returns a SkPDFGlyphSetMap which represents glyph usage of every font + * that shows on this device. + */ + const SkPDFGlyphSetMap& getFontGlyphUsage() const { + return *(fFontGlyphUsage.get()); + } + private: // TODO(vandebo) push most of SkPDFDevice's state into a core object in // order to get the right access levels without using friend. @@ -183,17 +191,20 @@ private: ContentEntry* getLastContentEntry(); void setLastContentEntry(ContentEntry* contentEntry); + // Glyph ids used for each font on this device. + SkTScopedPtr<SkPDFGlyphSetMap> fFontGlyphUsage; + SkPDFDevice(const SkISize& layerSize, const SkClipStack& existingClipStack, const SkRegion& existingClipRegion); // override from SkDevice - virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config config, - int width, int height, + virtual SkDevice* onCreateCompatibleDevice(SkBitmap::Config config, + int width, int height, bool isOpaque, Usage usage); void init(); - void cleanUp(); + void cleanUp(bool clearFontUsage); void createFormXObjectFromDevice(SkRefPtr<SkPDFFormXObject>* xobject); // Clear the passed clip from all existing content entries. |