Bug 1156742 Part 2: Make gfx thebes/gl/2d work with UNICODE defined. r=bas, r=glandium

This commit is contained in:
Bob Owen 2016-01-05 10:08:56 +00:00
Родитель 940fb516d4
Коммит 7b7cad771e
8 изменённых файлов: 16 добавлений и 21 удалений

Просмотреть файл

@ -186,10 +186,3 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('android', 'gtk2', 'gtk3', 'gonk', 'qt'):
CXXFLAGS += CONFIG['CAIRO_FT_CFLAGS']
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
if CONFIG['OS_ARCH'] == 'WINNT':
# Due to bug 796023, we can't have -DUNICODE and -D_UNICODE; defining those
# macros changes the type of LOGFONT to LOGFONTW instead of LOGFONTA. This
# changes the symbol names of exported C++ functions that use LOGFONT.
del DEFINES['UNICODE']
del DEFINES['_UNICODE']

Просмотреть файл

@ -170,8 +170,5 @@ CFLAGS += CONFIG['TK_CFLAGS']
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
if CONFIG['OS_ARCH'] == 'WINNT':
del DEFINES['UNICODE']
if CONFIG['CLANG_CXX']:
CXXFLAGS += ['-Wshadow']

Просмотреть файл

@ -69,6 +69,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in {
} or CONFIG['MOZ_WIDGET_GTK']:
DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
DEFINES['UNICODE'] = True
DEFINES['_UNICODE'] = True
# We should autogenerate these SSE related flags.
if CONFIG['_MSC_VER']:

Просмотреть файл

@ -685,6 +685,10 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in {
} or CONFIG['MOZ_WIDGET_GTK']:
DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
DEFINES['UNICODE'] = True
DEFINES['_UNICODE'] = True
# We should autogenerate these SSE related flags.
if CONFIG['_MSC_VER']:

Просмотреть файл

@ -860,9 +860,9 @@ gfxDWriteFontList::InitFontList()
char nowTime[256], nowDate[256];
if (LOG_FONTINIT_ENABLED()) {
GetTimeFormat(LOCALE_INVARIANT, TIME_FORCE24HOURFORMAT,
GetTimeFormatA(LOCALE_INVARIANT, TIME_FORCE24HOURFORMAT,
nullptr, nullptr, nowTime, 256);
GetDateFormat(LOCALE_INVARIANT, 0, nullptr, nullptr, nowDate, 256);
GetDateFormatA(LOCALE_INVARIANT, 0, nullptr, nullptr, nowDate, 256);
upTime = (double) GetTickCount();
}
QueryPerformanceFrequency(&frequency);

Просмотреть файл

@ -232,7 +232,7 @@ gfxDWriteFont::ComputeMetrics(AntialiasOption anAAOption)
UINT32 ucs = L' ';
UINT16 glyph;
HRESULT hr = mFontFace->GetGlyphIndicesA(&ucs, 1, &glyph);
HRESULT hr = mFontFace->GetGlyphIndicesW(&ucs, 1, &glyph);
if (FAILED(hr)) {
mMetrics->spaceWidth = 0;
} else {
@ -262,7 +262,7 @@ gfxDWriteFont::ComputeMetrics(AntialiasOption anAAOption)
if (mMetrics->aveCharWidth < 1) {
ucs = L'x';
if (SUCCEEDED(mFontFace->GetGlyphIndicesA(&ucs, 1, &glyph))) {
if (SUCCEEDED(mFontFace->GetGlyphIndicesW(&ucs, 1, &glyph))) {
mMetrics->aveCharWidth = MeasureGlyphWidth(glyph);
}
if (mMetrics->aveCharWidth < 1) {
@ -272,7 +272,7 @@ gfxDWriteFont::ComputeMetrics(AntialiasOption anAAOption)
}
ucs = L'0';
if (SUCCEEDED(mFontFace->GetGlyphIndicesA(&ucs, 1, &glyph))) {
if (SUCCEEDED(mFontFace->GetGlyphIndicesW(&ucs, 1, &glyph))) {
mMetrics->zeroOrAveCharWidth = MeasureGlyphWidth(glyph);
}
if (mMetrics->zeroOrAveCharWidth < 1) {

Просмотреть файл

@ -1117,11 +1117,11 @@ gfxGDIFontList::ActivateBundledFonts()
if (!file) {
continue;
}
nsCString path;
if (NS_FAILED(file->GetNativePath(path))) {
nsAutoString path;
if (NS_FAILED(file->GetPath(path))) {
continue;
}
AddFontResourceEx(path.get(), FR_PRIVATE, nullptr);
AddFontResourceExW(path.get(), FR_PRIVATE, nullptr);
}
}

Просмотреть файл

@ -307,6 +307,3 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('gtk2', 'gtk3', 'qt'):
LOCAL_INCLUDES += CONFIG['SKIA_INCLUDES']
DEFINES['GRAPHITE2_STATIC'] = True
if CONFIG['OS_ARCH'] == 'WINNT':
del DEFINES['UNICODE']