forked from mirrors/gecko-dev
Bug 1482665 Part 5 - Remove nsDeviceContext::AppUnitsPerCSSInch() and replace it with mozilla::AppUnitsPerCSSInch(). r=dholbert
Differential Revision: https://phabricator.services.mozilla.com/D3158
This commit is contained in:
parent
316a8e0c1d
commit
a1ed764131
3 changed files with 4 additions and 10 deletions
|
|
@ -108,12 +108,6 @@ public:
|
||||||
int32_t AppUnitsPerPhysicalInch() const
|
int32_t AppUnitsPerPhysicalInch() const
|
||||||
{ return mAppUnitsPerPhysicalInch; }
|
{ return mAppUnitsPerPhysicalInch; }
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the number of app units in one CSS inch; this is
|
|
||||||
* 96 times AppUnitsPerCSSPixel.
|
|
||||||
*/
|
|
||||||
static int32_t AppUnitsPerCSSInch() { return mozilla::AppUnitsPerCSSInch(); }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the ratio of app units to dev pixels that would be used at unit
|
* Get the ratio of app units to dev pixels that would be used at unit
|
||||||
* (100%) full zoom.
|
* (100%) full zoom.
|
||||||
|
|
|
||||||
|
|
@ -3928,7 +3928,7 @@ nsDocumentViewer::Print(nsIPrintSettings* aPrintSettings,
|
||||||
printJob = new nsPrintJob();
|
printJob = new nsPrintJob();
|
||||||
|
|
||||||
rv = printJob->Initialize(this, mContainer, mDocument,
|
rv = printJob->Initialize(this, mContainer, mDocument,
|
||||||
float(mDeviceContext->AppUnitsPerCSSInch()) /
|
float(AppUnitsPerCSSInch()) /
|
||||||
float(mDeviceContext->AppUnitsPerDevPixel()) /
|
float(mDeviceContext->AppUnitsPerDevPixel()) /
|
||||||
mPageZoom);
|
mPageZoom);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
|
@ -4012,7 +4012,7 @@ nsDocumentViewer::PrintPreview(nsIPrintSettings* aPrintSettings,
|
||||||
printJob = new nsPrintJob();
|
printJob = new nsPrintJob();
|
||||||
|
|
||||||
rv = printJob->Initialize(this, mContainer, doc,
|
rv = printJob->Initialize(this, mContainer, doc,
|
||||||
float(mDeviceContext->AppUnitsPerCSSInch()) /
|
float(AppUnitsPerCSSInch()) /
|
||||||
float(mDeviceContext->AppUnitsPerDevPixel()) /
|
float(mDeviceContext->AppUnitsPerDevPixel()) /
|
||||||
mPageZoom);
|
mPageZoom);
|
||||||
if (NS_FAILED(rv)) {
|
if (NS_FAILED(rv)) {
|
||||||
|
|
|
||||||
|
|
@ -1699,7 +1699,7 @@ nsPrintJob::ReconstructAndReflow(bool doSetPixelScale)
|
||||||
po->mPresContext->SetPageScale(po->mZoomRatio);
|
po->mPresContext->SetPageScale(po->mZoomRatio);
|
||||||
|
|
||||||
// Calculate scale factor from printer to screen
|
// Calculate scale factor from printer to screen
|
||||||
float printDPI = float(printData->mPrintDC->AppUnitsPerCSSInch()) /
|
float printDPI = float(AppUnitsPerCSSInch()) /
|
||||||
float(printData->mPrintDC->AppUnitsPerDevPixel());
|
float(printData->mPrintDC->AppUnitsPerDevPixel());
|
||||||
po->mPresContext->SetPrintPreviewScale(mScreenDPI / printDPI);
|
po->mPresContext->SetPrintPreviewScale(mScreenDPI / printDPI);
|
||||||
|
|
||||||
|
|
@ -2388,7 +2388,7 @@ nsPrintJob::ReflowPrintObject(const UniquePtr<nsPrintObject>& aPO)
|
||||||
aPO->mPresContext->SetIsRootPaginatedDocument(documentIsTopLevel);
|
aPO->mPresContext->SetIsRootPaginatedDocument(documentIsTopLevel);
|
||||||
aPO->mPresContext->SetPageScale(aPO->mZoomRatio);
|
aPO->mPresContext->SetPageScale(aPO->mZoomRatio);
|
||||||
// Calculate scale factor from printer to screen
|
// Calculate scale factor from printer to screen
|
||||||
float printDPI = float(printData->mPrintDC->AppUnitsPerCSSInch()) /
|
float printDPI = float(AppUnitsPerCSSInch()) /
|
||||||
float(printData->mPrintDC->AppUnitsPerDevPixel());
|
float(printData->mPrintDC->AppUnitsPerDevPixel());
|
||||||
aPO->mPresContext->SetPrintPreviewScale(mScreenDPI / printDPI);
|
aPO->mPresContext->SetPrintPreviewScale(mScreenDPI / printDPI);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue