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

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 diff --git a/gfx/skia/include/core/SkPostConfig.h b/gfx/skia/include/core/SkPostConfig.h
michael@0 2 index 0135b85..bb108f8 100644
michael@0 3 --- a/gfx/skia/include/core/SkPostConfig.h
michael@0 4 +++ b/gfx/skia/include/core/SkPostConfig.h
michael@0 5 @@ -253,7 +253,7 @@
michael@0 6 //////////////////////////////////////////////////////////////////////
michael@0 7
michael@0 8 #ifndef SK_OVERRIDE
michael@0 9 -#if defined(SK_BUILD_FOR_WIN)
michael@0 10 +#if defined(_MSC_VER)
michael@0 11 #define SK_OVERRIDE override
michael@0 12 #elif defined(__clang__)
michael@0 13 // Some documentation suggests we should be using __attribute__((override)),
michael@0 14 diff --git a/gfx/skia/src/ports/SkFontHost_win.cpp b/gfx/skia/src/ports/SkFontHost_win.cpp
michael@0 15 index dd9c5dc..ca2c3dc 100644
michael@0 16 --- a/gfx/skia/src/ports/SkFontHost_win.cpp
michael@0 17 +++ b/gfx/skia/src/ports/SkFontHost_win.cpp
michael@0 18 @@ -22,7 +22,7 @@
michael@0 19 #ifdef WIN32
michael@0 20 #include "windows.h"
michael@0 21 #include "tchar.h"
michael@0 22 -#include "Usp10.h"
michael@0 23 +#include "usp10.h"
michael@0 24
michael@0 25 // always packed xxRRGGBB
michael@0 26 typedef uint32_t SkGdiRGB;
michael@0 27 @@ -1033,6 +1033,10 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
michael@0 28 HFONT savefont = (HFONT)SelectObject(hdc, font);
michael@0 29 HFONT designFont = NULL;
michael@0 30
michael@0 31 + const char stem_chars[] = {'i', 'I', '!', '1'};
michael@0 32 + int16_t min_width;
michael@0 33 + unsigned glyphCount;
michael@0 34 +
michael@0 35 // To request design units, create a logical font whose height is specified
michael@0 36 // as unitsPerEm.
michael@0 37 OUTLINETEXTMETRIC otm;
michael@0 38 @@ -1046,7 +1050,7 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
michael@0 39 if (!GetOutlineTextMetrics(hdc, sizeof(otm), &otm)) {
michael@0 40 goto Error;
michael@0 41 }
michael@0 42 - const unsigned glyphCount = calculateGlyphCount(hdc);
michael@0 43 + glyphCount = calculateGlyphCount(hdc);
michael@0 44
michael@0 45 info = new SkAdvancedTypefaceMetrics;
michael@0 46 info->fEmSize = otm.otmEMSquare;
michael@0 47 @@ -1115,9 +1119,8 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
michael@0 48
michael@0 49 // Figure out a good guess for StemV - Min width of i, I, !, 1.
michael@0 50 // This probably isn't very good with an italic font.
michael@0 51 - int16_t min_width = SHRT_MAX;
michael@0 52 + min_width = SHRT_MAX;
michael@0 53 info->fStemV = 0;
michael@0 54 - char stem_chars[] = {'i', 'I', '!', '1'};
michael@0 55 for (size_t i = 0; i < SK_ARRAY_COUNT(stem_chars); i++) {
michael@0 56 ABC abcWidths;
michael@0 57 if (GetCharABCWidths(hdc, stem_chars[i], stem_chars[i], &abcWidths)) {

mercurial