summaryrefslogtreecommitdiff
path: root/vcl/qa
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-01-18 18:27:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-05-17 12:56:51 +0200
commit9090dc1f3b27195f5defd35586ac79357992be21 (patch)
treed39f4b624ae337d5c9ce76eba8521b76e53afa05 /vcl/qa
parentc8cf2e0e088b74afa52564945a9c005b3b86bf7e (diff)
split OutputDevice from Window
as part of a longer-term goal of doing our widget rendering only inside a top-level render- context. I moved all of the OutputDevice-related code that existed in vcl::Window into a new subclass of OutputDevice called WindowOutputDevice. Notes for further work (*) not sure why we are getting an 1x1 surface in SvpSalGraphics::releaseCairoContext, but to fix it I clamp the size there (*) might have to dump VCLXDevice, and move it's code down into VCLXWindow and VCLXVirtualDevice (*) can we remove use of VCLXDevice in other places, in favour of just talking to the VCL code? Change-Id: I105946377f5322677d6f7d0c1c23847178a720b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113204 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/qa')
-rw-r--r--vcl/qa/cppunit/complextext.cxx4
-rw-r--r--vcl/qa/cppunit/outdev.cxx11
2 files changed, 9 insertions, 6 deletions
diff --git a/vcl/qa/cppunit/complextext.cxx b/vcl/qa/cppunit/complextext.cxx
index f37324ab05e4..558a80d7cd46 100644
--- a/vcl/qa/cppunit/complextext.cxx
+++ b/vcl/qa/cppunit/complextext.cxx
@@ -67,7 +67,7 @@ void VclComplexTextTest::testArabic()
vcl::Font aFont("DejaVu Sans", "Book", Size(0, 12));
- OutputDevice *pOutDev = pWin.get();
+ OutputDevice *pOutDev = pWin->GetOutDev();
pOutDev->SetFont( aFont );
// absolute character widths AKA text array.
@@ -153,7 +153,7 @@ void VclComplexTextTest::testTdf95650()
ScopedVclPtrInstance<WorkWindow> pWin(static_cast<vcl::Window *>(nullptr));
CPPUNIT_ASSERT(pWin);
- OutputDevice *pOutDev = pWin.get();
+ OutputDevice *pOutDev = pWin->GetOutDev();
// Check that the following executes without failing assertion
pOutDev->ImplLayout(aTxt, 9, 1, Point(), 0, nullptr, SalLayoutFlags::BiDiRtl);
}
diff --git a/vcl/qa/cppunit/outdev.cxx b/vcl/qa/cppunit/outdev.cxx
index 6385ec384e60..efb4d402cda4 100644
--- a/vcl/qa/cppunit/outdev.cxx
+++ b/vcl/qa/cppunit/outdev.cxx
@@ -63,9 +63,12 @@ void VclOutdevTest::testGetReadableFontColorPrinter()
void VclOutdevTest::testGetReadableFontColorWindow()
{
ScopedVclPtrInstance<vcl::Window> pWindow(nullptr, WB_APP | WB_STDWORK);
- CPPUNIT_ASSERT_EQUAL(pWindow->GetReadableFontColor(COL_WHITE, COL_BLACK), COL_WHITE);
- CPPUNIT_ASSERT_EQUAL(pWindow->GetReadableFontColor(COL_WHITE, COL_WHITE), COL_BLACK);
- CPPUNIT_ASSERT_EQUAL(pWindow->GetReadableFontColor(COL_BLACK, COL_BLACK), COL_WHITE);
+ CPPUNIT_ASSERT_EQUAL(pWindow->GetOutDev()->GetReadableFontColor(COL_WHITE, COL_BLACK),
+ COL_WHITE);
+ CPPUNIT_ASSERT_EQUAL(pWindow->GetOutDev()->GetReadableFontColor(COL_WHITE, COL_WHITE),
+ COL_BLACK);
+ CPPUNIT_ASSERT_EQUAL(pWindow->GetOutDev()->GetReadableFontColor(COL_BLACK, COL_BLACK),
+ COL_WHITE);
}
void VclOutdevTest::testPrinterBackgroundColor()
@@ -270,7 +273,7 @@ void VclOutdevTest::testRTL()
{
ScopedVclPtrInstance<vcl::Window> pWindow(nullptr, WB_APP | WB_STDWORK);
pWindow->EnableRTL();
- vcl::RenderContext& rRenderContext = *pWindow;
+ vcl::RenderContext& rRenderContext = *pWindow->GetOutDev();
vcl::BufferDevice pBuffer(pWindow, rRenderContext);
// Without the accompanying fix in place, this test would have failed, because the RTL status