aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkPDFCanon.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/pdf/SkPDFCanon.h')
-rw-r--r--src/pdf/SkPDFCanon.h25
1 files changed, 23 insertions, 2 deletions
diff --git a/src/pdf/SkPDFCanon.h b/src/pdf/SkPDFCanon.h
index 03671bf921..8edd06e391 100644
--- a/src/pdf/SkPDFCanon.h
+++ b/src/pdf/SkPDFCanon.h
@@ -7,13 +7,14 @@
#ifndef SkPDFCanon_DEFINED
#define SkPDFCanon_DEFINED
+#include "SkBitmapKey.h"
+#include "SkPDFGradientShader.h"
#include "SkPDFGraphicState.h"
#include "SkPDFShader.h"
-#include "SkPDFGradientShader.h"
#include "SkPixelSerializer.h"
#include "SkTDArray.h"
#include "SkTHash.h"
-#include "SkBitmapKey.h"
+#include "SkTypeface.h"
class SkPDFFont;
struct SkAdvancedTypefaceMetrics;
@@ -46,5 +47,25 @@ public:
sk_sp<SkPDFStream> fInvertFunction;
sk_sp<SkPDFDict> fNoSmaskGraphicState;
sk_sp<SkPDFArray> fRangeObject;
+
+ SK_BEGIN_REQUIRE_DENSE
+ struct BitmapGlyphKey {
+ SkFontID fFontID; // uint32_t
+ SkScalar fTextSize; // float32
+ SkScalar fTextScaleX; // float32
+ SkScalar fTextSkewX; // float32
+ SkGlyphID fGlyphID; // uint16_t
+ uint16_t fPadding;
+ };
+ SK_END_REQUIRE_DENSE
+ struct BitmapGlyph {
+ sk_sp<SkImage> fImage;
+ SkIPoint fOffset;
+ };
+ SkTHashMap<BitmapGlyphKey, BitmapGlyph> fBitmapGlyphImages;
};
+
+inline bool operator==(const SkPDFCanon::BitmapGlyphKey& u, const SkPDFCanon::BitmapGlyphKey& v) {
+ return memcmp(&u, &u, sizeof(SkPDFCanon::BitmapGlyphKey)) == 0;
+}
#endif // SkPDFCanon_DEFINED