Bug 1059691. Cleanup tabs in gfx/thebes source files. r=mkato
authorJohn Daggett <jdaggett@mozilla.com>
Fri, 29 Aug 2014 13:18:28 +0900
changeset 202319 beb9d95844dd10fd5dbcc32a785409cdffee31eb
parent 202318 7cf240d886421e401b1d2974261de08fc9361033
child 202320 8669b13c8567a30c42854662ff8de9d6f1d77b3b
push id48390
push userjdaggett@mozilla.com
push dateFri, 29 Aug 2014 04:18:57 +0000
treeherdermozilla-inbound@beb9d95844dd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkato
bugs1059691
milestone34.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 1059691. Cleanup tabs in gfx/thebes source files. r=mkato
gfx/thebes/MathTableStructures.h
gfx/thebes/gfxD2DSurface.cpp
gfx/thebes/gfxFontconfigUtils.cpp
gfx/thebes/gfxGradientCache.h
gfx/thebes/gfxHarfBuzzShaper.cpp
gfx/thebes/gfxQuartzSurface.cpp
gfx/thebes/gfxWindowsNativeDrawing.cpp
gfx/thebes/gfxWindowsPlatform.cpp
gfx/thebes/gfxXlibSurface.cpp
--- a/gfx/thebes/MathTableStructures.h
+++ b/gfx/thebes/MathTableStructures.h
@@ -93,17 +93,17 @@ struct MathGlyphVariantRecord {
 
 struct MathGlyphConstruction {
   Offset                    mGlyphAssembly;
   Count16                   mVariantCount;
   // MathGlyphVariantRecord mMathGlyphVariantRecord[mVariantCount]
 };
 
 struct GlyphPartRecord {
-  GlyphID	              mGlyph;
+  GlyphID                    mGlyph;
   mozilla::AutoSwap_PRUint16 mStartConnectorLength;
   mozilla::AutoSwap_PRUint16 mEndConnectorLength;
   mozilla::AutoSwap_PRUint16 mFullAdvance;
   mozilla::AutoSwap_PRUint16 mPartFlags;
 };
 
 // PartFlags enumeration currently uses only one bit:
 // 0x0001 If set, the part can be skipped or repeated.
--- a/gfx/thebes/gfxD2DSurface.cpp
+++ b/gfx/thebes/gfxD2DSurface.cpp
@@ -16,25 +16,25 @@ gfxD2DSurface::gfxD2DSurface(HWND aWnd, 
         (cairo_content_t)(int)aContent));
 }
 
 gfxD2DSurface::gfxD2DSurface(HANDLE handle, gfxContentType aContent)
 {
     Init(cairo_d2d_surface_create_for_handle(
         gfxWindowsPlatform::GetPlatform()->GetD2DDevice(),
         handle,
-	(cairo_content_t)(int)aContent));
+        (cairo_content_t)(int)aContent));
 }
 
 gfxD2DSurface::gfxD2DSurface(ID3D10Texture2D *texture, gfxContentType aContent)
 {
     Init(cairo_d2d_surface_create_for_texture(
         gfxWindowsPlatform::GetPlatform()->GetD2DDevice(),
         texture,
-	(cairo_content_t)(int)aContent));
+        (cairo_content_t)(int)aContent));
 }
 
 gfxD2DSurface::gfxD2DSurface(cairo_surface_t *csurf)
 {
     Init(csurf, true);
 }
 
 gfxD2DSurface::gfxD2DSurface(const gfxIntSize& size,
--- a/gfx/thebes/gfxFontconfigUtils.cpp
+++ b/gfx/thebes/gfxFontconfigUtils.cpp
@@ -597,44 +597,44 @@ gfxFontconfigUtils::UpdateFontListIntern
 
     mFontsByFamily.Clear();
     mFontsByFullname.Clear();
     mLangSupportTable.Clear();
     mAliasForMultiFonts.Clear();
 
     // Record the existing font families
     for (unsigned fs = 0; fs < ArrayLength(fontSets); ++fs) {
-	FcFontSet *fontSet = fontSets[fs];
-	if (!fontSet) { // the application set might not exist
-	    continue;
-	}
-	for (int f = 0; f < fontSet->nfont; ++f) {
-	    FcPattern *font = fontSet->fonts[f];
+        FcFontSet *fontSet = fontSets[fs];
+        if (!fontSet) { // the application set might not exist
+            continue;
+        }
+        for (int f = 0; f < fontSet->nfont; ++f) {
+            FcPattern *font = fontSet->fonts[f];
 
-	    FcChar8 *family;
-	    for (int v = 0;
-		 FcPatternGetString(font, FC_FAMILY, v, &family) == FcResultMatch;
-		 ++v) {
-		FontsByFcStrEntry *entry = mFontsByFamily.PutEntry(family);
-		if (entry) {
-		    bool added = entry->AddFont(font);
+            FcChar8 *family;
+            for (int v = 0;
+             FcPatternGetString(font, FC_FAMILY, v, &family) == FcResultMatch;
+             ++v) {
+                FontsByFcStrEntry *entry = mFontsByFamily.PutEntry(family);
+                if (entry) {
+                    bool added = entry->AddFont(font);
 
-		    if (!entry->mKey) {
-			// The reference to the font pattern keeps the pointer to
-			// string for the key valid.  If adding the font failed
-			// then the entry must be removed.
-			if (added) {
-			    entry->mKey = family;
-			} else {
-			    mFontsByFamily.RawRemoveEntry(entry);
-			}
-		    }
-		}
-	    }
-	}
+                    if (!entry->mKey) {
+                        // The reference to the font pattern keeps the pointer to
+                        // string for the key valid.  If adding the font failed
+                        // then the entry must be removed.
+                        if (added) {
+                            entry->mKey = family;
+                        } else {
+                            mFontsByFamily.RawRemoveEntry(entry);
+                        }
+                    }
+                }
+            }
+        }
     }
 
     // XXX we don't support all alias names.
     // Because if we don't check whether the given font name is alias name,
     // fontconfig converts the non existing font to sans-serif.
     // This is not good if the web page specifies font-family
     // that has Windows font name in the first.
     NS_ENSURE_TRUE(Preferences::GetRootBranch(), NS_ERROR_FAILURE);
@@ -842,63 +842,64 @@ gfxFontconfigUtils::AddFullnameEntries()
     FcFontSet *fontSets[] = {
         FcConfigGetFonts(nullptr, FcSetSystem)
 #ifdef MOZ_BUNDLED_FONTS
         , FcConfigGetFonts(nullptr, FcSetApplication)
 #endif
     };
 
     for (unsigned fs = 0; fs < ArrayLength(fontSets); ++fs) {
-	FcFontSet *fontSet = fontSets[fs];
-	if (!fontSet) {
-	    continue;
-	}
-	// Record the existing font families
-	for (int f = 0; f < fontSet->nfont; ++f) {
-	    FcPattern *font = fontSet->fonts[f];
+        FcFontSet *fontSet = fontSets[fs];
+        if (!fontSet) {
+            continue;
+        }
+        // Record the existing font families
+        for (int f = 0; f < fontSet->nfont; ++f) {
+            FcPattern *font = fontSet->fonts[f];
 
-	    int v = 0;
-	    FcChar8 *fullname;
-	    while (FcPatternGetString(font,
-				      FC_FULLNAME, v, &fullname) == FcResultMatch) {
-		FontsByFullnameEntry *entry = mFontsByFullname.PutEntry(fullname);
-		if (entry) {
-		    // entry always has space for one font, so the first AddFont
-		    // will always succeed, and so the entry will always have a
-		    // font from which to obtain the key.
-		    bool added = entry->AddFont(font);
-		    // The key may be nullptr either if this is the first font, or
-		    // if the first font does not have a fullname property, and so
-		    // the key is obtained from the font.  Set the key in both
-		    // cases.  The check that AddFont succeeded is required for
-		    // the second case.
-		    if (!entry->mKey && added) {
-			entry->mKey = fullname;
-		    }
-		}
+            int v = 0;
+            FcChar8 *fullname;
+            while (FcPatternGetString(font,
+                          FC_FULLNAME, v, &fullname) == FcResultMatch) {
+                FontsByFullnameEntry *entry =
+                    mFontsByFullname.PutEntry(fullname);
+                if (entry) {
+                    // entry always has space for one font, so the first
+                    // AddFont will always succeed, and so the entry will
+                    // always have a font from which to obtain the key.
+                    bool added = entry->AddFont(font);
+                    // The key may be nullptr either if this is the first
+                    // font, or if the first font does not have a fullname
+                    // property, and so the key is obtained from the font.
+                    // Set the key in both cases.  The check that AddFont
+                    // succeeded is required for the second case.
+                    if (!entry->mKey && added) {
+                        entry->mKey = fullname;
+                    }
+                }
 
-		++v;
-	    }
+                ++v;
+            }
 
-	    // Fontconfig does not provide a fullname property for all fonts.
-	    if (v == 0) {
-		nsAutoCString name;
-		if (!GetFullnameFromFamilyAndStyle(font, &name))
-		    continue;
+            // Fontconfig does not provide a fullname property for all fonts.
+            if (v == 0) {
+                nsAutoCString name;
+                if (!GetFullnameFromFamilyAndStyle(font, &name))
+                    continue;
 
-		FontsByFullnameEntry *entry =
-		    mFontsByFullname.PutEntry(ToFcChar8(name));
-		if (entry) {
-		    entry->AddFont(font);
-		    // Either entry->mKey has been set for a previous font or it
-		    // remains nullptr to indicate that the key is obtained from
-		    // the first font.
-		}
-	    }
-	}
+                FontsByFullnameEntry *entry =
+                    mFontsByFullname.PutEntry(ToFcChar8(name));
+                if (entry) {
+                    entry->AddFont(font);
+                    // Either entry->mKey has been set for a previous font or it
+                    // remains nullptr to indicate that the key is obtained from
+                    // the first font.
+                }
+            }
+        }
     }
 }
 
 const nsTArray< nsCountedRef<FcPattern> >&
 gfxFontconfigUtils::GetFontsForFullname(const FcChar8 *aFullname)
 {
     if (mFontsByFullname.Count() == 0) {
         AddFullnameEntries();
@@ -1013,43 +1014,44 @@ gfxFontconfigUtils::GetLangSupportEntry(
 #ifdef MOZ_BUNDLED_FONTS
         , FcConfigGetFonts(nullptr, FcSetApplication)
 #endif
     };
 
     nsAutoTArray<FcPattern*,100> fonts;
 
     for (unsigned fs = 0; fs < ArrayLength(fontSets); ++fs) {
-	FcFontSet *fontSet = fontSets[fs];
-	if (!fontSet) {
-	    continue;
-	}
-	for (int f = 0; f < fontSet->nfont; ++f) {
-	    FcPattern *font = fontSet->fonts[f];
+        FcFontSet *fontSet = fontSets[fs];
+        if (!fontSet) {
+            continue;
+        }
+        for (int f = 0; f < fontSet->nfont; ++f) {
+            FcPattern *font = fontSet->fonts[f];
 
-	    FcLangResult support = GetLangSupport(font, aLang);
+            FcLangResult support = GetLangSupport(font, aLang);
 
-	    if (support < best) { // lower is better
-		best = support;
-		if (aWithFonts) {
-		    fonts.Clear();
-		} else if (best == FcLangEqual) {
-		    break;
-		}
-	    }
+            if (support < best) { // lower is better
+                best = support;
+                if (aWithFonts) {
+                    fonts.Clear();
+                } else if (best == FcLangEqual) {
+                    break;
+                }
+            }
 
-	    // The font list in the LangSupportEntry is expected to be used only
-	    // when no default fonts support the language.  There would be a large
-	    // number of fonts in entries for languages using Latin script but
-	    // these do not need to be created because default fonts already
-	    // support these languages.
-	    if (aWithFonts && support != FcLangDifferentLang && support == best) {
-		fonts.AppendElement(font);
-	    }
-	}
+            // The font list in the LangSupportEntry is expected to be used
+            // only when no default fonts support the language.  There would
+            // be a large number of fonts in entries for languages using Latin
+            // script but these do not need to be created because default
+            // fonts already support these languages.
+            if (aWithFonts && support != FcLangDifferentLang &&
+                support == best) {
+                fonts.AppendElement(font);
+            }
+        }
     }
 
     entry->mSupport = best;
     if (aWithFonts) {
         if (fonts.Length() != 0) {
             entry->mFonts.AppendElements(fonts.Elements(), fonts.Length());
         } else if (best != FcLangDifferentLang) {
             // Previously there was a font that supported this language at the
@@ -1089,31 +1091,31 @@ gfxFontconfigUtils::GetFontsForLang(cons
 }
 
 #ifdef MOZ_BUNDLED_FONTS
 
 void
 gfxFontconfigUtils::ActivateBundledFonts()
 {
     if (!mBundledFontsInitialized) {
-	mBundledFontsInitialized = true;
-	nsCOMPtr<nsIFile> localDir;
-	nsresult rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(localDir));
-	if (NS_FAILED(rv)) {
-	    return;
-	}
-	if (NS_FAILED(localDir->Append(NS_LITERAL_STRING("fonts")))) {
-	    return;
-	}
-	bool isDir;
-	if (NS_FAILED(localDir->IsDirectory(&isDir)) || !isDir) {
-	    return;
-	}
-	if (NS_FAILED(localDir->GetNativePath(mBundledFontsPath))) {
-	    return;
-	}
+        mBundledFontsInitialized = true;
+        nsCOMPtr<nsIFile> localDir;
+        nsresult rv = NS_GetSpecialDirectory(NS_GRE_DIR, getter_AddRefs(localDir));
+        if (NS_FAILED(rv)) {
+            return;
+        }
+        if (NS_FAILED(localDir->Append(NS_LITERAL_STRING("fonts")))) {
+            return;
+        }
+        bool isDir;
+        if (NS_FAILED(localDir->IsDirectory(&isDir)) || !isDir) {
+            return;
+        }
+        if (NS_FAILED(localDir->GetNativePath(mBundledFontsPath))) {
+            return;
+        }
     }
     if (!mBundledFontsPath.IsEmpty()) {
-	FcConfigAppFontAddDir(nullptr, (const FcChar8*)mBundledFontsPath.get());
+        FcConfigAppFontAddDir(nullptr, (const FcChar8*)mBundledFontsPath.get());
     }
 }
 
 #endif
--- a/gfx/thebes/gfxGradientCache.h
+++ b/gfx/thebes/gfxGradientCache.h
@@ -11,22 +11,25 @@
 #include "gfxPattern.h"
 #include "mozilla/gfx/2D.h"
 
 namespace mozilla {
 namespace gfx {
 
 class gfxGradientCache {
 public:
-  static gfx::GradientStops *GetGradientStops(gfx::DrawTarget *aDT,
-					      nsTArray<gfx::GradientStop>& aStops,
-					      gfx::ExtendMode aExtend);
-  static gfx::GradientStops *GetOrCreateGradientStops(gfx::DrawTarget *aDT,
-						      nsTArray<gfx::GradientStop>& aStops,
-						      gfx::ExtendMode aExtend);
+    static gfx::GradientStops*
+    GetGradientStops(gfx::DrawTarget *aDT,
+                     nsTArray<gfx::GradientStop>& aStops,
+                     gfx::ExtendMode aExtend);
 
-  static void Shutdown();
+    static gfx::GradientStops*
+    GetOrCreateGradientStops(gfx::DrawTarget *aDT,
+                             nsTArray<gfx::GradientStop>& aStops,
+                             gfx::ExtendMode aExtend);
+
+    static void Shutdown();
 };
 
 }
 }
 
 #endif
--- a/gfx/thebes/gfxHarfBuzzShaper.cpp
+++ b/gfx/thebes/gfxHarfBuzzShaper.cpp
@@ -313,17 +313,17 @@ struct KernHeaderVersion1Fmt2 {
     AutoSwap_PRUint16 leftOffsetTable;
     AutoSwap_PRUint16 rightOffsetTable;
     AutoSwap_PRUint16 array;
 };
 
 struct KernClassTableHdr {
     AutoSwap_PRUint16 firstGlyph;
     AutoSwap_PRUint16 nGlyphs;
-    AutoSwap_PRUint16 offsets[1]; // actually an array of nGlyphs entries	
+    AutoSwap_PRUint16 offsets[1]; // actually an array of nGlyphs entries
 };
 
 static int16_t
 GetKernValueVersion1Fmt2(const void* aSubtable,
                          uint32_t aSubtableLen,
                          uint16_t aFirstGlyph,
                          uint16_t aSecondGlyph)
 {
--- a/gfx/thebes/gfxQuartzSurface.cpp
+++ b/gfx/thebes/gfxQuartzSurface.cpp
@@ -165,17 +165,17 @@ gfxQuartzSurface::CreateSimilarSurface(g
     nsRefPtr<gfxASurface> result = Wrap(surface, aSize);
     cairo_surface_destroy(surface);
     return result.forget();
 }
 
 CGContextRef
 gfxQuartzSurface::GetCGContextWithClip(gfxContext *ctx)
 {
-	return cairo_quartz_get_cg_context_with_clip(ctx->GetCairo());
+    return cairo_quartz_get_cg_context_with_clip(ctx->GetCairo());
 }
 
 int32_t gfxQuartzSurface::GetDefaultContextFlags() const
 {
     if (mForPrinting)
         return gfxContext::FLAG_DISABLE_SNAPPING |
                gfxContext::FLAG_DISABLE_COPY_BACKGROUND;
 
--- a/gfx/thebes/gfxWindowsNativeDrawing.cpp
+++ b/gfx/thebes/gfxWindowsNativeDrawing.cpp
@@ -188,17 +188,17 @@ gfxWindowsNativeDrawing::IsDoublePass()
       return true;
     }
 
     nsRefPtr<gfxASurface> surf = mContext->CurrentSurface(&mDeviceOffset.x, &mDeviceOffset.y);
     if (!surf || surf->CairoStatus())
         return false;
     if (surf->GetType() != gfxSurfaceType::Win32 &&
         surf->GetType() != gfxSurfaceType::Win32Printing) {
-	return true;
+        return true;
     }
     if ((surf->GetContentType() != gfxContentType::COLOR ||
          (surf->GetContentType() == gfxContentType::COLOR_ALPHA &&
           !(mNativeDrawFlags & CAN_DRAW_TO_COLOR_ALPHA))))
         return true;
     return false;
 }
 
--- a/gfx/thebes/gfxWindowsPlatform.cpp
+++ b/gfx/thebes/gfxWindowsPlatform.cpp
@@ -1259,17 +1259,17 @@ gfxWindowsPlatform::SetupClearTypeParams
             break;
         }
 
         nsRefPtr<IDWriteRenderingParams> defaultRenderingParams;
         GetDWriteFactory()->CreateRenderingParams(getter_AddRefs(defaultRenderingParams));
         // For EnhancedContrast, we override the default if the user has not set it
         // in the registry (by using the ClearType Tuner).
         if (contrast >= 0.0 && contrast <= 10.0) {
-	    contrast = contrast;
+            contrast = contrast;
         } else {
             HKEY hKey;
             if (RegOpenKeyExA(ENHANCED_CONTRAST_REGISTRY_KEY,
                               0, KEY_READ, &hKey) == ERROR_SUCCESS)
             {
                 contrast = defaultRenderingParams->GetEnhancedContrast();
                 RegCloseKey(hKey);
             } else {
@@ -1300,21 +1300,21 @@ gfxWindowsPlatform::SetupClearTypeParams
         if (renderMode < DWRITE_RENDERING_MODE_DEFAULT ||
             renderMode > DWRITE_RENDERING_MODE_CLEARTYPE_NATURAL_SYMMETRIC) {
             renderMode = defaultRenderingParams->GetRenderingMode();
         }
 
         mRenderingParams[TEXT_RENDERING_NO_CLEARTYPE] = defaultRenderingParams;
 
         GetDWriteFactory()->CreateCustomRenderingParams(gamma, contrast, level,
-	    dwriteGeometry, renderMode,
+            dwriteGeometry, renderMode,
             getter_AddRefs(mRenderingParams[TEXT_RENDERING_NORMAL]));
 
         GetDWriteFactory()->CreateCustomRenderingParams(gamma, contrast, level,
-	    dwriteGeometry, DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
+            dwriteGeometry, DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC,
             getter_AddRefs(mRenderingParams[TEXT_RENDERING_GDI_CLASSIC]));
     }
 #endif
 }
 
 void
 gfxWindowsPlatform::OnDeviceManagerDestroy(DeviceManagerD3D9* aDeviceManager)
 {
--- a/gfx/thebes/gfxXlibSurface.cpp
+++ b/gfx/thebes/gfxXlibSurface.cpp
@@ -3,17 +3,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "gfxXlibSurface.h"
 
 #include "cairo.h"
 #include "cairo-xlib.h"
 #include "cairo-xlib-xrender.h"
-#include <X11/Xlibint.h>	/* For XESetCloseDisplay */
+#include <X11/Xlibint.h>  /* For XESetCloseDisplay */
 #undef max // Xlibint.h defines this and it breaks std::max
 #undef min // Xlibint.h defines this and it breaks std::min
 
 #include "nsAutoPtr.h"
 #include "nsTArray.h"
 #include "nsAlgorithm.h"
 #include "mozilla/Preferences.h"
 #include <algorithm>