Bug 735194 - gfxDWriteFontList.cpp fails to compile on mingw r=bas
authorJacek Caban <jacek@codeweavers.com>
Wed, 04 Apr 2012 11:12:11 +0200
changeset 94307 c52251654441353a20ab001dbf4c6d0685358dd5
parent 94306 4b20ef3e8e8a9554d03a6294b3a2b8a35b7c6bce
child 94308 523d5c5c53eb9f18f460bdedad4c824cc1f6b0fe
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas
bugs735194
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 735194 - gfxDWriteFontList.cpp fails to compile on mingw r=bas
gfx/thebes/gfxDWriteFontList.cpp
gfx/thebes/gfxDWriteFontList.h
--- a/gfx/thebes/gfxDWriteFontList.cpp
+++ b/gfx/thebes/gfxDWriteFontList.cpp
@@ -316,18 +316,18 @@ gfxDWriteFontEntry::GetFontTable(PRUint3
     {
         LOGFONTW logfont = { 0 };
         if (!InitLogFont(mFont, &logfont))
             return NS_ERROR_FAILURE;
 
         AutoDC dc;
         AutoSelectFont font(dc.GetDC(), &logfont);
         if (font.IsValid()) {
-            PRInt32 tableSize =
-                ::GetFontData(dc.GetDC(), NS_SWAP32(aTableTag), 0, NULL, NULL);
+            PRUint32 tableSize =
+                ::GetFontData(dc.GetDC(), NS_SWAP32(aTableTag), 0, NULL, 0);
             if (tableSize != GDI_ERROR) {
                 if (aBuffer.SetLength(tableSize)) {
                     ::GetFontData(dc.GetDC(), NS_SWAP32(aTableTag), 0,
                                   aBuffer.Elements(), aBuffer.Length());
                     return NS_OK;
                 }
                 return NS_ERROR_OUT_OF_MEMORY;
             }
@@ -664,18 +664,16 @@ gfxDWriteFontList::MakePlatformFont(cons
 
     rv = gfxFontUtils::RenameFont(uniqueName, aFontData, aLength, &newFontData);
     NS_Free((void*)aFontData);
 
     if (NS_FAILED(rv)) {
         return nsnull;
     }
     
-    DWORD numFonts = 0;
-
     nsRefPtr<IDWriteFontFile> fontFile;
     HRESULT hr;
 
     /**
      * We pass in a pointer to a structure containing a pointer to the array
      * containing the font data and a unique identifier. DWrite will
      * internally copy what is at that pointer, and pass that to
      * CreateStreamFromKey. The array will be empty when the function 
@@ -705,17 +703,16 @@ gfxDWriteFontList::MakePlatformFont(cons
         NS_WARNING("Failed to create custom font file reference.");
         return nsnull;
     }
 
     BOOL isSupported;
     DWRITE_FONT_FILE_TYPE fileType;
     UINT32 numFaces;
 
-    PRUint16 w = (aProxyEntry->mWeight == 0 ? 400 : aProxyEntry->mWeight);
     gfxDWriteFontEntry *entry = 
         new gfxDWriteFontEntry(uniqueName, 
                                fontFile,
                                aProxyEntry->Weight(),
                                aProxyEntry->Stretch(),
                                aProxyEntry->IsItalic());
 
     fontFile->Analyze(&isSupported, &fileType, &entry->mFaceType, &numFaces);
@@ -761,17 +758,17 @@ gfxDWriteFontList::InitFontList()
     LARGE_INTEGER frequency;        // ticks per second
     LARGE_INTEGER t1, t2, t3;           // ticks
     double elapsedTime, upTime;
     char nowTime[256], nowDate[256];
 
     if (LOG_FONTINIT_ENABLED()) {    
         GetTimeFormat(LOCALE_INVARIANT, TIME_FORCE24HOURFORMAT, 
                       NULL, NULL, nowTime, 256);
-        GetDateFormat(LOCALE_INVARIANT, NULL, NULL, NULL, nowDate, 256);
+        GetDateFormat(LOCALE_INVARIANT, 0, NULL, NULL, nowDate, 256);
     }
     upTime = (double) GetTickCount();
     QueryPerformanceFrequency(&frequency);
     QueryPerformanceCounter(&t1);
 
     HRESULT hr;
     gfxFontCache *fc = gfxFontCache::GetCache();
     if (fc) {
@@ -829,17 +826,17 @@ gfxDWriteFontList::DelayedInitFontList()
     LARGE_INTEGER frequency;        // ticks per second
     LARGE_INTEGER t1, t2, t3;           // ticks
     double elapsedTime, upTime;
     char nowTime[256], nowDate[256];
 
     if (LOG_FONTINIT_ENABLED()) {    
         GetTimeFormat(LOCALE_INVARIANT, TIME_FORCE24HOURFORMAT, 
                       NULL, NULL, nowTime, 256);
-        GetDateFormat(LOCALE_INVARIANT, NULL, NULL, NULL, nowDate, 256);
+        GetDateFormat(LOCALE_INVARIANT, 0, NULL, NULL, nowDate, 256);
     }
 
     upTime = (double) GetTickCount();
     QueryPerformanceFrequency(&frequency);
     QueryPerformanceCounter(&t1);
 
     HRESULT hr;
 
@@ -1309,23 +1306,23 @@ static nsresult GetFamilyName(IDWriteFon
     return NS_OK;
 }
 
 // bug 705594 - the method below doesn't actually do any "drawing", it's only
 // used to invoke the DirectWrite layout engine to determine the fallback font
 // for a given character.
 
 IFACEMETHODIMP FontFallbackRenderer::DrawGlyphRun(
-    __maybenull void* clientDrawingContext,
+    void* clientDrawingContext,
     FLOAT baselineOriginX,
     FLOAT baselineOriginY,
     DWRITE_MEASURING_MODE measuringMode,
-    __in DWRITE_GLYPH_RUN const* glyphRun,
-    __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
-    __maybenull IUnknown* clientDrawingEffect
+    DWRITE_GLYPH_RUN const* glyphRun,
+    DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
+    IUnknown* clientDrawingEffect
     )
 {
     if (!mSystemFonts) {
         return E_FAIL;
     }
 
     HRESULT hr = S_OK;
 
--- a/gfx/thebes/gfxDWriteFontList.h
+++ b/gfx/thebes/gfxDWriteFontList.h
@@ -227,86 +227,86 @@ public:
         NS_ASSERTION(SUCCEEDED(hr), "GetSystemFontCollection failed!");
     }
 
     ~FontFallbackRenderer()
     {}
 
     // IDWriteTextRenderer methods
     IFACEMETHOD(DrawGlyphRun)(
-        __maybenull void* clientDrawingContext,
+        void* clientDrawingContext,
         FLOAT baselineOriginX,
         FLOAT baselineOriginY,
         DWRITE_MEASURING_MODE measuringMode,
-        __in DWRITE_GLYPH_RUN const* glyphRun,
-        __in DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
-        __maybenull IUnknown* clientDrawingEffect
+        DWRITE_GLYPH_RUN const* glyphRun,
+        DWRITE_GLYPH_RUN_DESCRIPTION const* glyphRunDescription,
+        IUnknown* clientDrawingEffect
         );
 
     IFACEMETHOD(DrawUnderline)(
-        __maybenull void* clientDrawingContext,
+        void* clientDrawingContext,
         FLOAT baselineOriginX,
         FLOAT baselineOriginY,
-        __in DWRITE_UNDERLINE const* underline,
-        __maybenull IUnknown* clientDrawingEffect
+        DWRITE_UNDERLINE const* underline,
+        IUnknown* clientDrawingEffect
         )
     {
         return E_NOTIMPL;
     }
 
 
     IFACEMETHOD(DrawStrikethrough)(
-        __maybenull void* clientDrawingContext,
+        void* clientDrawingContext,
         FLOAT baselineOriginX,
         FLOAT baselineOriginY,
-        __in DWRITE_STRIKETHROUGH const* strikethrough,
-        __maybenull IUnknown* clientDrawingEffect
+        DWRITE_STRIKETHROUGH const* strikethrough,
+        IUnknown* clientDrawingEffect
         )
     {
         return E_NOTIMPL;
     }
 
 
     IFACEMETHOD(DrawInlineObject)(
-        __maybenull void* clientDrawingContext,
+        void* clientDrawingContext,
         FLOAT originX,
         FLOAT originY,
         IDWriteInlineObject* inlineObject,
         BOOL isSideways,
         BOOL isRightToLeft,
-        __maybenull IUnknown* clientDrawingEffect
+        IUnknown* clientDrawingEffect
         )
     {
         return E_NOTIMPL;
     }
 
     // IDWritePixelSnapping methods
 
     IFACEMETHOD(IsPixelSnappingDisabled)(
-        __maybenull void* clientDrawingContext,
-        __out BOOL* isDisabled
+        void* clientDrawingContext,
+        BOOL* isDisabled
         )
     {
         *isDisabled = FALSE;
         return S_OK;
     }
 
     IFACEMETHOD(GetCurrentTransform)(
-        __maybenull void* clientDrawingContext,
-        __out DWRITE_MATRIX* transform
+        void* clientDrawingContext,
+        DWRITE_MATRIX* transform
         )
     {
         const DWRITE_MATRIX ident = {1.0, 0.0, 0.0, 1.0, 0.0, 0.0};
         *transform = ident;
         return S_OK;
     }
 
     IFACEMETHOD(GetPixelsPerDip)(
-        __maybenull void* clientDrawingContext,
-        __out FLOAT* pixelsPerDip
+        void* clientDrawingContext,
+        FLOAT* pixelsPerDip
         )
     {
         *pixelsPerDip = 1.0f;
         return S_OK;
     }
 
     // IUnknown methods
 
@@ -342,17 +342,17 @@ public:
 
         this->AddRef();
         return S_OK;
     }
 
     const nsString& FallbackFamilyName() { return mFamilyName; }
 
 protected:
-    unsigned long mRefCount;
+    long mRefCount;
     nsRefPtr<IDWriteFontCollection> mSystemFonts;
     nsString mFamilyName;
 };
 
 
 
 class gfxDWriteFontList : public gfxPlatformFontList {
 public: