backing out 356235, until windows linking screwage is fixed

This commit is contained in:
vladimir%pobox.com 2006-10-12 21:36:21 +00:00
Родитель 2e9a5c8bec
Коммит 0ed5a2fb74
7 изменённых файлов: 26 добавлений и 55 удалений

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

@ -55,8 +55,6 @@ NS_IMPL_ISUPPORTS1(nsThebesFontMetrics, nsIFontMetrics)
#include "gfxAtsuiFonts.h"
#endif
#include "gfxTextRunCache.h"
nsThebesFontMetrics::nsThebesFontMetrics()
{
mFontStyle = nsnull;
@ -66,7 +64,7 @@ nsThebesFontMetrics::nsThebesFontMetrics()
nsThebesFontMetrics::~nsThebesFontMetrics()
{
delete mFontStyle;
//delete mFontGroup;
delete mFontGroup;
}
NS_IMETHODIMP
@ -297,8 +295,7 @@ nsThebesFontMetrics::GetWidth(const char* aString, PRUint32 aLength, nscoord& aW
return GetSpaceWidth(aWidth);
const nsDependentCSubstring& theString = nsDependentCSubstring(aString, aString+aLength);
//nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
nsRefPtr<gfxTextRun> textrun = gfxTextRunCache::GetCache()->GetOrMakeTextRun(mFontGroup, theString);
nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
textrun->SetRightToLeft(mIsRTL);
@ -322,8 +319,7 @@ nsThebesFontMetrics::GetWidth(const PRUnichar* aString, PRUint32 aLength,
return GetSpaceWidth(aWidth);
const nsDependentSubstring& theString = nsDependentSubstring(aString, aString+aLength);
//nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
nsRefPtr<gfxTextRun> textrun = gfxTextRunCache::GetCache()->GetOrMakeTextRun(mFontGroup, theString);
nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
textrun->SetRightToLeft(mIsRTL);
@ -383,8 +379,7 @@ nsThebesFontMetrics::DrawString(const char *aString, PRUint32 aLength,
float app2dev = mDeviceContext->AppUnitsToDevUnits();
const nsDependentCSubstring& theString = nsDependentCSubstring(aString, aString+aLength);
//nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
nsRefPtr<gfxTextRun> textrun = gfxTextRunCache::GetCache()->GetOrMakeTextRun(mFontGroup, theString);
nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
textrun->SetRightToLeft(mIsRTL);
@ -419,8 +414,7 @@ nsThebesFontMetrics::DrawString(const PRUnichar* aString, PRUint32 aLength,
float app2dev = mDeviceContext->AppUnitsToDevUnits();
const nsDependentSubstring& theString = nsDependentSubstring(aString, aString+aLength);
//nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
nsRefPtr<gfxTextRun> textrun = gfxTextRunCache::GetCache()->GetOrMakeTextRun(mFontGroup, theString);
nsRefPtr<gfxTextRun> textrun = mFontGroup->MakeTextRun(theString);
textrun->SetRightToLeft(mIsRTL);

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

@ -147,7 +147,7 @@ protected:
const gfxFont::Metrics& GetMetrics() const;
nsRefPtr<gfxFontGroup> mFontGroup;
gfxFontGroup *mFontGroup;
gfxFontStyle *mFontStyle;
private:

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

@ -23,7 +23,6 @@ EXPORTS = gfxASurface.h \
gfxRect.h \
gfxRegion.h \
gfxTypes.h \
gfxTextRunCache.h \
$(NULL)
ifdef MOZ_ENABLE_GLITZ

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

@ -111,18 +111,6 @@ struct THEBES_API gfxFontStyle {
void ComputeWeightAndOffset(PRInt8 *outBaseWeight,
PRInt8 *outOffset) const;
PRBool Equals(const gfxFontStyle& other) const {
return (size == other.size) &&
(style == other.style) &&
(systemFont == other.systemFont) &&
(variant == other.variant) &&
(familyNameQuirks == other.familyNameQuirks) &&
(weight == other.weight) &&
(decorations == other.decorations) &&
(langGroup.Equals(other.langGroup)) &&
(sizeAdjust == other.sizeAdjust);
}
};
@ -172,8 +160,6 @@ protected:
class THEBES_API gfxFontGroup {
THEBES_INLINE_DECL_REFCOUNTING(gfxFontGroup)
public:
gfxFontGroup(const nsAString& aFamilies, const gfxFontStyle *aStyle);
@ -188,11 +174,6 @@ public:
return mFonts.Length();
}
PRBool Equals(const gfxFontGroup& other) const {
return mFamilies.Equals(other.mFamilies) &&
mStyle.Equals(other.mStyle);
}
const gfxFontStyle *GetStyle() const { return &mStyle; }
/* unicode method */
@ -216,8 +197,6 @@ public:
/* this will call back fc with the a generic font based on the style's langgroup */
void FindGenericFontFromStyle(FontCreationCallback fc, void *closure);
const nsString& GetFamilies() { return mFamilies; }
protected:
nsString mFamilies;
gfxFontStyle mStyle;

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

@ -476,8 +476,8 @@ private:
class THEBES_API gfxWindowsTextRun : public gfxTextRun {
public:
gfxWindowsTextRun(const nsAString& aString, gfxWindowsFontGroup *aFontGroup);
gfxWindowsTextRun(const nsACString& aString, gfxWindowsFontGroup *aFontGroup);
gfxWindowsTextRun(const nsAString *aString, gfxWindowsFontGroup *aFontGroup);
gfxWindowsTextRun(const nsACString *aString, gfxWindowsFontGroup *aFontGroup);
~gfxWindowsTextRun();
virtual void Draw(gfxContext *aContext, gfxPoint pt);
@ -495,8 +495,8 @@ private:
nsTArray<gfxFloat> mSpacing;
// These should probably be in a union
nsString mString;
nsCString mCString;
const nsAString *mString;
const nsACString *mCString;
const PRBool mIsASCII;

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

@ -27,7 +27,6 @@ CPPSRCS = \
gfxImageSurface.cpp \
gfxFont.cpp \
gfxPlatform.cpp \
gfxTextRunCache.cpp \
$(NULL)
DEFINES += -DIMPL_THEBES

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

@ -443,7 +443,7 @@ gfxWindowsFontGroup::MakeTextRun(const nsAString& aString)
NS_WARNING("It is illegal to create a gfxTextRun with empty strings");
return nsnull;
}
return new gfxWindowsTextRun(aString, this);
return new gfxWindowsTextRun(&aString, this);
}
gfxTextRun *
@ -453,7 +453,7 @@ gfxWindowsFontGroup::MakeTextRun(const nsACString& aString)
NS_WARNING("It is illegal to create a gfxTextRun with empty strings");
return nsnull;
}
return new gfxWindowsTextRun(aString, this);
return new gfxWindowsTextRun(&aString, this);
}
/**********************************************************************
@ -462,13 +462,13 @@ gfxWindowsFontGroup::MakeTextRun(const nsACString& aString)
*
**********************************************************************/
gfxWindowsTextRun::gfxWindowsTextRun(const nsAString& aString, gfxWindowsFontGroup *aFontGroup)
: mGroup(aFontGroup), mString(aString), mIsASCII(PR_FALSE), mLength(-1.0)
gfxWindowsTextRun::gfxWindowsTextRun(const nsAString *aString, gfxWindowsFontGroup *aFontGroup)
: mGroup(aFontGroup), mString(aString), mCString(nsnull), mIsASCII(PR_FALSE), mLength(-1.0)
{
}
gfxWindowsTextRun::gfxWindowsTextRun(const nsACString& aString, gfxWindowsFontGroup *aFontGroup)
: mGroup(aFontGroup), mCString(aString), mIsASCII(PR_TRUE), mLength(-1.0)
gfxWindowsTextRun::gfxWindowsTextRun(const nsACString *aString, gfxWindowsFontGroup *aFontGroup)
: mGroup(aFontGroup), mString(nsnull), mCString(aString), mIsASCII(PR_TRUE), mLength(-1.0)
{
}
@ -535,11 +535,11 @@ gfxWindowsTextRun::MeasureOrDrawReallyFast(gfxContext *aContext,
PRUint32 aLength;
if (mIsASCII) {
aCString = mCString.BeginReading();
aLength = mCString.Length();
aCString = mCString->BeginReading();
aLength = mCString->Length();
} else {
aWString = mString.BeginReading();
aLength = mString.Length();
aWString = mString->BeginReading();
aLength = mString->Length();
if (ScriptIsComplex(aWString, aLength, SIC_COMPLEX) == S_OK)
return -1; // try uniscribe instead
}
@ -649,11 +649,11 @@ gfxWindowsTextRun::MeasureOrDrawFast(gfxContext *aContext,
PRUint32 aLength;
if (mIsASCII) {
aCString = mCString.BeginReading();
aLength = mCString.Length();
aCString = mCString->BeginReading();
aLength = mCString->Length();
} else {
aWString = mString.BeginReading();
aLength = mString.Length();
aWString = mString->BeginReading();
aLength = mString->Length();
if (ScriptIsComplex(aWString, aLength, SIC_COMPLEX) == S_OK)
return -1; // try uniscribe instead
}
@ -1445,10 +1445,10 @@ gfxWindowsTextRun::MeasureOrDrawUniscribe(gfxContext *aContext,
NS_ASSERTION(aDC, "No DC");
/* we aren't going to change this. i swear */
const nsAString *str = &mString;
nsAString *str = NS_CONST_CAST(nsAString*, mString);
nsString buf;
if (mIsASCII) {
CopyASCIItoUTF16(mCString, buf);
CopyASCIItoUTF16(*mCString, buf);
str = &buf;
}