gecko-dev/gfx/skia/patches/archive/mingw-fix.patch

58 строки
2.1 KiB
Diff

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)) {