Kaydet (Commit) 9e35b5a7 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl Kaydeden (comit) Tomaž Vajngerl

handle CG state save/restore in ContextHolder class

Change-Id: I44ee257a8a196e8f2372dd01776c0c7c5193ad0a
Reviewed-on: https://gerrit.libreoffice.org/72436
Tested-by: Jenkins
Reviewed-by: 's avatarTomaž Vajngerl <quikee@gmail.com>
üst 06b46104
...@@ -130,10 +130,16 @@ private: ...@@ -130,10 +130,16 @@ private:
class CGContextHolder class CGContextHolder
{ {
CGContextRef mpContext; CGContextRef mpContext;
#if OSL_DEBUG_LEVEL > 0
int mnContextStackDepth;
#endif
public: public:
CGContextHolder() CGContextHolder()
: mpContext(nullptr) : mpContext(nullptr)
#if OSL_DEBUG_LEVEL > 0
, mnContextStackDepth( 0 )
#endif
{} {}
CGContextRef get() const CGContextRef get() const
...@@ -150,6 +156,18 @@ public: ...@@ -150,6 +156,18 @@ public:
{ {
mpContext = pContext; mpContext = pContext;
} }
void saveState()
{
SAL_INFO("vcl.cg", "CGContextSaveGState(" << mpContext << ") " << ++mnContextStackDepth );
CGContextSaveGState(mpContext);
}
void restoreState()
{
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << mpContext << ") " << mnContextStackDepth-- );
CGContextRestoreGState(mpContext);
}
}; };
class AquaSalGraphics : public SalGraphics class AquaSalGraphics : public SalGraphics
...@@ -159,7 +177,6 @@ class AquaSalGraphics : public SalGraphics ...@@ -159,7 +177,6 @@ class AquaSalGraphics : public SalGraphics
#ifdef MACOSX #ifdef MACOSX
AquaSalFrame* mpFrame; AquaSalFrame* mpFrame;
#endif #endif
int mnContextStackDepth;
XorEmulation* mpXorEmulation; XorEmulation* mpXorEmulation;
int mnXorMode; // 0: off 1: on 2: invert only int mnXorMode; // 0: off 1: on 2: invert only
int mnWidth; int mnWidth;
......
...@@ -303,7 +303,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, ...@@ -303,7 +303,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
if( ! CheckContext() ) if( ! CheckContext() )
return false; return false;
CGContextSaveGState( maContextHolder.get() ); maContextHolder.saveState();
tools::Rectangle buttonRect = rControlRegion; tools::Rectangle buttonRect = rControlRegion;
HIRect rc = ImplGetHIRectFromRectangle(buttonRect); HIRect rc = ImplGetHIRectFromRectangle(buttonRect);
...@@ -986,7 +986,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType, ...@@ -986,7 +986,7 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
default: break; default: break;
} }
CGContextRestoreGState( maContextHolder.get() ); maContextHolder.restoreState();
/* #i90291# in most cases invalidating the whole control region instead /* #i90291# in most cases invalidating the whole control region instead
of just the unclipped part of it is sufficient (and probably faster). of just the unclipped part of it is sufficient (and probably faster).
......
...@@ -184,9 +184,6 @@ AquaSalGraphics::AquaSalGraphics() ...@@ -184,9 +184,6 @@ AquaSalGraphics::AquaSalGraphics()
: mxLayer( nullptr ) : mxLayer( nullptr )
#ifdef MACOSX #ifdef MACOSX
, mpFrame( nullptr ) , mpFrame( nullptr )
#endif
#if OSL_DEBUG_LEVEL > 0
, mnContextStackDepth( 0 )
#endif #endif
, mpXorEmulation( nullptr ) , mpXorEmulation( nullptr )
, mnXorMode( 0 ) , mnXorMode( 0 )
...@@ -449,8 +446,7 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) ...@@ -449,8 +446,7 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
std::cerr << "]\n"; std::cerr << "]\n";
#endif #endif
SAL_INFO("vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState(maContextHolder.get());
// The view is vertically flipped (no idea why), flip it back. // The view is vertically flipped (no idea why), flip it back.
SAL_INFO("vcl.cg", "CGContextScaleCTM(" << maContextHolder.get() << ",1,-1)"); SAL_INFO("vcl.cg", "CGContextScaleCTM(" << maContextHolder.get() << ",1,-1)");
...@@ -478,8 +474,7 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) ...@@ -478,8 +474,7 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
size_t nStartIndex = std::distance(aGlyphOrientation.cbegin(), aIt); size_t nStartIndex = std::distance(aGlyphOrientation.cbegin(), aIt);
size_t nLen = std::distance(aIt, aNext); size_t nLen = std::distance(aIt, aNext);
SAL_INFO("vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState(maContextHolder.get());
if (rStyle.mfFontRotation && !bUprightGlyph) if (rStyle.mfFontRotation && !bUprightGlyph)
{ {
SAL_INFO("vcl.cg", "CGContextRotateCTM(" << maContextHolder.get() << "," << rStyle.mfFontRotation << ")"); SAL_INFO("vcl.cg", "CGContextRotateCTM(" << maContextHolder.get() << "," << rStyle.mfFontRotation << ")");
...@@ -487,14 +482,12 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout) ...@@ -487,14 +482,12 @@ void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
} }
SAL_INFO("vcl.cg", "CTFontDrawGlyphs() @" << nStartIndex << ":" << nLen << "," << maContextHolder.get()); SAL_INFO("vcl.cg", "CTFontDrawGlyphs() @" << nStartIndex << ":" << nLen << "," << maContextHolder.get());
CTFontDrawGlyphs(pFont, &aGlyphIds[nStartIndex], &aGlyphPos[nStartIndex], nLen, maContextHolder.get()); CTFontDrawGlyphs(pFont, &aGlyphIds[nStartIndex], &aGlyphPos[nStartIndex], nLen, maContextHolder.get());
SAL_INFO("vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth-- ); maContextHolder.restoreState();
CGContextRestoreGState(maContextHolder.get());
aIt = aNext; aIt = aNext;
} }
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth-- ); maContextHolder.restoreState();
CGContextRestoreGState(maContextHolder.get());
} }
void AquaSalGraphics::SetFont(LogicalFontInstance* pReqFont, int nFallbackLevel) void AquaSalGraphics::SetFont(LogicalFontInstance* pReqFont, int nFallbackLevel)
......
...@@ -629,8 +629,7 @@ bool AquaSalGraphics::drawTransformedBitmap( ...@@ -629,8 +629,7 @@ bool AquaSalGraphics::drawTransformedBitmap(
// setup the image transformation // setup the image transformation
// using the rNull,rX,rY points as destinations for the (0,0),(0,Width),(Height,0) source points // using the rNull,rX,rY points as destinations for the (0,0),(0,Width),(Height,0) source points
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState( maContextHolder.get() );
const basegfx::B2DVector aXRel = rX - rNull; const basegfx::B2DVector aXRel = rX - rNull;
const basegfx::B2DVector aYRel = rY - rNull; const basegfx::B2DVector aYRel = rY - rNull;
const CGAffineTransform aCGMat = CGAffineTransformMake( const CGAffineTransform aCGMat = CGAffineTransformMake(
...@@ -649,8 +648,7 @@ bool AquaSalGraphics::drawTransformedBitmap( ...@@ -649,8 +648,7 @@ bool AquaSalGraphics::drawTransformedBitmap(
SAL_INFO( "vcl.cg", "CGImageRelease(" << xImage << ")" ); SAL_INFO( "vcl.cg", "CGImageRelease(" << xImage << ")" );
CGImageRelease( xImage ); CGImageRelease( xImage );
// restore the Quartz graphics state // restore the Quartz graphics state
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth--); maContextHolder.restoreState();
CGContextRestoreGState(maContextHolder.get());
// mark the destination as painted // mark the destination as painted
const CGRect aDstRect = CGRectApplyAffineTransform( aSrcRect, aCGMat ); const CGRect aDstRect = CGRectApplyAffineTransform( aSrcRect, aCGMat );
...@@ -666,8 +664,7 @@ bool AquaSalGraphics::drawAlphaRect( long nX, long nY, long nWidth, ...@@ -666,8 +664,7 @@ bool AquaSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
return true; return true;
// save the current state // save the current state
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState( maContextHolder.get() );
SAL_INFO( "vcl.cg", "CGContextSetAlpha(" << maContextHolder.get() << "," << (100-nTransparency) * (1.0/100) << ")" ); SAL_INFO( "vcl.cg", "CGContextSetAlpha(" << maContextHolder.get() << "," << (100-nTransparency) * (1.0/100) << ")" );
CGContextSetAlpha( maContextHolder.get(), (100-nTransparency) * (1.0/100) ); CGContextSetAlpha( maContextHolder.get(), (100-nTransparency) * (1.0/100) );
...@@ -685,9 +682,7 @@ bool AquaSalGraphics::drawAlphaRect( long nX, long nY, long nWidth, ...@@ -685,9 +682,7 @@ bool AquaSalGraphics::drawAlphaRect( long nX, long nY, long nWidth,
SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << ",kCGPathFill)" ); SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << ",kCGPathFill)" );
CGContextDrawPath( maContextHolder.get(), kCGPathFill ); CGContextDrawPath( maContextHolder.get(), kCGPathFill );
// restore state maContextHolder.restoreState();
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth--);
CGContextRestoreGState(maContextHolder.get());
RefreshRect( aRect ); RefreshRect( aRect );
return true; return true;
...@@ -752,8 +747,7 @@ bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, ...@@ -752,8 +747,7 @@ bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
return false; return false;
} }
// NOTE: flip drawing, else the nsimage would be drawn upside down // NOTE: flip drawing, else the nsimage would be drawn upside down
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState( maContextHolder.get() );
// CGContextTranslateCTM( maContextHolder.get(), 0, +mnHeight ); // CGContextTranslateCTM( maContextHolder.get(), 0, +mnHeight );
SAL_INFO( "vcl.cg", "CGContextScaleCTM(" << maContextHolder.get() << ",+1,-1)" ); SAL_INFO( "vcl.cg", "CGContextScaleCTM(" << maContextHolder.get() << ",+1,-1)" );
CGContextScaleCTM( maContextHolder.get(), +1, -1 ); CGContextScaleCTM( maContextHolder.get(), +1, -1 );
...@@ -776,8 +770,7 @@ bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight, ...@@ -776,8 +770,7 @@ bool AquaSalGraphics::drawEPS( long nX, long nY, long nWidth, long nHeight,
[NSGraphicsContext setCurrentContext: pOrigNSCtx]; [NSGraphicsContext setCurrentContext: pOrigNSCtx];
[pOrigNSCtx release]; // restore the original retain count [pOrigNSCtx release]; // restore the original retain count
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth--); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get() );
// mark the destination rectangle as updated // mark the destination rectangle as updated
RefreshRect( aDstRect ); RefreshRect( aDstRect );
...@@ -927,8 +920,7 @@ bool AquaSalGraphics::drawPolyLine( ...@@ -927,8 +920,7 @@ bool AquaSalGraphics::drawPolyLine(
if( ! ((aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125)) ) if( ! ((aRefreshRect.size.width <= 0.125) && (aRefreshRect.size.height <= 0.125)) )
{ {
// use the path to prepare the graphics context // use the path to prepare the graphics context
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState( maContextHolder.get() );
SAL_INFO( "vcl.cg", "CGContextBeginPath(" << maContextHolder.get() << ")" ); SAL_INFO( "vcl.cg", "CGContextBeginPath(" << maContextHolder.get() << ")" );
CGContextBeginPath( maContextHolder.get() ); CGContextBeginPath( maContextHolder.get() );
SAL_INFO( "vcl.cg", "CGContextAddPath(" << maContextHolder.get() << "," << xPath << ")" ); SAL_INFO( "vcl.cg", "CGContextAddPath(" << maContextHolder.get() << "," << xPath << ")" );
...@@ -943,8 +935,7 @@ bool AquaSalGraphics::drawPolyLine( ...@@ -943,8 +935,7 @@ bool AquaSalGraphics::drawPolyLine(
CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit); CGContextSetMiterLimit(maContextHolder.get(), fCGMiterLimit);
SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << ",kCGPathStroke)" ); SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << ",kCGPathStroke)" );
CGContextDrawPath( maContextHolder.get(), kCGPathStroke ); CGContextDrawPath( maContextHolder.get(), kCGPathStroke );
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth-- ); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get() );
// mark modified rectangle as updated // mark modified rectangle as updated
RefreshRect( aRefreshRect ); RefreshRect( aRefreshRect );
...@@ -1021,8 +1012,7 @@ bool AquaSalGraphics::drawPolyPolygon( ...@@ -1021,8 +1012,7 @@ bool AquaSalGraphics::drawPolyPolygon(
} }
// use the path to prepare the graphics context // use the path to prepare the graphics context
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState( maContextHolder.get() );
SAL_INFO( "vcl.cg", "CGContextBeginPath(" << maContextHolder.get() << ")" ); SAL_INFO( "vcl.cg", "CGContextBeginPath(" << maContextHolder.get() << ")" );
CGContextBeginPath( maContextHolder.get() ); CGContextBeginPath( maContextHolder.get() );
SAL_INFO( "vcl.cg", "CGContextAddPath(" << maContextHolder.get() << "," << xPath << ")" ); SAL_INFO( "vcl.cg", "CGContextAddPath(" << maContextHolder.get() << "," << xPath << ")" );
...@@ -1034,8 +1024,7 @@ bool AquaSalGraphics::drawPolyPolygon( ...@@ -1034,8 +1024,7 @@ bool AquaSalGraphics::drawPolyPolygon(
CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency ); CGContextSetAlpha( maContextHolder.get(), 1.0 - fTransparency );
SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << "," << eMode << ")" ); SAL_INFO( "vcl.cg", "CGContextDrawPath(" << maContextHolder.get() << "," << eMode << ")" );
CGContextDrawPath( maContextHolder.get(), eMode ); CGContextDrawPath( maContextHolder.get(), eMode );
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth-- ); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get() );
// mark modified rectangle as updated // mark modified rectangle as updated
RefreshRect( aRefreshRect ); RefreshRect( aRefreshRect );
...@@ -1555,9 +1544,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn ...@@ -1555,9 +1544,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn
if ( CheckContext() ) if ( CheckContext() )
{ {
CGRect aCGRect = CGRectMake( nX, nY, nWidth, nHeight); CGRect aCGRect = CGRectMake( nX, nY, nWidth, nHeight);
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth); maContextHolder.saveState();
CGContextSaveGState(maContextHolder.get());
if ( nFlags & SalInvert::TrackFrame ) if ( nFlags & SalInvert::TrackFrame )
{ {
const CGFloat dashLengths[2] = { 4.0, 4.0 }; // for drawing dashed line const CGFloat dashLengths[2] = { 4.0, 4.0 }; // for drawing dashed line
...@@ -1584,8 +1571,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn ...@@ -1584,8 +1571,7 @@ void AquaSalGraphics::invert( long nX, long nY, long nWidth, long nHeight, SalIn
SAL_INFO( "vcl.cg", "CGContextFillRect(" << maContextHolder.get() << "," << aCGRect << ")" ); SAL_INFO( "vcl.cg", "CGContextFillRect(" << maContextHolder.get() << "," << aCGRect << ")" );
CGContextFillRect ( maContextHolder.get(), aCGRect ); CGContextFillRect ( maContextHolder.get(), aCGRect );
} }
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth-- ); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get());
RefreshRect( aCGRect ); RefreshRect( aCGRect );
} }
} }
...@@ -1609,8 +1595,7 @@ void AquaSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalIn ...@@ -1609,8 +1595,7 @@ void AquaSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalIn
{ {
if ( CheckContext() ) if ( CheckContext() )
{ {
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth); maContextHolder.saveState();
CGContextSaveGState(maContextHolder.get());
CGPoint* CGpoints = makeCGptArray(nPoints,pPtAry); CGPoint* CGpoints = makeCGptArray(nPoints,pPtAry);
CGContextAddLines ( maContextHolder.get(), CGpoints, nPoints ); CGContextAddLines ( maContextHolder.get(), CGpoints, nPoints );
if ( nSalFlags & SalInvert::TrackFrame ) if ( nSalFlags & SalInvert::TrackFrame )
...@@ -1638,8 +1623,7 @@ void AquaSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalIn ...@@ -1638,8 +1623,7 @@ void AquaSalGraphics::invert( sal_uInt32 nPoints, const SalPoint* pPtAry, SalIn
CGContextFillPath( maContextHolder.get() ); CGContextFillPath( maContextHolder.get() );
} }
const CGRect aRefreshRect = CGContextGetClipBoundingBox(maContextHolder.get()); const CGRect aRefreshRect = CGContextGetClipBoundingBox(maContextHolder.get());
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth-- ); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get());
delete [] CGpoints; delete [] CGpoints;
RefreshRect( aRefreshRect ); RefreshRect( aRefreshRect );
} }
...@@ -1680,10 +1664,8 @@ void AquaSalGraphics::ResetClipRegion() ...@@ -1680,10 +1664,8 @@ void AquaSalGraphics::ResetClipRegion()
void AquaSalGraphics::SetState() void AquaSalGraphics::SetState()
{ {
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth--); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get() ); maContextHolder.saveState();
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth );
CGContextSaveGState( maContextHolder.get() );
// setup clipping // setup clipping
if( mxClipPath ) if( mxClipPath )
...@@ -2093,8 +2075,7 @@ void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContex ...@@ -2093,8 +2075,7 @@ void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContex
// We will return early a few lines lower. // We will return early a few lines lower.
// Undo the "stack initialization" done at the initial call of // Undo the "stack initialization" done at the initial call of
// this method, see end. // this method, see end.
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ") " << mnContextStackDepth--); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get() );
} }
#endif #endif
...@@ -2146,8 +2127,7 @@ void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContex ...@@ -2146,8 +2127,7 @@ void AquaSalGraphics::SetVirDevGraphics( CGLayerRef xLayer, CGContextRef xContex
} }
// initialize stack of CGContext states // initialize stack of CGContext states
SAL_INFO( "vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth ); maContextHolder.saveState();
CGContextSaveGState( maContextHolder.get() );
SetState(); SetState();
} }
......
...@@ -76,8 +76,7 @@ void AquaSalGraphics::UnsetState() ...@@ -76,8 +76,7 @@ void AquaSalGraphics::UnsetState()
{ {
if (maContextHolder.isSet()) if (maContextHolder.isSet())
{ {
SAL_INFO( "vcl.cg", "CGContextRestoreGState(" << maContextHolder.get() << ")" ); maContextHolder.restoreState();
CGContextRestoreGState( maContextHolder.get() );
maContextHolder.set(nullptr); maContextHolder.set(nullptr);
} }
if( mxClipPath ) if( mxClipPath )
...@@ -164,8 +163,7 @@ bool AquaSalGraphics::CheckContext() ...@@ -164,8 +163,7 @@ bool AquaSalGraphics::CheckContext()
CGContextScaleCTM(maContextHolder.get(), 1.0, -1.0); CGContextScaleCTM(maContextHolder.get(), 1.0, -1.0);
CGContextSetFillColorSpace(maContextHolder.get(), GetSalData()->mxRGBSpace); CGContextSetFillColorSpace(maContextHolder.get(), GetSalData()->mxRGBSpace);
CGContextSetStrokeColorSpace(maContextHolder.get(), GetSalData()->mxRGBSpace); CGContextSetStrokeColorSpace(maContextHolder.get(), GetSalData()->mxRGBSpace);
SAL_INFO("vcl.cg", "CGContextSaveGState(" << maContextHolder.get() << ") " << ++mnContextStackDepth); maContextHolder.saveState();
CGContextSaveGState(maContextHolder.get());
SetState(); SetState();
// re-enable XOR emulation for the new context // re-enable XOR emulation for the new context
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment