summaryrefslogtreecommitdiffstats
path: root/gfx/skia/patches/archive/mingw-fix.patch
blob: d91a16aa702835dbc0be8f795f905ac935da3ca3 (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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h
index 0135b85..bb108f8 100644
--- a/gfx/skia/include/core/SkPostConfig.h
+++ b/gfx/skia/include/core/SkPostConfig.h
@@ -253,7 +253,7 @@
 //////////////////////////////////////////////////////////////////////
 
 #ifndef SK_OVERRIDE
-#if defined(SK_BUILD_FOR_WIN)
+#if defined(_MSC_VER)
 #define SK_OVERRIDE override
 #elif defined(__clang__)
 // Some documentation suggests we should be using __attribute__((override)),
diff --git a/gfx/skia/src/ports/SkFontHost_win.cpp b/gfx/skia/src/ports/SkFontHost_win.cpp
index dd9c5dc..ca2c3dc 100644
--- a/gfx/skia/src/ports/SkFontHost_win.cpp
+++ b/gfx/skia/src/ports/SkFontHost_win.cpp
@@ -22,7 +22,7 @@
 #ifdef WIN32
 #include "windows.h"
 #include "tchar.h"
-#include "Usp10.h"
+#include "usp10.h"
 
 // always packed xxRRGGBB
 typedef uint32_t SkGdiRGB;
@@ -1033,6 +1033,10 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
     HFONT savefont = (HFONT)SelectObject(hdc, font);
     HFONT designFont = NULL;
 
+    const char stem_chars[] = {'i', 'I', '!', '1'};
+    int16_t min_width;
+    unsigned glyphCount;
+
     // To request design units, create a logical font whose height is specified
     // as unitsPerEm.
     OUTLINETEXTMETRIC otm;
@@ -1046,7 +1050,7 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
     if (!GetOutlineTextMetrics(hdc, sizeof(otm), &otm)) {
         goto Error;
     }
-    const unsigned glyphCount = calculateGlyphCount(hdc);
+    glyphCount = calculateGlyphCount(hdc);
 
     info = new SkAdvancedTypefaceMetrics;
     info->fEmSize = otm.otmEMSquare;
@@ -1115,9 +1119,8 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
 
     // Figure out a good guess for StemV - Min width of i, I, !, 1.
     // This probably isn't very good with an italic font.
-    int16_t min_width = SHRT_MAX;
+    min_width = SHRT_MAX;
     info->fStemV = 0;
-    char stem_chars[] = {'i', 'I', '!', '1'};
     for (size_t i = 0; i < SK_ARRAY_COUNT(stem_chars); i++) {
         ABC abcWidths;
         if (GetCharABCWidths(hdc, stem_chars[i], stem_chars[i], &abcWidths)) {