diff options
author | Tor Lillqvist <tml@collabora.com> | 2014-03-24 13:27:48 +0200 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-03-24 14:47:08 +0200 |
commit | 1d9561f56c0e39aa54e3f23d509be98514ff2abc (patch) | |
tree | fda727d78d0f7087300bb72f975b1fd2339e110e /vcl/quartz/salgdiutils.cxx | |
parent | 6ce67f4f636cd7cc93abb87b0fca32f433045741 (diff) |
Fix a few problems in the iOS vcl code
We don't need the headless SvpSalBitmap code after all on iOS, so
bypass all of svpbmp.cxx for iOS.
I accidentally had left duplicates for some AquaSalGraphics methods in
headless/svpgdi.cxx in addition to the ones in
quartz/salgdicommon.cxx. This is obviously bogus, the linker just
picks the ones that come first in the archive.
(Remember the ugly "#define SvpSalGraphics AquaSalGraphics" trick, so
for instance SvpSalGraphics::setClipRegion actuall is
AquaSalGraphics::setClipRegion.)
It's the Quartz ones we want, as since the switch to tiled rendering
the iOS vcl code is supposed to work much more like the OS X
one. (There is still some significant refactoring to do
there. Possibly no "headless" code needs to be used at all for iOS.)
A couple of functions moved from salgdiutils.cxx (which isn't compiled
for iOS) to salgdicommon.cxx.
The SetState() function now gets used also on iOS, and to properly
undo its CG context stacking I pop it in SetVirDevGraphics() when the
virtual device is being destroyed.
This fixed the rendering of some simple shapes that use overlapping
and transparency, but not that of the "monster" SmartArts.
Change-Id: I2bfaa4129e3641dbdd1dd240c1d07f9bdcfea1b8
Diffstat (limited to 'vcl/quartz/salgdiutils.cxx')
-rw-r--r-- | vcl/quartz/salgdiutils.cxx | 88 |
1 files changed, 0 insertions, 88 deletions
diff --git a/vcl/quartz/salgdiutils.cxx b/vcl/quartz/salgdiutils.cxx index 50792ed81cbc..229c3437d80c 100644 --- a/vcl/quartz/salgdiutils.cxx +++ b/vcl/quartz/salgdiutils.cxx @@ -70,55 +70,6 @@ void AquaSalGraphics::SetPrinterGraphics( CGContextRef xContext, long nDPIX, lon } } -void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContext, - int nBitmapDepth ) -{ - mbWindow = false; - mbPrinter = false; - mbVirDev = true; - - // set graphics properties - mxLayer = xLayer; - mrContext = xContext; - mnBitmapDepth = nBitmapDepth; - - // return early if the virdev is being destroyed - if( !xContext ) - return; - - // get new graphics properties - if( !mxLayer ) - { - mnWidth = CGBitmapContextGetWidth( mrContext ); - mnHeight = CGBitmapContextGetHeight( mrContext ); - } - else - { - const CGSize aSize = CGLayerGetSize( mxLayer ); - mnWidth = static_cast<int>(aSize.width); - mnHeight = static_cast<int>(aSize.height); - } - - // prepare graphics for drawing - const CGColorSpaceRef aCGColorSpace = GetSalData()->mxRGBSpace; - CGContextSetFillColorSpace( mrContext, aCGColorSpace ); - CGContextSetStrokeColorSpace( mrContext, aCGColorSpace ); - - // re-enable XorEmulation for the new context - if( mpXorEmulation ) - { - mpXorEmulation->SetTarget( mnWidth, mnHeight, mnBitmapDepth, mrContext, mxLayer ); - if( mpXorEmulation->IsEnabled() ) - mrContext = mpXorEmulation->GetMaskContext(); - } - - // initialize stack of CGContext states - CGContextSaveGState( mrContext ); - SetState(); -} - - - void AquaSalGraphics::InvalidateContext() { UnsetState(); @@ -141,29 +92,6 @@ void AquaSalGraphics::UnsetState() } } -void AquaSalGraphics::SetState() -{ - CGContextRestoreGState( mrContext ); - CGContextSaveGState( mrContext ); - - // setup clipping - if( mxClipPath ) - { - CGContextBeginPath( mrContext ); // discard any existing path - CGContextAddPath( mrContext, mxClipPath ); // set the current path to the clipping path - CGContextClip( mrContext ); // use it for clipping - } - - // set RGB colorspace and line and fill colors - CGContextSetFillColor( mrContext, maFillColor.AsArray() ); - CGContextSetStrokeColor( mrContext, maLineColor.AsArray() ); - CGContextSetShouldAntialias( mrContext, false ); - if( mnXorMode == 2 ) - CGContextSetBlendMode( mrContext, kCGBlendModeDifference ); -} - - - bool AquaSalGraphics::CheckContext() { if( mbWindow && mpFrame && mpFrame->getNSWindow() ) @@ -250,22 +178,6 @@ void AquaSalGraphics::RefreshRect(float lX, float lY, float lWidth, float lHeigh } } -CGPoint* AquaSalGraphics::makeCGptArray(sal_uLong nPoints, const SalPoint* pPtAry) -{ - CGPoint *CGpoints = new CGPoint[nPoints]; - if ( CGpoints ) - { - for(sal_uLong i=0;i<nPoints;i++) - { - CGpoints[i].x = (float)(pPtAry[i].mnX); - CGpoints[i].y = (float)(pPtAry[i].mnY); - } - } - return CGpoints; -} - - - void AquaSalGraphics::UpdateWindow( NSRect& ) { if( !mpFrame ) |