зеркало из https://github.com/mozilla/pjs.git
Bug 374567. Make GetDevUnitsPerAppUnit return a PRUint32. r=pavlov
This commit is contained in:
Родитель
08c2da68e4
Коммит
5c0cb5339d
|
@ -693,7 +693,7 @@ public:
|
|||
void *GetUserData() const { return mUserData; }
|
||||
PRUint32 GetFlags() const { return mFlags; }
|
||||
const gfxSkipChars& GetSkipChars() const { return mSkipChars; }
|
||||
float GetAppUnitsPerDevUnit() { return mAppUnitsPerDevUnit; }
|
||||
PRUint32 GetAppUnitsPerDevUnit() const { return mAppUnitsPerDevUnit; }
|
||||
|
||||
// The caller is responsible for initializing our glyphs after construction.
|
||||
// Initially all glyphs are such that GetCharacterGlyphs()[i].IsMissing() is true.
|
||||
|
@ -965,7 +965,7 @@ private:
|
|||
gfxSkipChars mSkipChars;
|
||||
// This is actually an integer, but we keep it in float form to reduce
|
||||
// the conversions required
|
||||
float mAppUnitsPerDevUnit;
|
||||
PRUint32 mAppUnitsPerDevUnit;
|
||||
PRUint32 mFlags;
|
||||
PRUint32 mCharacterCount;
|
||||
};
|
||||
|
|
|
@ -619,9 +619,7 @@ PostLayoutCallback(ATSULineRef aLine, gfxTextRun *aRun,
|
|||
if (numGlyphs == 0)
|
||||
return;
|
||||
|
||||
PRUint32 appUnitsPerDevUnit = PRUint32(aRun->GetAppUnitsPerDevUnit());
|
||||
NS_ASSERTION(appUnitsPerDevUnit == aRun->GetAppUnitsPerDevUnit(),
|
||||
"Textrun's appunits per devunit is weird...");
|
||||
PRUint32 appUnitsPerDevUnit = aRun->GetAppUnitsPerDevUnit();
|
||||
|
||||
// ATSUI seems to have a bug where trailing whitespace in a run,
|
||||
// even after we've forced the direction with LRO/RLO/PDF, does not
|
||||
|
|
|
@ -76,8 +76,8 @@ gfxFont::Draw(gfxTextRun *aTextRun, PRUint32 aStart, PRUint32 aEnd,
|
|||
return;
|
||||
|
||||
const gfxTextRun::CompressedGlyph *charGlyphs = aTextRun->GetCharacterGlyphs();
|
||||
double appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
double devUnitsPerAppUnit = 1/appUnitsPerDevUnit;
|
||||
const PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
const double devUnitsPerAppUnit = 1.0/double(appUnitsPerDevUnit);
|
||||
PRBool isRTL = aTextRun->IsRightToLeft();
|
||||
double direction = aTextRun->GetDirection();
|
||||
nsAutoTArray<cairo_glyph_t,200> glyphBuffer;
|
||||
|
@ -195,7 +195,7 @@ gfxFont::Measure(gfxTextRun *aTextRun,
|
|||
RunMetrics metrics;
|
||||
const gfxFont::Metrics& fontMetrics = GetMetrics();
|
||||
metrics.mAdvanceWidth = floatAdvance;
|
||||
gfxFloat appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
const PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
metrics.mAscent = fontMetrics.maxAscent*appUnitsPerDevUnit;
|
||||
metrics.mDescent = fontMetrics.maxDescent*appUnitsPerDevUnit;
|
||||
metrics.mBoundingBox =
|
||||
|
@ -426,7 +426,7 @@ gfxFontGroup::GetSpecialStringTextRun(SpecialString aString,
|
|||
|
||||
gfxTextRunFactory::Parameters params = {
|
||||
nsnull, nsnull, nsnull, nsnull, nsnull, 0,
|
||||
PRUint32(aTemplate->GetAppUnitsPerDevUnit()), TEXT_IS_PERSISTENT
|
||||
aTemplate->GetAppUnitsPerDevUnit(), TEXT_IS_PERSISTENT
|
||||
};
|
||||
gfxTextRun* textRun;
|
||||
|
||||
|
|
|
@ -739,13 +739,13 @@ gfxPangoFontGroup::InitTextRun(gfxTextRun *aTextRun, const gchar *aUTF8Text,
|
|||
|
||||
static gfxTextRun::Metrics
|
||||
GetPangoMetrics(PangoGlyphString *aGlyphs, PangoFont *aPangoFont,
|
||||
gfxFloat aPixelsToUnits, PRUint32 aClusterCount)
|
||||
PRUint32 aPixelsToUnits, PRUint32 aClusterCount)
|
||||
{
|
||||
PangoRectangle inkRect;
|
||||
PangoRectangle logicalRect;
|
||||
pango_glyph_string_extents(aGlyphs, aPangoFont, &inkRect, &logicalRect);
|
||||
|
||||
gfxFloat scale = aPixelsToUnits/PANGO_SCALE;
|
||||
gfxFloat scale = gfxFloat(aPixelsToUnits)/PANGO_SCALE;
|
||||
|
||||
gfxTextRun::Metrics metrics;
|
||||
NS_ASSERTION(logicalRect.x == 0, "Weird logical rect...");
|
||||
|
@ -959,7 +959,7 @@ gfxPangoFontGroup::SetGlyphs(gfxTextRun* aTextRun,
|
|||
PRInt32 direction = aTextRun->IsRightToLeft() ? -1 : 1;
|
||||
gfxTextRun::CompressedGlyph g;
|
||||
nsAutoTArray<gfxTextRun::DetailedGlyph,1> detailedGlyphs;
|
||||
PRUint32 appUnitsPerDevUnit = PRUint32(aTextRun->GetAppUnitsPerDevUnit());
|
||||
const PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
|
||||
while (index < aUTF8Length) {
|
||||
if (utf16Offset >= textRunLength) {
|
||||
|
@ -1069,7 +1069,7 @@ gfxPangoFontGroup::CreateGlyphRunsXft(gfxTextRun *aTextRun,
|
|||
XftFont *xfont = font->GetXftFont();
|
||||
PRUint32 utf16Offset = 0;
|
||||
gfxTextRun::CompressedGlyph g;
|
||||
PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
const PRUint32 appUnitsPerDevUnit = aTextRun->GetAppUnitsPerDevUnit();
|
||||
|
||||
while (p < aUTF8 + aUTF8Length) {
|
||||
gunichar ch = g_utf8_get_char(p);
|
||||
|
|
|
@ -1150,7 +1150,7 @@ public:
|
|||
PRUint32 offset = 0;
|
||||
nsAutoTArray<gfxTextRun::DetailedGlyph,1> detailedGlyphs;
|
||||
gfxTextRun::CompressedGlyph g;
|
||||
PRUint32 appUnitsPerDevUnit = PRUint32(aRun->GetAppUnitsPerDevUnit());
|
||||
const PRUint32 appUnitsPerDevUnit = aRun->GetAppUnitsPerDevUnit();
|
||||
while (offset < mLength) {
|
||||
PRUint32 runOffset = offsetInRun + offset;
|
||||
if (offset > 0 && mClusters[offset] == mClusters[offset - 1]) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче