Index: src/ports/SkTypeface_win_dw.h |
diff --git a/src/ports/SkTypeface_win_dw.h b/src/ports/SkTypeface_win_dw.h |
index b064ce5770a2f5a8b78f4f51321a638977fd8fb6..465db3446bfb3cc2568ac505dc26ae1a16270990 100644 |
--- a/src/ports/SkTypeface_win_dw.h |
+++ b/src/ports/SkTypeface_win_dw.h |
@@ -17,6 +17,7 @@ |
#include "SkTypes.h" |
#include <dwrite.h> |
+#include <dwrite_1.h> |
class SkFontDescriptor; |
struct SkScalerContextRec; |
@@ -50,7 +51,13 @@ private: |
, fDWriteFontFamily(SkRefComPtr(fontFamily)) |
, fDWriteFont(SkRefComPtr(font)) |
, fDWriteFontFace(SkRefComPtr(fontFace)) |
- { } |
+ { |
+ if (!SUCCEEDED(fDWriteFontFace->QueryInterface(&fDWriteFontFace1))) { |
+ // IUnknown::QueryInterface states that if it fails, punk will be set to NULL. |
+ // http://blogs.msdn.com/b/oldnewthing/archive/2004/03/26/96777.aspx |
+ SK_ALWAYSBREAK(NULL == fDWriteFontFace1.get()); |
+ } |
+ } |
public: |
SkTScopedComPtr<IDWriteFactory> fFactory; |
@@ -59,6 +66,7 @@ public: |
SkTScopedComPtr<IDWriteFontFamily> fDWriteFontFamily; |
SkTScopedComPtr<IDWriteFont> fDWriteFont; |
SkTScopedComPtr<IDWriteFontFace> fDWriteFontFace; |
+ SkTScopedComPtr<IDWriteFontFace1> fDWriteFontFace1; |
static DWriteFontTypeface* Create(IDWriteFactory* factory, |
IDWriteFontFace* fontFace, |