Bug 1364560 WORK IN PROGRESS Fix Skia 59 build in Mingw??? draft
authorTom Ritter <tom@mozilla.com>
Mon, 15 May 2017 15:35:48 -0500
changeset 668899 6974bc1956d462fc10c8309dd3f1f2636aca7f8c
parent 668898 8d48820af196443256717dc6a1700435d093aa41
child 668900 1f99068f7e8b196d8c8624f20f2141513bb3ea98
push id81148
push userbmo:tom@mozilla.com
push dateFri, 22 Sep 2017 05:30:55 +0000
bugs1364560
milestone58.0a1
Bug 1364560 WORK IN PROGRESS Fix Skia 59 build in Mingw??? MozReview-Commit-ID: ETNT54NWMEt
gfx/skia/moz.build
gfx/skia/skia/src/core/SkExecutor.cpp
gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
--- a/gfx/skia/moz.build
+++ b/gfx/skia/moz.build
@@ -593,17 +593,17 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk
     ]
     SOURCES += [
         'skia/src/jumper/SkJumper_generated.S',
         'skia/src/ports/SkFontHost_cairo.cpp',
         'skia/src/ports/SkFontHost_FreeType_common.cpp',
     ]
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     SOURCES += [
-        'skia/src/jumper/SkJumper_generated_win.S',
+#        'skia/src/jumper/SkJumper_generated_win.S',
         'skia/src/ports/SkDebug_win.cpp',
         'skia/src/ports/SkFontHost_win.cpp',
         'skia/src/ports/SkFontMgr_win_dw.cpp',
         'skia/src/ports/SkFontMgr_win_dw_factory.cpp',
         'skia/src/ports/SkOSFile_win.cpp',
         'skia/src/ports/SkOSLibrary_win.cpp',
         'skia/src/ports/SkScalerContext_win_dw.cpp',
         'skia/src/ports/SkTLS_win.cpp',
--- a/gfx/skia/skia/src/core/SkExecutor.cpp
+++ b/gfx/skia/skia/src/core/SkExecutor.cpp
@@ -8,17 +8,17 @@
 #include "SkExecutor.h"
 #include "SkMakeUnique.h"
 #include "SkMutex.h"
 #include "SkSemaphore.h"
 #include "SkSpinlock.h"
 #include "SkTArray.h"
 #include "SkThreadUtils.h"
 
-#if defined(_MSC_VER)
+#if defined(_MSC_VER) || defined(__MINGW32__)
     #include <windows.h>
     static int num_cores() {
         SYSTEM_INFO sysinfo;
         GetNativeSystemInfo(&sysinfo);
         return (int)sysinfo.dwNumberOfProcessors;
     }
 #else
     #include <unistd.h>
--- a/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
+++ b/gfx/skia/skia/src/ports/SkScalerContext_win_dw.cpp
@@ -286,26 +286,26 @@ SkScalerContext_DW::SkScalerContext_DW(s
         fTextureType = DWRITE_TEXTURE_ALIASED_1x1;
         fTextSizeMeasure = gdiTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_GDI_CLASSIC;
 
     // If we can use a bitmap, use gdi classic rendering and measurement.
     // This will not always provide a bitmap, but matches expected behavior.
     } else if ((treatLikeBitmap && axisAlignedBitmap) || typeface->ForceGDI()) {
         fTextSizeRender = gdiTextSize;
-        fRenderingMode = DWRITE_RENDERING_MODE_GDI_CLASSIC;
+        fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC;
         fTextureType = DWRITE_TEXTURE_CLEARTYPE_3x1;
         fTextSizeMeasure = gdiTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_GDI_CLASSIC;
 
     // If rotated but the horizontal text could have used a bitmap,
     // render high quality rotated glyphs but measure using bitmap metrics.
     } else if (treatLikeBitmap) {
         fTextSizeRender = gdiTextSize;
-        fRenderingMode = DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC;
+        fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC;
         fTextureType = DWRITE_TEXTURE_CLEARTYPE_3x1;
         fTextSizeMeasure = gdiTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_GDI_CLASSIC;
 
     // If the font has a gasp table version 1, use it to determine symmetric rendering.
     } else if ((get_gasp_range(typeface, SkScalarRoundToInt(gdiTextSize), &range) &&
                 range.fVersion >= 1) ||
     // If the requested size is above 20px or there are no bytecode hints, use symmetric rendering.
@@ -342,17 +342,17 @@ SkScalerContext_DW::SkScalerContext_DW(s
     // Tenor Sans
     //    https://fonts.google.com/specimen/Tenor+Sans
     // Gill Sans W04
     //    https://cdn.leagueoflegends.com/lolkit/1.1.9/resources/fonts/gill-sans-w04-book.woff
     //    https://na.leagueoflegends.com/en/news/game-updates/patch/patch-410-notes
     // See https://crbug.com/385897
     } else {
         fTextSizeRender = gdiTextSize;
-        fRenderingMode = DWRITE_RENDERING_MODE_NATURAL;
+        fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL;
         fTextureType = DWRITE_TEXTURE_CLEARTYPE_3x1;
         fTextSizeMeasure = realTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_NATURAL;
     }
 
     // DirectWrite2 allows for grayscale hinting.
     fAntiAliasMode = DWRITE_TEXT_ANTIALIAS_MODE_CLEARTYPE;
     if (typeface->fFactory2 && typeface->fDWriteFontFace2 &&
@@ -364,17 +364,17 @@ SkScalerContext_DW::SkScalerContext_DW(s
         fAntiAliasMode = DWRITE_TEXT_ANTIALIAS_MODE_GRAYSCALE;
     }
 
     // DirectWrite2 allows hinting to be disabled.
     fGridFitMode = DWRITE_GRID_FIT_MODE_ENABLED;
     if (fRec.getHinting() == SkPaint::kNo_Hinting) {
         fGridFitMode = DWRITE_GRID_FIT_MODE_DISABLED;
         if (fRenderingMode != DWRITE_RENDERING_MODE_ALIASED) {
-            fRenderingMode = DWRITE_RENDERING_MODE_NATURAL_SYMMETRIC;
+            fRenderingMode = DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC;
         }
     }
 
     if (this->isSubpixel()) {
         fTextSizeMeasure = realTextSize;
         fMeasuringMode = DWRITE_MEASURING_MODE_NATURAL;
     }
 }