Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(709)

Unified Diff: src/pdf/SkPDFCanon.h

Issue 2253993002: SkPDF: cache metrics once. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-18 (Thursday) 11:37:09 EDT Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/pdf/SkPDFCanon.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFCanon.h
diff --git a/src/pdf/SkPDFCanon.h b/src/pdf/SkPDFCanon.h
index a0241e308f469d43e679f8440e7d6bb33d273fd8..2da9e52f70fb3ef15649fbe4129a3c6e8207e070 100644
--- a/src/pdf/SkPDFCanon.h
+++ b/src/pdf/SkPDFCanon.h
@@ -14,6 +14,7 @@
#include "SkTHash.h"
#include "SkBitmapKey.h"
+class SkAdvancedTypefaceMetrics;
class SkPDFFont;
/**
@@ -35,19 +36,11 @@ class SkPDFFont;
*/
class SkPDFCanon : SkNoncopyable {
public:
- ~SkPDFCanon() { this->reset(); }
+ ~SkPDFCanon();
// reset to original setting, unrefs all objects.
void reset();
- // Returns exact match if there is one. If not, it returns nullptr.
- // If there is no exact match, but there is a related font, we
- // still return nullptr, but also set *relatedFont.
- SkPDFFont* findFont(uint32_t fontID,
- uint16_t glyphID,
- SkPDFFont** relatedFont) const;
- void addFont(SkPDFFont* font, uint32_t fontID, uint16_t fGlyphID);
-
sk_sp<SkPDFObject> findFunctionShader(const SkPDFShader::State&) const;
void addFunctionShader(sk_sp<SkPDFObject>, SkPDFShader::State);
@@ -63,7 +56,9 @@ public:
sk_sp<SkPDFObject> findPDFBitmap(SkBitmapKey key) const;
void addPDFBitmap(SkBitmapKey key, sk_sp<SkPDFObject>);
- SkTHashMap<uint32_t, bool> fCanEmbedTypeface;
+ SkTHashMap<uint32_t, SkAdvancedTypefaceMetrics*> fTypefaceMetrics;
+ SkTHashMap<uint32_t, SkPDFDict*> fFontDescriptors;
+ SkTHashMap<uint64_t, SkPDFFont*> fFontMap;
SkPixelSerializer* getPixelSerializer() const { return fPixelSerializer.get(); }
void setPixelSerializer(sk_sp<SkPixelSerializer> ps) {
@@ -75,13 +70,6 @@ public:
sk_sp<SkPDFArray> makeRangeObject();
private:
- struct FontRec {
- SkPDFFont* fFont;
- uint32_t fFontID;
- uint16_t fGlyphID;
- };
- SkTDArray<FontRec> fFontRecords;
-
struct ShaderRec {
SkPDFShader::State fShaderState;
sk_sp<SkPDFObject> fShaderObject;
« no previous file with comments | « no previous file | src/pdf/SkPDFCanon.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698