vcl/source/app/salvtables.cxx | 35 +++++++++++++++++++++++++++++------ vcl/unx/gtk3/gtk3gtkinst.cxx | 2 ++ 2 files changed, 31 insertions(+), 6 deletions(-)
New commits: commit 40251f0e73d2cb700313395dcf49c43a9c1e8570 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Wed Jul 22 14:44:39 2020 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Wed Jul 22 20:47:19 2020 +0200 avoid intermediate bitmap causing blurring and use incoming device as background Change-Id: I13eea4148527fa2c3552db12555ca1ca005d7799 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/99232 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 9765711e3869..699c06287e05 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -1134,15 +1134,38 @@ std::unique_ptr<weld::Container> SalInstanceWidget::weld_parent() const return std::make_unique<SalInstanceContainer>(pParent, m_pBuilder, false); } +namespace +{ + void DoRecursivePaint(vcl::Window* pWindow, const Point& rPos, OutputDevice& rOutput) + { + Size aSize = pWindow->GetSizePixel(); + + VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); + xOutput->SetOutputSizePixel(aSize); + xOutput->DrawOutDev(Point(), aSize, rPos, aSize, rOutput); + + pWindow->Paint(*xOutput, tools::Rectangle(Point(), aSize)); + + rOutput.DrawOutDev(rPos, aSize, Point(), aSize, *xOutput); + + xOutput.disposeAndClear(); + + for (vcl::Window *pChild = pWindow->GetWindow(GetWindowType::FirstChild); pChild; pChild = pChild->GetWindow(GetWindowType::Next)) + { + if (!pChild->IsVisible()) + continue; + DoRecursivePaint(pChild, rPos + pChild->GetPosPixel(), rOutput); + } + } +} + void SalInstanceWidget::draw(OutputDevice& rOutput, const tools::Rectangle& rRect) { Size aOrigSize(m_xWidget->GetSizePixel()); - Size aSize = rRect.GetSize(); - m_xWidget->SetSizePixel(aSize); - rOutput.Push(PushFlags::CLIPREGION); - rOutput.IntersectClipRegion(rRect); - m_xWidget->PaintToDevice(&rOutput, rRect.TopLeft()); - rOutput.Pop(); + + m_xWidget->SetSizePixel(rRect.GetSize()); + DoRecursivePaint(m_xWidget, rRect.TopLeft(), rOutput); + m_xWidget->SetSizePixel(aOrigSize); } diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index faa07934e57e..8d6c2b1e345b 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -3079,6 +3079,8 @@ public: VclPtr<VirtualDevice> xOutput(VclPtr<VirtualDevice>::Create(DeviceFormat::DEFAULT)); xOutput->SetOutputSizePixel(aSize); + xOutput->DrawOutDev(Point(), aSize, rRect.TopLeft(), aSize, rOutput); + cairo_surface_t* pSurface = get_underlying_cairo_surface(*xOutput); cairo_t* cr = cairo_create(pSurface); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits