diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-01-18 18:27:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-05-17 12:56:51 +0200 |
commit | 9090dc1f3b27195f5defd35586ac79357992be21 (patch) | |
tree | d39f4b624ae337d5c9ce76eba8521b76e53afa05 /vcl/source/gdi | |
parent | c8cf2e0e088b74afa52564945a9c005b3b86bf7e (diff) |
split OutputDevice from Window
as part of a longer-term goal of doing our
widget rendering only inside a top-level render-
context.
I moved all of the OutputDevice-related code that existed in vcl::Window
into a new subclass of OutputDevice called WindowOutputDevice.
Notes for further work
(*) not sure why we are getting an 1x1 surface in
SvpSalGraphics::releaseCairoContext, but to fix it I clamp
the size there
(*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice
(*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code?
Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 6 | ||||
-rw-r--r-- | vcl/source/gdi/impanmvw.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/virdev.cxx | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index a31f8e768ece..fd7e13bc30df 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -374,7 +374,7 @@ void GDIMetaFile::Play( OutputDevice* pOut, size_t nPos ) // flush output from time to time if( i++ > nSyncCount ) { - static_cast<vcl::Window*>( pOut )->Flush(); + pOut->Flush(); i = 0; } } @@ -392,7 +392,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S Size rDestSize( pOut->LogicToPixel( rLogicDestSize ) ); - const vcl::Window* win = dynamic_cast <vcl::Window*> ( pOut ); + const vcl::Window* win = pOut ? pOut->GetOwnerWindow() : nullptr; if (!win) win = Application::GetActiveTopWindow(); @@ -404,7 +404,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S try { - uno::Reference<rendering::XCanvas> xCanvas = win->GetCanvas (); + uno::Reference<rendering::XCanvas> xCanvas = win->GetOutDev()->GetCanvas (); if (!xCanvas.is()) return false; diff --git a/vcl/source/gdi/impanmvw.cxx b/vcl/source/gdi/impanmvw.cxx index 0091f6878182..b7329c073ef1 100644 --- a/vcl/source/gdi/impanmvw.cxx +++ b/vcl/source/gdi/impanmvw.cxx @@ -145,7 +145,7 @@ void ImplAnimView::drawToPos( sal_uLong nPos ) vcl::PaintBufferGuardPtr pGuard; if (mpRenderContext->GetOutDevType() == OUTDEV_WINDOW) { - vcl::Window* pWindow = static_cast<vcl::Window*>(mpRenderContext.get()); + vcl::Window* pWindow = static_cast<vcl::WindowOutputDevice*>(mpRenderContext.get())->GetOwnerWindow(); pGuard.reset(new vcl::PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow)); pRenderContext = pGuard->GetRenderContext(); } @@ -177,7 +177,7 @@ void ImplAnimView::draw( sal_uLong nPos, VirtualDevice* pVDev ) vcl::PaintBufferGuardPtr pGuard; if (!pVDev && mpRenderContext->GetOutDevType() == OUTDEV_WINDOW) { - vcl::Window* pWindow = static_cast<vcl::Window*>(mpRenderContext.get()); + vcl::Window* pWindow = static_cast<vcl::WindowOutputDevice*>(mpRenderContext.get())->GetOwnerWindow(); pGuard.reset(new vcl::PaintBufferGuard(pWindow->ImplGetWindowImpl()->mpFrameData, pWindow)); pRenderContext = pGuard->GetRenderContext(); } diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index 35d7088fee7e..f6b7d443b307 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -137,7 +137,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev, ImplSVData* pSVData = ImplGetSVData(); if ( !pOutDev ) - pOutDev = ImplGetDefaultWindow(); + pOutDev = ImplGetDefaultWindow()->GetOutDev(); if( !pOutDev ) return; |