Bug 1482665 Part 4 - Remove nsDeviceContext::AppUnitsPerCSSPixel() and replace it with mozilla::AppUnitsPerCSSPixel(). r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D3157
This commit is contained in:
Ting-Yu Lin 2018-08-11 15:17:50 -07:00
Родитель 74992134e1
Коммит 316a8e0c1d
6 изменённых файлов: 9 добавлений и 15 удалений

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

@ -72,7 +72,7 @@ CompositorAnimationStorage::GetOMTAValue(const uint64_t& aId) const
// nsStyleTransformMatrix::ProcessTranslatePart which is called from
// nsDisplayTransform::GetResultingTransformMatrix)
double devPerCss =
double(scale) / double(nsDeviceContext::AppUnitsPerCSSPixel());
double(scale) / double(AppUnitsPerCSSPixel());
transform._41 *= devPerCss;
transform._42 *= devPerCss;
transform._43 *= devPerCss;

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

@ -81,12 +81,6 @@ public:
*/
already_AddRefed<gfxContext> CreateReferenceRenderingContext();
/**
* Gets the number of app units in one CSS pixel; this number is global,
* not unique to each device context.
*/
static int32_t AppUnitsPerCSSPixel() { return mozilla::AppUnitsPerCSSPixel(); }
/**
* Gets the number of app units in one device pixel; this number
* is usually a factor of AppUnitsPerCSSPixel(), although that is

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

@ -138,7 +138,7 @@ nsFontMetrics::nsFontMetrics(const nsFont& aFont, const Params& aParams,
aFont.AddFontVariationsToStyle(&style);
gfxFloat devToCssSize = gfxFloat(mP2A) /
gfxFloat(nsDeviceContext::AppUnitsPerCSSPixel());
gfxFloat(AppUnitsPerCSSPixel());
mFontGroup = gfxPlatform::GetPlatform()->
CreateFontGroup(aFont.fontlist, &style, aParams.textPerf,
aParams.userFontSet, devToCssSize);

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

@ -45,16 +45,16 @@ FILE* operator<<(FILE* out, const nsRect& rect)
// Output the coordinates in fractional pixels so they're easier to read
tmp.Append('{');
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.X(),
nsDeviceContext::AppUnitsPerCSSPixel()));
AppUnitsPerCSSPixel()));
tmp.AppendLiteral(", ");
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.Y(),
nsDeviceContext::AppUnitsPerCSSPixel()));
AppUnitsPerCSSPixel()));
tmp.AppendLiteral(", ");
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.Width(),
nsDeviceContext::AppUnitsPerCSSPixel()));
AppUnitsPerCSSPixel()));
tmp.AppendLiteral(", ");
tmp.AppendFloat(NSAppUnitsToFloatPixels(rect.Height(),
nsDeviceContext::AppUnitsPerCSSPixel()));
AppUnitsPerCSSPixel()));
tmp.Append('}');
fputs(NS_LossyConvertUTF16toASCII(tmp).get(), out);
return out;

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

@ -259,7 +259,7 @@ gfxFontMissingGlyphs::DrawMissingGlyph(uint32_t aChar,
// We always want integer scaling, otherwise the "bitmap" glyphs will look
// even uglier than usual when zoomed
int32_t devPixelsPerCSSPx =
std::max<int32_t>(1, nsDeviceContext::AppUnitsPerCSSPixel() /
std::max<int32_t>(1, AppUnitsPerCSSPixel() /
aAppUnitsPerDevPixel);
Matrix tempMat;
@ -337,6 +337,6 @@ gfxFontMissingGlyphs::GetDesiredMinWidth(uint32_t aChar,
HEX_CHAR_GAP + BOX_BORDER_WIDTH + BOX_HORIZONTAL_INSET;
// Note that this will give us floating-point division, so the width will
// -not- be snapped to integer multiples of its basic pixel value
width *= Float(nsDeviceContext::AppUnitsPerCSSPixel()) / aAppUnitsPerDevPixel;
width *= Float(AppUnitsPerCSSPixel()) / aAppUnitsPerDevPixel;
return width;
}

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

@ -6887,7 +6887,7 @@ nsLayoutUtils::DrawSingleImage(gfxContext& aContext,
const nsPoint* aAnchorPoint,
const nsRect* aSourceArea)
{
nscoord appUnitsPerCSSPixel = nsDeviceContext::AppUnitsPerCSSPixel();
nscoord appUnitsPerCSSPixel = AppUnitsPerCSSPixel();
CSSIntSize pixelImageSize(ComputeSizeForDrawingWithFallback(aImage, aDest.Size()));
if (pixelImageSize.width < 1 || pixelImageSize.height < 1) {
NS_ASSERTION(pixelImageSize.width >= 0 && pixelImageSize.height >= 0,