vcl/source/window/bufferdevice.cxx | 10 +++++++++- vcl/source/window/bufferdevice.hxx | 2 ++ vcl/source/window/menufloatingwindow.cxx | 11 +++++++---- 3 files changed, 18 insertions(+), 5 deletions(-)
New commits: commit 60400ca7e60bc9314ceda13e0d74b32b7481f020 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Thu May 7 15:38:49 2020 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Sat May 9 22:20:44 2020 +0200 tdf#132267 vcl: fix missing scrollers with non-native rendering Regression from c04169c586ef1d55b1d0ac469bb4fbd4f50bd08a (tdf#125415 vcl menu floating window: avoid flicker, 2019-05-21) the problem was that the clip region was set on the buffer, not on the render context. This means the original clip was used to determine what gets copied from the buffer to the screen, so the scroller arrows were not rendered. (cherry picked from commit a65ec136fbd0dae889b20fba657b40af467fcb27) Change-Id: Id173e6333721891798da58baf2092f4cd21a62ba Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93780 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/window/bufferdevice.cxx b/vcl/source/window/bufferdevice.cxx index 0092d1ab97e4..188fbb1acc1c 100644 --- a/vcl/source/window/bufferdevice.cxx +++ b/vcl/source/window/bufferdevice.cxx @@ -23,12 +23,20 @@ BufferDevice::BufferDevice(const VclPtr<vcl::Window>& pWindow, vcl::RenderContex m_pBuffer->EnableRTL(rRenderContext.IsRTLEnabled()); } -BufferDevice::~BufferDevice() +void BufferDevice::Dispose() { + if (m_bDisposed) + { + return; + } + m_rRenderContext.DrawOutDev(Point(0, 0), m_pWindow->GetOutputSizePixel(), Point(0, 0), m_pWindow->GetOutputSizePixel(), *m_pBuffer); + m_bDisposed = true; } +BufferDevice::~BufferDevice() { Dispose(); } + vcl::RenderContext* BufferDevice::operator->() { return m_pBuffer.get(); } vcl::RenderContext& BufferDevice::operator*() { return *m_pBuffer; } diff --git a/vcl/source/window/bufferdevice.hxx b/vcl/source/window/bufferdevice.hxx index 5f2471cd26d9..f785b6bdcbee 100644 --- a/vcl/source/window/bufferdevice.hxx +++ b/vcl/source/window/bufferdevice.hxx @@ -21,10 +21,12 @@ class VCL_DLLPUBLIC BufferDevice ScopedVclPtr<VirtualDevice> m_pBuffer; VclPtr<vcl::Window> m_pWindow; vcl::RenderContext& m_rRenderContext; + bool m_bDisposed = false; public: BufferDevice(const VclPtr<vcl::Window>& pWindow, vcl::RenderContext& rRenderContext); ~BufferDevice(); + void Dispose(); vcl::RenderContext* operator->(); vcl::RenderContext& operator*(); diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index b14329f7503c..bfb8831e8d5a 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -1205,12 +1205,14 @@ void MenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const tools:: if (!pMenu) return; + // Set the clip before the buffering starts: rPaintRect may be larger than the current clip, + // this way the buffer -> render context copy happens with this clip. + rRenderContext.Push(PushFlags::CLIPREGION); + rRenderContext.SetClipRegion(vcl::Region(rPaintRect)); + // Make sure that all actual rendering happens in one go to avoid flicker. vcl::BufferDevice pBuffer(this, rRenderContext); - pBuffer->Push(PushFlags::CLIPREGION); - pBuffer->SetClipRegion(vcl::Region(rPaintRect)); - if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup, ControlPart::Entire)) { pBuffer->SetClipRegion(); @@ -1233,7 +1235,8 @@ void MenuFloatingWindow::Paint(vcl::RenderContext& rRenderContext, const tools:: if (nHighlightedItem != ITEMPOS_INVALID) RenderHighlightItem(*pBuffer, nHighlightedItem); - pBuffer->Pop(); + pBuffer.Dispose(); + rRenderContext.Pop(); } void MenuFloatingWindow::ImplDrawScroller(vcl::RenderContext& rRenderContext, bool bUp) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits