mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-10-29 10:37:33 +09:00
Issue #2191 - Get rid of gfxFontconfigUtils.h since gfxFontconfigFontBase is unnecessary.
Backported from Mozilla bug 1385029.
This commit is contained in:
parent
c54e2502b0
commit
a35ce5e5e1
5 changed files with 28 additions and 68 deletions
|
|
@ -55,6 +55,20 @@ using namespace mozilla::unicode;
|
||||||
gfxPlatform::GetLog(eGfxLog_cmapdata), \
|
gfxPlatform::GetLog(eGfxLog_cmapdata), \
|
||||||
LogLevel::Debug)
|
LogLevel::Debug)
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class nsAutoRefTraits<FcFontSet> : public nsPointerRefTraits<FcFontSet>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void Release(FcFontSet *ptr) { FcFontSetDestroy(ptr); }
|
||||||
|
};
|
||||||
|
|
||||||
|
template <>
|
||||||
|
class nsAutoRefTraits<FcObjectSet> : public nsPointerRefTraits<FcObjectSet>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
static void Release(FcObjectSet *ptr) { FcObjectSetDestroy(ptr); }
|
||||||
|
};
|
||||||
|
|
||||||
static const FcChar8*
|
static const FcChar8*
|
||||||
ToFcChar8Ptr(const char* aStr)
|
ToFcChar8Ptr(const char* aStr)
|
||||||
{
|
{
|
||||||
|
|
@ -1078,8 +1092,9 @@ gfxFontconfigFont::gfxFontconfigFont(cairo_scaled_font_t *aScaledFont,
|
||||||
gfxFloat aAdjustedSize,
|
gfxFloat aAdjustedSize,
|
||||||
gfxFontEntry *aFontEntry,
|
gfxFontEntry *aFontEntry,
|
||||||
const gfxFontStyle *aFontStyle,
|
const gfxFontStyle *aFontStyle,
|
||||||
bool aNeedsBold) :
|
bool aNeedsBold)
|
||||||
gfxFontconfigFontBase(aScaledFont, aPattern, aFontEntry, aFontStyle)
|
: gfxFT2FontBase(aScaledFont, aFontEntry, aFontStyle)
|
||||||
|
, mPattern(aPattern)
|
||||||
{
|
{
|
||||||
mAdjustedSize = aAdjustedSize;
|
mAdjustedSize = aAdjustedSize;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
#include "gfxFT2FontBase.h"
|
#include "gfxFT2FontBase.h"
|
||||||
#include "gfxPlatformFontList.h"
|
#include "gfxPlatformFontList.h"
|
||||||
#include "mozilla/mozalloc.h"
|
#include "mozilla/mozalloc.h"
|
||||||
|
#include "nsAutoRef.h"
|
||||||
#include "nsClassHashtable.h"
|
#include "nsClassHashtable.h"
|
||||||
|
|
||||||
#include <fontconfig/fontconfig.h>
|
#include <fontconfig/fontconfig.h>
|
||||||
|
|
@ -20,13 +21,12 @@
|
||||||
#include <cairo.h>
|
#include <cairo.h>
|
||||||
#include <cairo-ft.h>
|
#include <cairo-ft.h>
|
||||||
|
|
||||||
#include "gfxFontconfigUtils.h" // xxx - only for nsAutoRefTraits<FcPattern>, etc.
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
class nsAutoRefTraits<FcObjectSet> : public nsPointerRefTraits<FcObjectSet>
|
class nsAutoRefTraits<FcPattern> : public nsPointerRefTraits<FcPattern>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static void Release(FcObjectSet *ptr) { FcObjectSetDestroy(ptr); }
|
static void Release(FcPattern *ptr) { FcPatternDestroy(ptr); }
|
||||||
|
static void AddRef(FcPattern *ptr) { FcPatternReference(ptr); }
|
||||||
};
|
};
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
|
|
@ -205,7 +205,7 @@ protected:
|
||||||
bool mForceScalable;
|
bool mForceScalable;
|
||||||
};
|
};
|
||||||
|
|
||||||
class gfxFontconfigFont : public gfxFontconfigFontBase {
|
class gfxFontconfigFont : public gfxFT2FontBase {
|
||||||
public:
|
public:
|
||||||
gfxFontconfigFont(cairo_scaled_font_t *aScaledFont,
|
gfxFontconfigFont(cairo_scaled_font_t *aScaledFont,
|
||||||
FcPattern *aPattern,
|
FcPattern *aPattern,
|
||||||
|
|
@ -214,8 +214,13 @@ public:
|
||||||
const gfxFontStyle *aFontStyle,
|
const gfxFontStyle *aFontStyle,
|
||||||
bool aNeedsBold);
|
bool aNeedsBold);
|
||||||
|
|
||||||
protected:
|
virtual FontType GetType() const override { return FONT_TYPE_FONTCONFIG; }
|
||||||
|
virtual FcPattern *GetPattern() const { return mPattern; }
|
||||||
|
|
||||||
|
private:
|
||||||
virtual ~gfxFontconfigFont();
|
virtual ~gfxFontconfigFont();
|
||||||
|
|
||||||
|
nsCountedRef<FcPattern> mPattern;
|
||||||
};
|
};
|
||||||
|
|
||||||
class nsILanguageAtomService;
|
class nsILanguageAtomService;
|
||||||
|
|
|
||||||
|
|
@ -1,55 +0,0 @@
|
||||||
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
|
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* 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/. */
|
|
||||||
|
|
||||||
#ifndef GFX_FONTCONFIG_UTILS_H
|
|
||||||
#define GFX_FONTCONFIG_UTILS_H
|
|
||||||
|
|
||||||
#include "gfxPlatform.h"
|
|
||||||
|
|
||||||
#include "nsAutoRef.h"
|
|
||||||
#include "gfxFT2FontBase.h"
|
|
||||||
|
|
||||||
#include <fontconfig/fontconfig.h>
|
|
||||||
|
|
||||||
|
|
||||||
template <>
|
|
||||||
class nsAutoRefTraits<FcPattern> : public nsPointerRefTraits<FcPattern>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void Release(FcPattern *ptr) { FcPatternDestroy(ptr); }
|
|
||||||
static void AddRef(FcPattern *ptr) { FcPatternReference(ptr); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
class nsAutoRefTraits<FcFontSet> : public nsPointerRefTraits<FcFontSet>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void Release(FcFontSet *ptr) { FcFontSetDestroy(ptr); }
|
|
||||||
};
|
|
||||||
|
|
||||||
template <>
|
|
||||||
class nsAutoRefTraits<FcCharSet> : public nsPointerRefTraits<FcCharSet>
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
static void Release(FcCharSet *ptr) { FcCharSetDestroy(ptr); }
|
|
||||||
};
|
|
||||||
|
|
||||||
class gfxFontconfigFontBase : public gfxFT2FontBase {
|
|
||||||
public:
|
|
||||||
gfxFontconfigFontBase(cairo_scaled_font_t *aScaledFont,
|
|
||||||
FcPattern *aPattern,
|
|
||||||
gfxFontEntry *aFontEntry,
|
|
||||||
const gfxFontStyle *aFontStyle)
|
|
||||||
: gfxFT2FontBase(aScaledFont, aFontEntry, aFontStyle)
|
|
||||||
, mPattern(aPattern) { }
|
|
||||||
|
|
||||||
virtual FontType GetType() const override { return FONT_TYPE_FONTCONFIG; }
|
|
||||||
virtual FcPattern *GetPattern() const { return mPattern; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
nsCountedRef<FcPattern> mPattern;
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif /* GFX_FONTCONFIG_UTILS_H */
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
#include "nsUnicodeProperties.h"
|
#include "nsUnicodeProperties.h"
|
||||||
#include "gfx2DGlue.h"
|
#include "gfx2DGlue.h"
|
||||||
#include "gfxFcPlatformFontList.h"
|
#include "gfxFcPlatformFontList.h"
|
||||||
#include "gfxFontconfigUtils.h"
|
|
||||||
#include "gfxConfig.h"
|
#include "gfxConfig.h"
|
||||||
#include "gfxContext.h"
|
#include "gfxContext.h"
|
||||||
#include "gfxUserFontSet.h"
|
#include "gfxUserFontSet.h"
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,6 @@ struct _XDisplay;
|
||||||
typedef struct _XDisplay Display;
|
typedef struct _XDisplay Display;
|
||||||
#endif // MOZ_X11
|
#endif // MOZ_X11
|
||||||
|
|
||||||
class gfxFontconfigUtils;
|
|
||||||
|
|
||||||
class gfxPlatformGtk : public gfxPlatform {
|
class gfxPlatformGtk : public gfxPlatform {
|
||||||
public:
|
public:
|
||||||
gfxPlatformGtk();
|
gfxPlatformGtk();
|
||||||
|
|
@ -141,8 +139,6 @@ public:
|
||||||
#endif // MOZ_X11
|
#endif // MOZ_X11
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
static gfxFontconfigUtils *sFontconfigUtils;
|
|
||||||
|
|
||||||
int8_t mMaxGenericSubstitutions;
|
int8_t mMaxGenericSubstitutions;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue