Kaydet (Commit) 810e1a86 authored tarafından Caolán McNamara's avatar Caolán McNamara

there's already a way to customize the invalidation

Change-Id: I486494de730b8665e56cfc664b62830fb0b8b8ee
Reviewed-on: https://gerrit.libreoffice.org/72415
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst b5bc0d40
...@@ -264,7 +264,8 @@ public: ...@@ -264,7 +264,8 @@ public:
// override these so we can get the occasions SdrPaintView would call Window::Invalidate on its vcl::Window // override these so we can get the occasions SdrPaintView would call Window::Invalidate on its vcl::Window
// if it had one, and route to WidgetController::Invalidate instead // if it had one, and route to WidgetController::Invalidate instead
virtual rtl::Reference<sdr::overlay::OverlayManager> CreateOverlayManager(OutputDevice& rDevice) const override; virtual rtl::Reference<sdr::overlay::OverlayManager> CreateOverlayManager(OutputDevice& rDevice) const override;
virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const override; virtual void InvalidateOneWin(OutputDevice& rWin) override;
virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect) override;
}; };
#endif // INCLUDED_SVX_GRAPHCTL_HXX #endif // INCLUDED_SVX_GRAPHCTL_HXX
......
...@@ -238,7 +238,6 @@ public: ...@@ -238,7 +238,6 @@ public:
SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const; SdrPaintWindow* GetPaintWindow(sal_uInt32 nIndex) const;
// Replacement for GetWin(0), may return 0L (!) // Replacement for GetWin(0), may return 0L (!)
OutputDevice* GetFirstOutputDevice() const; OutputDevice* GetFirstOutputDevice() const;
virtual void InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const;
private: private:
SVX_DLLPRIVATE void ImpClearVars(); SVX_DLLPRIVATE void ImpClearVars();
...@@ -432,8 +431,8 @@ public: ...@@ -432,8 +431,8 @@ public:
/// If the View should not call Invalidate() on the windows, override /// If the View should not call Invalidate() on the windows, override
/// the following 2 methods and do something else. /// the following 2 methods and do something else.
virtual void InvalidateOneWin(vcl::Window& rWin); virtual void InvalidateOneWin(OutputDevice& rWin);
virtual void InvalidateOneWin(vcl::Window& rWin, const tools::Rectangle& rRect); virtual void InvalidateOneWin(OutputDevice& rWin, const tools::Rectangle& rRect);
void SetActiveLayer(const OUString& rName) { maActualLayer=rName; } void SetActiveLayer(const OUString& rName) { maActualLayer=rName; }
const OUString& GetActiveLayer() const { return maActualLayer; } const OUString& GetActiveLayer() const { return maActualLayer; }
......
...@@ -38,8 +38,8 @@ public: ...@@ -38,8 +38,8 @@ public:
/* if the view should not do a Invalidate() on the windows, you have to /* if the view should not do a Invalidate() on the windows, you have to
override the following two methods and do something different */ override the following two methods and do something different */
virtual void InvalidateOneWin(vcl::Window& rWin) override; virtual void InvalidateOneWin(OutputDevice& rWin) override;
virtual void InvalidateOneWin(vcl::Window& rWin, const ::tools::Rectangle& rRect) override; virtual void InvalidateOneWin(OutputDevice& rWin, const ::tools::Rectangle& rRect) override;
}; };
} // end of namespace sd } // end of namespace sd
......
...@@ -48,7 +48,7 @@ ClientView::~ClientView() ...@@ -48,7 +48,7 @@ ClientView::~ClientView()
* to be overridden and properly handled. * to be overridden and properly handled.
*/ */
void ClientView::InvalidateOneWin(vcl::Window& rWin) void ClientView::InvalidateOneWin(OutputDevice& rWin)
{ {
vcl::Region aRegion; vcl::Region aRegion;
CompleteRedraw(&rWin, aRegion); CompleteRedraw(&rWin, aRegion);
...@@ -59,7 +59,7 @@ void ClientView::InvalidateOneWin(vcl::Window& rWin) ...@@ -59,7 +59,7 @@ void ClientView::InvalidateOneWin(vcl::Window& rWin)
* to be overridden and properly handled. * to be overridden and properly handled.
*/ */
void ClientView::InvalidateOneWin(vcl::Window& rWin, const ::tools::Rectangle& rRect) void ClientView::InvalidateOneWin(OutputDevice& rWin, const ::tools::Rectangle& rRect)
{ {
CompleteRedraw(&rWin, vcl::Region(rRect)); CompleteRedraw(&rWin, vcl::Region(rRect));
} }
......
...@@ -1494,7 +1494,18 @@ rtl::Reference<sdr::overlay::OverlayManager> SvxGraphCtrlView::CreateOverlayMana ...@@ -1494,7 +1494,18 @@ rtl::Reference<sdr::overlay::OverlayManager> SvxGraphCtrlView::CreateOverlayMana
return SdrView::CreateOverlayManager(rDevice); return SdrView::CreateOverlayManager(rDevice);
} }
void SvxGraphCtrlView::InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const void SvxGraphCtrlView::InvalidateOneWin(OutputDevice& rDevice)
{
assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
{
rGraphCtrl.Invalidate();
return;
}
SdrView::InvalidateOneWin(rDevice);
}
void SvxGraphCtrlView::InvalidateOneWin(OutputDevice& rDevice, const tools::Rectangle& rArea)
{ {
assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device()); assert(&rDevice == &rGraphCtrl.GetDrawingArea()->get_ref_device());
if (rDevice.GetOutDevType() == OUTDEV_VIRDEV) if (rDevice.GetOutDevType() == OUTDEV_VIRDEV)
...@@ -1502,7 +1513,7 @@ void SvxGraphCtrlView::InvalidateWindow(const tools::Rectangle& rArea, OutputDev ...@@ -1502,7 +1513,7 @@ void SvxGraphCtrlView::InvalidateWindow(const tools::Rectangle& rArea, OutputDev
rGraphCtrl.Invalidate(rArea); rGraphCtrl.Invalidate(rArea);
return; return;
} }
SdrView::InvalidateWindow(rArea, rDevice); SdrView::InvalidateOneWin(rDevice, rArea);
} }
Point SvxGraphCtrl::GetPositionInDialog() const Point SvxGraphCtrl::GetPositionInDialog() const
......
...@@ -432,7 +432,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) ...@@ -432,7 +432,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange)
const bool bWasMapModeEnabled(rWindow.IsMapModeEnabled()); const bool bWasMapModeEnabled(rWindow.IsMapModeEnabled());
rWindow.EnableMapMode(false); rWindow.EnableMapMode(false);
GetPageView().GetView().InvalidateWindow(aVCLDiscreteRectangle, rWindow); GetPageView().GetView().InvalidateOneWin(rWindow, aVCLDiscreteRectangle);
rWindow.EnableMapMode(bWasMapModeEnabled); rWindow.EnableMapMode(bWasMapModeEnabled);
} }
else if (comphelper::LibreOfficeKit::isActive()) else if (comphelper::LibreOfficeKit::isActive())
......
...@@ -225,12 +225,6 @@ rtl::Reference<sdr::overlay::OverlayManager> SdrPaintView::CreateOverlayManager( ...@@ -225,12 +225,6 @@ rtl::Reference<sdr::overlay::OverlayManager> SdrPaintView::CreateOverlayManager(
return xOverlayManager; return xOverlayManager;
} }
void SdrPaintView::InvalidateWindow(const tools::Rectangle& rArea, OutputDevice& rDevice) const
{
vcl::Window& rWindow(static_cast<vcl::Window&>(rDevice));
rWindow.Invalidate(rArea, InvalidateFlags::NoErase);
}
void SdrPaintWindow::impCreateOverlayManager() void SdrPaintWindow::impCreateOverlayManager()
{ {
// not yet one created? // not yet one created?
......
...@@ -670,7 +670,7 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const ...@@ -670,7 +670,7 @@ void SdrPageView::ImpInvalidateHelpLineArea(sal_uInt16 nNum) const
aR.AdjustRight(aSiz.Width() ); aR.AdjustRight(aSiz.Width() );
aR.AdjustTop( -(aSiz.Height()) ); aR.AdjustTop( -(aSiz.Height()) );
aR.AdjustBottom(aSiz.Height() ); aR.AdjustBottom(aSiz.Height() );
const_cast<SdrView&>(GetView()).InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aR); const_cast<SdrView&>(GetView()).InvalidateOneWin(rOutDev, aR);
} }
} }
} }
......
...@@ -859,7 +859,7 @@ void SdrPaintView::InvalidateAllWin() ...@@ -859,7 +859,7 @@ void SdrPaintView::InvalidateAllWin()
if(pPaintWindow->OutputToWindow()) if(pPaintWindow->OutputToWindow())
{ {
InvalidateOneWin(static_cast<vcl::Window&>(pPaintWindow->GetOutputDevice())); InvalidateOneWin(pPaintWindow->GetOutputDevice());
} }
} }
} }
...@@ -884,20 +884,22 @@ void SdrPaintView::InvalidateAllWin(const tools::Rectangle& rRect) ...@@ -884,20 +884,22 @@ void SdrPaintView::InvalidateAllWin(const tools::Rectangle& rRect)
// In case of tiled rendering we want to get all invalidations, so visual area is not interesting. // In case of tiled rendering we want to get all invalidations, so visual area is not interesting.
if (aRect.IsOver(aOutRect) || comphelper::LibreOfficeKit::isActive()) if (aRect.IsOver(aOutRect) || comphelper::LibreOfficeKit::isActive())
{ {
InvalidateOneWin(static_cast<vcl::Window&>(rOutDev), aRect); InvalidateOneWin(rOutDev, aRect);
} }
} }
} }
} }
void SdrPaintView::InvalidateOneWin(vcl::Window& rWin) void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice)
{ {
vcl::Window& rWin(static_cast<vcl::Window&>(rDevice));
// do not erase background, that causes flicker (!) // do not erase background, that causes flicker (!)
rWin.Invalidate(InvalidateFlags::NoErase); rWin.Invalidate(InvalidateFlags::NoErase);
} }
void SdrPaintView::InvalidateOneWin(vcl::Window& rWin, const tools::Rectangle& rRect) void SdrPaintView::InvalidateOneWin(OutputDevice& rDevice, const tools::Rectangle& rRect)
{ {
vcl::Window& rWin(static_cast<vcl::Window&>(rDevice));
// do not erase background, that causes flicker (!) // do not erase background, that causes flicker (!)
rWin.Invalidate(rRect, InvalidateFlags::NoErase); rWin.Invalidate(rRect, InvalidateFlags::NoErase);
} }
......
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