summaryrefslogtreecommitdiffstats
path: root/external/skia/fix-windows-dwrite.patch.1
blob: b5f216a5258d8f675bb4451d7f9694fb0cc6edd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
diff --git a/src/ports/SkFontMgr_win_dw.cpp b/src/ports/SkFontMgr_win_dw.cpp
index 6a4748f91c..50086a7780 100644
--- a/src/ports/SkFontMgr_win_dw.cpp
+++ b/src/ports/SkFontMgr_win_dw.cpp
@@ -361,6 +361,7 @@ static bool FindByDWriteFont(SkTypeface* cached, void* ctx) {
     DWriteFontTypeface* cshFace = reinterpret_cast<DWriteFontTypeface*>(cached);
     ProtoDWriteTypeface* ctxFace = reinterpret_cast<ProtoDWriteTypeface*>(ctx);
 
+#if defined(NTDDI_WIN10_RS3) && NTDDI_VERSION >= NTDDI_WIN10_RS3
     // IDWriteFontFace5 introduced both Equals and HasVariations
     SkTScopedComPtr<IDWriteFontFace5> cshFontFace5;
     SkTScopedComPtr<IDWriteFontFace5> ctxFontFace5;
@@ -369,6 +370,7 @@ static bool FindByDWriteFont(SkTypeface* cached, void* ctx) {
     if (cshFontFace5 && ctxFontFace5) {
         return cshFontFace5->Equals(ctxFontFace5.get());
     }
+#endif
 
     bool same;
 
diff --git a/src/ports/SkScalerContext_win_dw.cpp b/src/ports/SkScalerContext_win_dw.cpp
index b2df467b22..385094e506 100644
--- a/src/ports/SkScalerContext_win_dw.cpp
+++ b/src/ports/SkScalerContext_win_dw.cpp
@@ -778,6 +778,7 @@ void SkScalerContext_DW::generateFontMetrics(SkFontMetrics* metrics) {
     metrics->fFlags |= SkFontMetrics::kStrikeoutThicknessIsValid_Flag;
     metrics->fFlags |= SkFontMetrics::kStrikeoutPositionIsValid_Flag;
 
+#if defined(NTDDI_WIN10_RS3) && NTDDI_VERSION >= NTDDI_WIN10_RS3
     SkTScopedComPtr<IDWriteFontFace5> fontFace5;
     if (SUCCEEDED(this->getDWriteTypeface()->fDWriteFontFace->QueryInterface(&fontFace5))) {
         if (fontFace5->HasVariations()) {
@@ -785,6 +786,7 @@ void SkScalerContext_DW::generateFontMetrics(SkFontMetrics* metrics) {
             metrics->fFlags |= SkFontMetrics::kBoundsInvalid_Flag;
         }
     }
+#endif
 
     if (this->getDWriteTypeface()->fDWriteFontFace1.get()) {
         DWRITE_FONT_METRICS1 dwfm1;