Kaydet (Commit) 131d5b01 authored tarafından Miklos Vajna's avatar Miklos Vajna

tdf#93325 ImplAnimView: handle rendercontext

Stop accessing mpOut directly, always go via an explicit
vcl::RenderContext.

Change-Id: I742b63e0db529d1829d2339c213a0b900f727728
üst 711b34d5
......@@ -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();
}
}
}
......
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