diff options
Diffstat (limited to 'canvas')
-rw-r--r-- | canvas/source/cairo/cairo_canvas.cxx | 2 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_spritecanvas.cxx | 2 | ||||
-rw-r--r-- | canvas/source/cairo/cairo_spritedevicehelper.cxx | 2 | ||||
-rw-r--r-- | canvas/source/directx/dx_canvas.cxx | 1 | ||||
-rw-r--r-- | canvas/source/vcl/canvas.cxx | 1 | ||||
-rw-r--r-- | canvas/source/vcl/outdevholder.hxx | 1 | ||||
-rw-r--r-- | canvas/source/vcl/spritecanvashelper.cxx | 4 | ||||
-rw-r--r-- | canvas/source/vcl/windowoutdevholder.hxx | 4 | ||||
-rw-r--r-- | canvas/workben/canvasdemo.cxx | 4 |
9 files changed, 12 insertions, 9 deletions
diff --git a/canvas/source/cairo/cairo_canvas.cxx b/canvas/source/cairo/cairo_canvas.cxx index 10edc0681843..5b727905673a 100644 --- a/canvas/source/cairo/cairo_canvas.cxx +++ b/canvas/source/cairo/cairo_canvas.cxx @@ -26,6 +26,7 @@ #include <tools/diagnose_ex.h> #include <vcl/sysdata.hxx> #include <vcl/skia/SkiaHelper.hxx> +#include <vcl/window.hxx> #include <cppuhelper/supportsservice.hxx> #include "cairo_canvas.hxx" @@ -68,7 +69,6 @@ namespace cairocanvas sal_Int64 nPtr = 0; maArguments[0] >>= nPtr; OutputDevice* pOutDev = reinterpret_cast<OutputDevice*>(nPtr); - ENSURE_ARG_OR_THROW( pOutDev != nullptr, "Canvas::initialize: invalid OutDev pointer" ); diff --git a/canvas/source/cairo/cairo_spritecanvas.cxx b/canvas/source/cairo/cairo_spritecanvas.cxx index 91ac7c376b4d..562157f52c60 100644 --- a/canvas/source/cairo/cairo_spritecanvas.cxx +++ b/canvas/source/cairo/cairo_spritecanvas.cxx @@ -77,7 +77,7 @@ namespace cairocanvas throw lang::NoSupportException( "Parent window not VCL window, or canvas out-of-process!", nullptr); - bool bHasCairo = pParentWindow->SupportsCairo(); + bool bHasCairo = pParentWindow->GetOutDev()->SupportsCairo(); ENSURE_ARG_OR_THROW(bHasCairo, "CairoSpriteCanvas::SpriteCanvas: No Cairo capability"); diff --git a/canvas/source/cairo/cairo_spritedevicehelper.cxx b/canvas/source/cairo/cairo_spritedevicehelper.cxx index 825d6f343b43..f2d018937be2 100644 --- a/canvas/source/cairo/cairo_spritedevicehelper.cxx +++ b/canvas/source/cairo/cairo_spritedevicehelper.cxx @@ -46,7 +46,7 @@ namespace cairocanvas bool bFullscreen ) { DeviceHelper::init(rSpriteCanvas, - rOutputWindow); + *rOutputWindow.GetOutDev()); mpSpriteCanvas = &rSpriteCanvas; mbFullScreen = bFullscreen; diff --git a/canvas/source/directx/dx_canvas.cxx b/canvas/source/directx/dx_canvas.cxx index 3d5bda00288b..7f29813c953b 100644 --- a/canvas/source/directx/dx_canvas.cxx +++ b/canvas/source/directx/dx_canvas.cxx @@ -39,6 +39,7 @@ #include <tools/diagnose_ex.h> #include <vcl/sysdata.hxx> #include <vcl/skia/SkiaHelper.hxx> +#include <vcl/window.hxx> #include <canvas/canvastools.hxx> diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index e9ebf85b3b3a..2ad0a61fc9fd 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -25,6 +25,7 @@ #include <sal/log.hxx> #include <tools/diagnose_ex.h> #include <vcl/outdev.hxx> +#include <vcl/window.hxx> #include "outdevholder.hxx" diff --git a/canvas/source/vcl/outdevholder.hxx b/canvas/source/vcl/outdevholder.hxx index 78f3badf8bb6..28dfd4317fe0 100644 --- a/canvas/source/vcl/outdevholder.hxx +++ b/canvas/source/vcl/outdevholder.hxx @@ -35,6 +35,7 @@ public: explicit OutDevHolder(OutputDevice& rOutDev) : mrOutDev(rOutDev) { + assert(&rOutDev); } private: diff --git a/canvas/source/vcl/spritecanvashelper.cxx b/canvas/source/vcl/spritecanvashelper.cxx index 0c1a454c3260..1796c8ac7ffe 100644 --- a/canvas/source/vcl/spritecanvashelper.cxx +++ b/canvas/source/vcl/spritecanvashelper.cxx @@ -220,7 +220,7 @@ namespace vclcanvas vcl::Window* pTargetWindow = nullptr; if( rOutDev.GetOutDevType() == OUTDEV_WINDOW ) { - pTargetWindow = &static_cast<vcl::Window&>(rOutDev); // TODO(Q3): Evil downcast. + pTargetWindow = rOutDev.GetOwnerWindow(); // TODO(Q3): Evil downcast. // we're double-buffered, thus no need for paint area-limiting // clips. besides that, will interfere with animations (as for @@ -309,7 +309,7 @@ namespace vclcanvas if( pTargetWindow ) { // commit to screen - pTargetWindow->Flush(); + pTargetWindow->GetOutDev()->Flush(); } return true; diff --git a/canvas/source/vcl/windowoutdevholder.hxx b/canvas/source/vcl/windowoutdevholder.hxx index d9d69e9a37c9..87138a8a9106 100644 --- a/canvas/source/vcl/windowoutdevholder.hxx +++ b/canvas/source/vcl/windowoutdevholder.hxx @@ -36,8 +36,8 @@ namespace vclcanvas explicit WindowOutDevHolder( const css::uno::Reference< css::awt::XWindow>& xWin ); private: - virtual OutputDevice& getOutDev() override { return mrOutputWindow; } - virtual const OutputDevice& getOutDev() const override { return mrOutputWindow; } + virtual OutputDevice& getOutDev() override { return *mrOutputWindow.GetOutDev(); } + virtual const OutputDevice& getOutDev() const override { return *mrOutputWindow.GetOutDev(); } // TODO(Q2): Lifetime issue. Though WindowGraphicDeviceBase // now listens to the window component, I still consider diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx index e19e1f45f2af..9d48b84132d6 100644 --- a/canvas/workben/canvasdemo.cxx +++ b/canvas/workben/canvasdemo.cxx @@ -536,7 +536,7 @@ void TestWindow::Paint(vcl::RenderContext&, const tools::Rectangle&) { try { - uno::Reference< rendering::XCanvas > xVDevCanvas( GetCanvas(), + uno::Reference< rendering::XCanvas > xVDevCanvas( GetOutDev()->GetCanvas(), uno::UNO_SET_THROW ); uno::Reference< rendering::XGraphicDevice > xVDevDevice( xVDevCanvas->getDevice(), uno::UNO_SET_THROW ); @@ -551,7 +551,7 @@ void TestWindow::Paint(vcl::RenderContext&, const tools::Rectangle&) aVDevRenderer.drawArcs(); aVDevRenderer.drawPolygons(); - uno::Reference< rendering::XCanvas > xCanvas( GetSpriteCanvas(), + uno::Reference< rendering::XCanvas > xCanvas( GetOutDev()->GetSpriteCanvas(), uno::UNO_QUERY_THROW ); uno::Reference< rendering::XGraphicDevice > xDevice( xCanvas->getDevice(), uno::UNO_SET_THROW ); |