summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-08-10 15:49:09 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-08-10 16:31:12 +0200
commit131d5b01f400899470925757658841080b09283a (patch)
tree1839098c308b53c03df42c8c83292def7e1bd53b
parent711b34d590e659ed754f7c57b3b5eb12acfbbd78 (diff)
tdf#93325 ImplAnimView: handle rendercontext
Stop accessing mpOut directly, always go via an explicit vcl::RenderContext. Change-Id: I742b63e0db529d1829d2339c213a0b900f727728
-rw-r--r--vcl/source/gdi/impanmvw.cxx26
1 files changed, 14 insertions, 12 deletions
diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx
index 2176ee562ab3..4794cd47b0ea 100644
--- a/vcl/source/gdi/impanmvw.cxx
+++ b/vcl/source/gdi/impanmvw.cxx
@@ -153,8 +153,9 @@ void ImplAnimView::getPosSize( const AnimationBitmap& rAnm, Point& rPosPix, Size
void ImplAnimView::drawToPos( sal_uLong nPos )
{
+ VclPtr<vcl::RenderContext> pRenderContext = mpOut;
ScopedVclPtrInstance<VirtualDevice> aVDev;
- std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL);
+ std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : NULL);
aVDev->SetOutputSizePixel( maSzPix, false );
nPos = std::min( nPos, (sal_uLong) mpParent->Count() - 1UL );
@@ -163,17 +164,18 @@ void ImplAnimView::drawToPos( sal_uLong nPos )
draw( i, aVDev.get() );
if (xOldClip)
- mpOut->SetClipRegion( maClip );
+ pRenderContext->SetClipRegion( maClip );
- mpOut->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *aVDev.get() );
+ pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *aVDev.get() );
if (xOldClip)
- mpOut->SetClipRegion(*xOldClip);
+ pRenderContext->SetClipRegion(*xOldClip);
}
void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
{
- Rectangle aOutRect( mpOut->PixelToLogic( Point() ), mpOut->GetOutputSize() );
+ VclPtr<vcl::RenderContext> pRenderContext = mpOut;
+ Rectangle aOutRect( pRenderContext->PixelToLogic( Point() ), pRenderContext->GetOutputSize() );
// check, if output lies out of display
if( aOutRect.Intersection( Rectangle( maDispPt, maDispSz ) ).IsEmpty() )
@@ -219,7 +221,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
{
pDev = VclPtr<VirtualDevice>::Create();
pDev->SetOutputSizePixel( maSzPix, false );
- pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *mpOut );
+ pDev->DrawOutDev( Point(), maSzPix, maDispPt, maDispSz, *pRenderContext );
}
else
pDev = pVDev;
@@ -260,23 +262,23 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev )
if( !pVDev )
{
- std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( mpOut->GetClipRegion() ) : NULL);
+ std::unique_ptr<vcl::Region> xOldClip(!maClip.IsNull() ? new vcl::Region( pRenderContext->GetClipRegion() ) : NULL);
if (xOldClip)
- mpOut->SetClipRegion( maClip );
+ pRenderContext->SetClipRegion( maClip );
- mpOut->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *pDev );
+ pRenderContext->DrawOutDev( maDispPt, maDispSz, Point(), maSzPix, *pDev );
if( xOldClip)
{
- mpOut->SetClipRegion(*xOldClip);
+ pRenderContext->SetClipRegion(*xOldClip);
xOldClip.reset();
}
pDev.disposeAndClear();
- if( mpOut->GetOutDevType() == OUTDEV_WINDOW )
- static_cast<vcl::Window*>( mpOut.get() )->Sync();
+ if( pRenderContext->GetOutDevType() == OUTDEV_WINDOW )
+ static_cast<vcl::Window*>( pRenderContext.get() )->Sync();
}
}
}