summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-12-19 00:04:55 +0200
committerTor Lillqvist <tml@collabora.com>2013-12-19 00:17:29 +0200
commit0d9c4baf86c502e7cc2b6072a530c6fad2179abe (patch)
treea51f92a2395691de03e11c94487c7b23791515bb /vcl
parent2753bc1eff1bc595131a59518c1f7e131824b10d (diff)
The "fake DPI scale" was always 1
Thanks to kendy for noticing. Change-Id: I6b62d5a0c1dc5df374629a8f7c6e7d2f7cd7ffbd
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/headless/svpgdi.hxx4
-rw-r--r--vcl/inc/quartz/salgdi.h8
-rw-r--r--vcl/osx/salprn.cxx2
-rw-r--r--vcl/quartz/ctfonts.cxx10
-rw-r--r--vcl/quartz/salgdi.cxx4
-rw-r--r--vcl/quartz/salgdicommon.cxx7
-rw-r--r--vcl/quartz/salgdiutils.cxx3
7 files changed, 12 insertions, 26 deletions
diff --git a/vcl/inc/headless/svpgdi.hxx b/vcl/inc/headless/svpgdi.hxx
index 1135c7dfcbdf..c3ffc6545cb1 100644
--- a/vcl/inc/headless/svpgdi.hxx
+++ b/vcl/inc/headless/svpgdi.hxx
@@ -74,10 +74,6 @@ class SvpSalGraphics : public SalGraphics
int mnWidth;
int mnHeight;
int mnBitmapDepth; // zero unless bitmap
- /// some graphics implementations (e.g. AquaSalInfoPrinter) scale
- /// everything down by a factor (see SetupPrinterGraphics for details)
- /// so we have to compensate for it with the inverse factor
- double mfFakeDPIScale;
/// path representing current clip region
CGMutablePathRef mxClipPath;
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 49140faf5451..e0b86c3c82eb 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -92,7 +92,7 @@ public:
SalLayout* GetTextLayout( void ) const;
- void GetFontMetric( float fPDIY, ImplFontMetricData& ) const;
+ void GetFontMetric( ImplFontMetricData& ) const;
bool GetGlyphBoundRect( sal_GlyphId, Rectangle& ) const;
bool GetGlyphOutline( sal_GlyphId, basegfx::B2DPolyPolygon& ) const;
@@ -156,10 +156,6 @@ protected:
/// device resolution of this graphics
long mnRealDPIX;
long mnRealDPIY;
- /// some graphics implementations (e.g. AquaSalInfoPrinter) scale
- /// everything down by a factor (see SetupPrinterGraphics for details)
- /// so we have to compensate for it with the inverse factor
- double mfFakeDPIScale;
/// path representing current clip region
CGMutablePathRef mxClipPath;
@@ -194,7 +190,7 @@ public:
bool IsBrushVisible() const { return maFillColor.IsVisible(); }
void SetWindowGraphics( AquaSalFrame* pFrame );
- void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY, double fFakeScale );
+ void SetPrinterGraphics( CGContextRef, long nRealDPIX, long nRealDPIY );
void SetVirDevGraphics( CGLayerRef, CGContextRef, int nBitDepth = 0 );
void initResolution( NSWindow* );
diff --git a/vcl/osx/salprn.cxx b/vcl/osx/salprn.cxx
index 082fa1cdc199..37fa0ec0ec04 100644
--- a/vcl/osx/salprn.cxx
+++ b/vcl/osx/salprn.cxx
@@ -139,7 +139,7 @@ void AquaSalInfoPrinter::SetupPrinterGraphics( CGContextRef i_rContext ) const
// scale to be top/down and reflect our "virtual" DPI
CGContextScaleCTM( i_rContext, -(72.0/double(nDPIY)), (72.0/double(nDPIX)) );
}
- mpGraphics->SetPrinterGraphics( i_rContext, nDPIX, nDPIY, 1.0 );
+ mpGraphics->SetPrinterGraphics( i_rContext, nDPIX, nDPIY );
}
else
OSL_FAIL( "no print info in SetupPrinterGraphics" );
diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index d93d4b59b7d3..8211b9f296a2 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -112,20 +112,20 @@ CoreTextStyle::~CoreTextStyle( void )
// -----------------------------------------------------------------------
-void CoreTextStyle::GetFontMetric( float fPixelSize, ImplFontMetricData& rMetric ) const
+void CoreTextStyle::GetFontMetric( ImplFontMetricData& rMetric ) const
{
// get the matching CoreText font handle
// TODO: is it worth it to cache the CTFontRef in SetFont() and reuse it here?
CTFontRef aCTFontRef = (CTFontRef)CFDictionaryGetValue( mpStyleDict, kCTFontAttributeName );
- rMetric.mnAscent = lrint( CTFontGetAscent( aCTFontRef ) * fPixelSize);
- rMetric.mnDescent = lrint( CTFontGetDescent( aCTFontRef ) * fPixelSize);
- rMetric.mnExtLeading = lrint( CTFontGetLeading( aCTFontRef ) * fPixelSize);
+ rMetric.mnAscent = CTFontGetAscent( aCTFontRef );
+ rMetric.mnDescent = CTFontGetDescent( aCTFontRef );
+ rMetric.mnExtLeading = CTFontGetLeading( aCTFontRef );
rMetric.mnIntLeading = 0;
// since ImplFontMetricData::mnWidth is only used for stretching/squeezing fonts
// setting this width to the pixel height of the fontsize is good enough
// it also makes the calculation of the stretch factor simple
- rMetric.mnWidth = lrint( CTFontGetSize( aCTFontRef ) * fPixelSize * mfFontStretch);
+ rMetric.mnWidth = lrint( CTFontGetSize( aCTFontRef ) * mfFontStretch);
// all CoreText fonts are scalable
rMetric.mbScalableFont = true;
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 25a219ff5770..ceef0235410e 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -254,7 +254,6 @@ AquaSalGraphics::AquaSalGraphics()
, mnBitmapDepth( 0 )
, mnRealDPIX( 0 )
, mnRealDPIY( 0 )
- , mfFakeDPIScale( 1.0 )
, mxClipPath( NULL )
, maLineColor( COL_WHITE )
, maFillColor( COL_BLACK )
@@ -274,7 +273,6 @@ AquaSalGraphics::AquaSalGraphics()
, mnWidth( 0 )
, mnHeight( 0 )
, mnBitmapDepth( 0 )
- , mfFakeDPIScale( 1.0 )
, mxClipPath( NULL )
, maLineColor( COL_WHITE )
, maFillColor( COL_BLACK )
@@ -325,7 +323,7 @@ void AquaSalGraphics::SetTextColor( SalColor nSalColor )
void AquaSalGraphics::GetFontMetric( ImplFontMetricData* pMetric, int /*nFallbackLevel*/ )
{
- mpTextStyle->GetFontMetric( mfFakeDPIScale, *pMetric );
+ mpTextStyle->GetFontMetric( *pMetric );
}
// -----------------------------------------------------------------------
diff --git a/vcl/quartz/salgdicommon.cxx b/vcl/quartz/salgdicommon.cxx
index 6f96a6c7dcc0..59edb0539c34 100644
--- a/vcl/quartz/salgdicommon.cxx
+++ b/vcl/quartz/salgdicommon.cxx
@@ -519,7 +519,6 @@ void AquaSalGraphics::copyResolution( AquaSalGraphics& rGraphics )
}
mnRealDPIX = rGraphics.mnRealDPIX;
mnRealDPIY = rGraphics.mnRealDPIY;
- mfFakeDPIScale = rGraphics.mfFakeDPIScale;
}
#endif
@@ -1241,8 +1240,8 @@ void AquaSalGraphics::GetResolution( sal_Int32& rDPIX, sal_Int32& rDPIY )
initResolution( (mbWindow && mpFrame) ? mpFrame->getNSWindow() : nil );
}
- rDPIX = lrint( mfFakeDPIScale * mnRealDPIX);
- rDPIY = lrint( mfFakeDPIScale * mnRealDPIY);
+ rDPIX = mnRealDPIX;
+ rDPIY = mnRealDPIY;
}
#endif
@@ -1353,8 +1352,6 @@ void AquaSalGraphics::initResolution( NSWindow* )
mnRealDPIX = pSalData->mnDPIX;
mnRealDPIY = pSalData->mnDPIY;
}
-
- mfFakeDPIScale = 1.0;
}
#endif
diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx
index f31b09a40d12..c48089f86588 100644
--- a/vcl/quartz/salgdiutils.cxx
+++ b/vcl/quartz/salgdiutils.cxx
@@ -44,14 +44,13 @@ void AquaSalGraphics::SetWindowGraphics( AquaSalFrame* pFrame )
mbVirDev = false;
}
-void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, long nDPIY, double fScale )
+void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, long nDPIY )
{
mbWindow = false;
mbPrinter = true;
mbVirDev = false;
mrContext = xContext;
- mfFakeDPIScale = fScale;
mnRealDPIX = nDPIX;
mnRealDPIY = nDPIY;