Bug 1059691. Cleanup tabs in gfx/thebes source files. r=mkato

This commit is contained in:
John Daggett 2014-08-29 13:18:28 +09:00
parent 1b8c313b60
commit 780497e3ca
9 changed files with 132 additions and 127 deletions

View File

@ -98,7 +98,7 @@ struct MathGlyphConstruction {
};
struct GlyphPartRecord {
GlyphID mGlyph;
GlyphID mGlyph;
mozilla::AutoSwap_PRUint16 mStartConnectorLength;
mozilla::AutoSwap_PRUint16 mEndConnectorLength;
mozilla::AutoSwap_PRUint16 mFullAdvance;

View File

@ -21,7 +21,7 @@ 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)
@ -29,7 +29,7 @@ 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)

View File

@ -602,34 +602,34 @@ gfxFontconfigUtils::UpdateFontListInternal(bool aForce)
// 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.
@ -847,53 +847,54 @@ gfxFontconfigUtils::AddFullnameEntries()
};
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.
}
}
}
}
}
@ -1018,33 +1019,34 @@ gfxFontconfigUtils::GetLangSupportEntry(const FcChar8 *aLang, bool aWithFonts)
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;
@ -1094,25 +1096,25 @@ 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());
}
}

View File

@ -16,14 +16,17 @@ 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();
};
}

View File

@ -318,7 +318,7 @@ struct KernHeaderVersion1Fmt2 {
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

View File

@ -170,7 +170,7 @@ gfxQuartzSurface::CreateSimilarSurface(gfxContentType aType,
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

View File

@ -193,7 +193,7 @@ gfxWindowsNativeDrawing::IsDoublePass()
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 &&

View File

@ -1264,7 +1264,7 @@ gfxWindowsPlatform::SetupClearTypeParams()
// 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,
@ -1305,11 +1305,11 @@ gfxWindowsPlatform::SetupClearTypeParams()
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

View File

@ -8,7 +8,7 @@
#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