summaryrefslogtreecommitdiff
path: root/vcl/source/app
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-07-22 14:44:39 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-07-22 20:47:19 +0200
commit40251f0e73d2cb700313395dcf49c43a9c1e8570 (patch)
treeb77051cdd26db573ac3dfdbb7ae44d890ef991a2 /vcl/source/app
parent376cd186eee775c71912c5427278bf4943a88b08 (diff)
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 <caolanm@redhat.com>
Diffstat (limited to 'vcl/source/app')
-rw-r--r--vcl/source/app/salvtables.cxx35
1 files changed, 29 insertions, 6 deletions
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);
}