summaryrefslogtreecommitdiff
path: root/sc/qa/unit/tiledrendering
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2019-09-21 15:48:44 +0200
committerTamás Zolnai <tamas.zolnai@collabora.com>2019-09-25 12:32:53 +0200
commite740aaf876edd58c1f5c5e17af2495cad36cfc27 (patch)
tree52fa6abfd4060361fc3636835a88e16812a5b99e /sc/qa/unit/tiledrendering
parent9c975823b82e6b64c3dff0b4347162e8d426b852 (diff)
sc lok: Optimize invalidation triggered by getRowColumnHeaders() method
Don't call a full invalidation, rather use invalidation only on the new area. Make sure that the invalidation is called first. Change-Id: I89d1c6342ed8e95fe738a876a76ca6feda031962 Reviewed-on: https://gerrit.libreoffice.org/79494 Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com> Tested-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sc/qa/unit/tiledrendering')
-rw-r--r--sc/qa/unit/tiledrendering/tiledrendering.cxx15
1 files changed, 6 insertions, 9 deletions
diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx
index a22cca344966..35e61c791db6 100644
--- a/sc/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx
@@ -1761,9 +1761,8 @@ void ScTiledRenderingTest::testGetRowColumnHeadersInvalidation()
pModelObj->getRowColumnHeaders(tools::Rectangle(0, 15, 19650, 5400));
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
- CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size());
- CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
- CPPUNIT_ASSERT_EQUAL(tools::Rectangle(26775, 0, 49725, 13005), aView1.m_aInvalidations[1]);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidations.size());
+ CPPUNIT_ASSERT_EQUAL(tools::Rectangle(26775, 0, 49725, 13005), aView1.m_aInvalidations[0]);
// Extend area top-to-bottom
aView1.m_bInvalidateTiles = false;
@@ -1771,9 +1770,8 @@ void ScTiledRenderingTest::testGetRowColumnHeadersInvalidation()
pModelObj->getRowColumnHeaders(tools::Rectangle(0, 5400, 19650, 9800));
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
- CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size());
- CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
- CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 13005, 49725, 19380), aView1.m_aInvalidations[1]);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidations.size());
+ CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 13005, 49725, 19380), aView1.m_aInvalidations[0]);
// Extend area left-to-right
aView1.m_bInvalidateTiles = false;
@@ -1781,9 +1779,8 @@ void ScTiledRenderingTest::testGetRowColumnHeadersInvalidation()
pModelObj->getRowColumnHeaders(tools::Rectangle(5400, 5400, 25050, 9800));
Scheduler::ProcessEventsToIdle();
CPPUNIT_ASSERT(aView1.m_bInvalidateTiles);
- CPPUNIT_ASSERT_EQUAL(size_t(2), aView1.m_aInvalidations.size());
- CPPUNIT_ASSERT_EQUAL(tools::Rectangle(0, 0, 1000000000, 1000000000), aView1.m_aInvalidations[0]);
- CPPUNIT_ASSERT_EQUAL(tools::Rectangle(49725, 0, 75225, 19380), aView1.m_aInvalidations[1]);
+ CPPUNIT_ASSERT_EQUAL(size_t(1), aView1.m_aInvalidations.size());
+ CPPUNIT_ASSERT_EQUAL(tools::Rectangle(49725, 0, 75225, 19380), aView1.m_aInvalidations[0]);
}
}