Index: src/ports/SkTypeface_win_dw.h |
diff --git a/src/ports/SkTypeface_win_dw.h b/src/ports/SkTypeface_win_dw.h |
index 1119841e00285f55e657bae1659b98e7d61541e9..3c896b5c4aea0d659a4c78ff4fb943ca6c93dbbf 100644 |
--- a/src/ports/SkTypeface_win_dw.h |
+++ b/src/ports/SkTypeface_win_dw.h |
@@ -20,6 +20,9 @@ |
#if SK_HAS_DWRITE_1_H |
# include <dwrite_1.h> |
#endif |
+#if SK_HAS_DWRITE_2_H |
+# include <dwrite_2.h> |
+#endif |
class SkFontDescriptor; |
struct SkScalerContextRec; |
@@ -61,10 +64,23 @@ private: |
SkASSERT_RELEASE(nullptr == fDWriteFontFace1.get()); |
} |
#endif |
+#if SK_HAS_DWRITE_2_H |
+ if (!SUCCEEDED(fDWriteFontFace->QueryInterface(&fDWriteFontFace2))) { |
+ SkASSERT_RELEASE(nullptr == fDWriteFontFace2.get()); |
+ } |
+ if (!SUCCEEDED(fFactory->QueryInterface(&fFactory2))) { |
+ SkASSERT_RELEASE(nullptr == fFactory2.get()); |
+ } |
+#endif |
} |
public: |
SkTScopedComPtr<IDWriteFactory> fFactory; |
+#if SK_HAS_DWRITE_2_H |
+ SkTScopedComPtr<IDWriteFactory2> fFactory2; |
+#else |
+ const decltype(nullptr) fFactory2 = nullptr; |
+#endif |
SkTScopedComPtr<IDWriteFontCollectionLoader> fDWriteFontCollectionLoader; |
SkTScopedComPtr<IDWriteFontFileLoader> fDWriteFontFileLoader; |
SkTScopedComPtr<IDWriteFontFamily> fDWriteFontFamily; |
@@ -73,6 +89,11 @@ public: |
#if SK_HAS_DWRITE_1_H |
SkTScopedComPtr<IDWriteFontFace1> fDWriteFontFace1; |
#endif |
+#if SK_HAS_DWRITE_2_H |
+ SkTScopedComPtr<IDWriteFontFace2> fDWriteFontFace2; |
+#else |
+ const decltype(nullptr) fDWriteFontFace2 = nullptr; |
+#endif |
static DWriteFontTypeface* Create(IDWriteFactory* factory, |
IDWriteFontFace* fontFace, |