mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 01:08:39 +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), \
|
||||
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*
|
||||
ToFcChar8Ptr(const char* aStr)
|
||||
{
|
||||
|
|
@ -1078,8 +1092,9 @@ gfxFontconfigFont::gfxFontconfigFont(cairo_scaled_font_t *aScaledFont,
|
|||
gfxFloat aAdjustedSize,
|
||||
gfxFontEntry *aFontEntry,
|
||||
const gfxFontStyle *aFontStyle,
|
||||
bool aNeedsBold) :
|
||||
gfxFontconfigFontBase(aScaledFont, aPattern, aFontEntry, aFontStyle)
|
||||
bool aNeedsBold)
|
||||
: gfxFT2FontBase(aScaledFont, aFontEntry, aFontStyle)
|
||||
, mPattern(aPattern)
|
||||
{
|
||||
mAdjustedSize = aAdjustedSize;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@
|
|||
#include "gfxFT2FontBase.h"
|
||||
#include "gfxPlatformFontList.h"
|
||||
#include "mozilla/mozalloc.h"
|
||||
#include "nsAutoRef.h"
|
||||
#include "nsClassHashtable.h"
|
||||
|
||||
#include <fontconfig/fontconfig.h>
|
||||
|
|
@ -20,13 +21,12 @@
|
|||
#include <cairo.h>
|
||||
#include <cairo-ft.h>
|
||||
|
||||
#include "gfxFontconfigUtils.h" // xxx - only for nsAutoRefTraits<FcPattern>, etc.
|
||||
|
||||
template <>
|
||||
class nsAutoRefTraits<FcObjectSet> : public nsPointerRefTraits<FcObjectSet>
|
||||
class nsAutoRefTraits<FcPattern> : public nsPointerRefTraits<FcPattern>
|
||||
{
|
||||
public:
|
||||
static void Release(FcObjectSet *ptr) { FcObjectSetDestroy(ptr); }
|
||||
static void Release(FcPattern *ptr) { FcPatternDestroy(ptr); }
|
||||
static void AddRef(FcPattern *ptr) { FcPatternReference(ptr); }
|
||||
};
|
||||
|
||||
template <>
|
||||
|
|
@ -205,7 +205,7 @@ protected:
|
|||
bool mForceScalable;
|
||||
};
|
||||
|
||||
class gfxFontconfigFont : public gfxFontconfigFontBase {
|
||||
class gfxFontconfigFont : public gfxFT2FontBase {
|
||||
public:
|
||||
gfxFontconfigFont(cairo_scaled_font_t *aScaledFont,
|
||||
FcPattern *aPattern,
|
||||
|
|
@ -214,8 +214,13 @@ public:
|
|||
const gfxFontStyle *aFontStyle,
|
||||
bool aNeedsBold);
|
||||
|
||||
protected:
|
||||
virtual FontType GetType() const override { return FONT_TYPE_FONTCONFIG; }
|
||||
virtual FcPattern *GetPattern() const { return mPattern; }
|
||||
|
||||
private:
|
||||
virtual ~gfxFontconfigFont();
|
||||
|
||||
nsCountedRef<FcPattern> mPattern;
|
||||
};
|
||||
|
||||
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 "gfx2DGlue.h"
|
||||
#include "gfxFcPlatformFontList.h"
|
||||
#include "gfxFontconfigUtils.h"
|
||||
#include "gfxConfig.h"
|
||||
#include "gfxContext.h"
|
||||
#include "gfxUserFontSet.h"
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ struct _XDisplay;
|
|||
typedef struct _XDisplay Display;
|
||||
#endif // MOZ_X11
|
||||
|
||||
class gfxFontconfigUtils;
|
||||
|
||||
class gfxPlatformGtk : public gfxPlatform {
|
||||
public:
|
||||
gfxPlatformGtk();
|
||||
|
|
@ -141,8 +139,6 @@ public:
|
|||
#endif // MOZ_X11
|
||||
|
||||
protected:
|
||||
static gfxFontconfigUtils *sFontconfigUtils;
|
||||
|
||||
int8_t mMaxGenericSubstitutions;
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue