mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-28 23:31:56 +00:00
Bug 705656 - Broken SKIA compilation on mingw r=matt.woodrow
This commit is contained in:
parent
0c4d75af57
commit
4156ca57a6
@ -342,3 +342,11 @@ CPPSRCS += \
|
||||
endif
|
||||
|
||||
include $(topsrcdir)/config/rules.mk
|
||||
|
||||
ifneq (,$(INTEL_ARCHITECTURE))
|
||||
ifdef GNU_CC
|
||||
SkBitmapProcState_opts_SSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
|
||||
SkBlitRow_opts_SSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
|
||||
SkUtils_opts_SSE2.$(OBJ_SUFFIX): CXXFLAGS+=-msse2
|
||||
endif
|
||||
endif
|
||||
|
@ -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)),
|
||||
|
57
gfx/skia/mingw-fix.patch
Normal file
57
gfx/skia/mingw-fix.patch
Normal file
@ -0,0 +1,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)) {
|
@ -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)) {
|
||||
|
@ -104,4 +104,7 @@ patch -p3 < new-aa.patch
|
||||
# Bug 688366 - Fix Skia marking radial gradients with the same radius as invalid.
|
||||
patch -p3 < radial-gradients.patch
|
||||
# Fix restrict keyword problem for VS2005
|
||||
patch -p3 < skia-restrict-problem.patch
|
||||
patch -p3 < skia_restrict_problem.patch
|
||||
# Bug 705656 - Broken SKIA compilation on mingw
|
||||
patch -p3 < mingw-fix.patch
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user