diff options
author | Henry Castro <hcastro@collabora.com> | 2024-12-16 07:42:05 -0400 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2024-12-18 05:51:14 +0100 |
commit | 6b0d19814ec72f78d733aa3dfbe89b875f4e96d7 (patch) | |
tree | 25bb47b616f8a556f09719247324a9c6eb06e9bf /sd | |
parent | fa0283b7bafc9172cfbd6d56989da4d9958fd9c3 (diff) |
lokit: add scale parameter to "renderNextSlideLayer"
When client side change the device pixel ratio.
Signed-off-by: Henry Castro <hcastro@collabora.com>
Change-Id: I6356ff2a2e6513ac835b5f02a755173aafe01dc9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178580
Reviewed-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/tiledrendering/tiledrendering.cxx | 144 | ||||
-rw-r--r-- | sd/source/ui/inc/SlideshowLayerRenderer.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/inc/unomodel.hxx | 2 | ||||
-rw-r--r-- | sd/source/ui/tools/SlideshowLayerRenderer.cxx | 16 | ||||
-rw-r--r-- | sd/source/ui/unoidl/unomodel.cxx | 4 |
5 files changed, 110 insertions, 58 deletions
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 0683209e687f..e04340817fea 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -3279,9 +3279,10 @@ public: { std::vector<sal_uInt8> pBuffer(mnViewWidth * mnViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(mnImageFileStep++, pBuffer, mnViewWidth, mnViewHeight, aJson.toUtf8().getStr()); @@ -3303,9 +3304,10 @@ public: std::vector<sal_uInt8> pBuffer(mnViewWidth * mnViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT_MESSAGE( - sMsg, !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + sMsg, !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT_MESSAGE(sMsg, bIsBitmapLayer); debugWriteImageToFile(mnImageFileStep++, pBuffer, mnViewWidth, mnViewHeight, @@ -3343,9 +3345,10 @@ public: std::vector<sal_uInt8> pBuffer(mnViewWidth * mnViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT_MESSAGE( - sMsg, !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + sMsg, !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT_MESSAGE(sMsg, !bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -3370,9 +3373,10 @@ public: std::vector<sal_uInt8> pBuffer(mnViewWidth * mnViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT_MESSAGE( - sMsg, !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + sMsg, !mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT_MESSAGE(sMsg, bIsBitmapLayer); debugWriteImageToFile(mnImageFileStep++, pBuffer, mnViewWidth, mnViewHeight, @@ -3418,9 +3422,10 @@ public: { std::vector<sal_uInt8> pBuffer(mnViewWidth * mnViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + mpXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } }; @@ -3455,8 +3460,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(0, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -3473,8 +3479,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content @@ -3503,8 +3510,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -3533,8 +3541,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering) { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } @@ -3570,8 +3579,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(0, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); boost::property_tree::ptree aTree; @@ -3586,8 +3596,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -3614,8 +3625,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); // TODO - check JSON content debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -3645,8 +3657,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(4, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -3674,9 +3687,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -3691,9 +3705,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -3708,8 +3723,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(5, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -3737,8 +3753,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_WithFie { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } @@ -3934,8 +3951,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(0, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -3957,9 +3975,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -3977,9 +3996,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -3997,9 +4017,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -4017,8 +4038,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4045,8 +4067,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4073,8 +4096,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } @@ -4099,8 +4123,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(0, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4124,9 +4149,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -4144,9 +4170,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -4164,9 +4191,10 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = true; + double dScale = 1.0; OUString aJson; CPPUNIT_ASSERT( - !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + !pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(!bIsBitmapLayer); boost::property_tree::ptree aTree; @@ -4184,8 +4212,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4209,8 +4238,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4238,8 +4268,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4267,8 +4298,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(4, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4292,8 +4324,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(bIsBitmapLayer); debugWriteImageToFile(5, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4321,8 +4354,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } @@ -4350,8 +4384,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(0, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4372,8 +4407,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(21, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4394,8 +4430,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4423,8 +4460,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4452,8 +4490,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(4, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4482,8 +4521,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } @@ -4511,8 +4551,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4533,8 +4574,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4555,8 +4597,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, aJson.toUtf8().getStr()); @@ -4585,8 +4628,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } @@ -4614,8 +4658,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); // Remember the hash of the buffer for uniqueness check auto aBufferHash = comphelper::Hash::calculateHash(pBuffer.data(), pBuffer.size(), comphelper::HashType::SHA1); @@ -4640,8 +4685,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); // Remember the hash of the buffer for uniqueness check auto aBufferHash = comphelper::Hash::calculateHash(pBuffer.data(), pBuffer.size(), comphelper::HashType::SHA1); @@ -4666,8 +4712,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(!pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); // Remember the hash of the buffer for uniqueness check auto aBufferHash = comphelper::Hash::calculateHash(pBuffer.data(), pBuffer.size(), comphelper::HashType::SHA1); @@ -4703,8 +4750,9 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati { std::vector<sal_uInt8> pBuffer(nViewWidth * nViewHeight * 4); bool bIsBitmapLayer = false; + double dScale = 1.0; OUString aJson; - CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, aJson)); + CPPUNIT_ASSERT(pXImpressDocument->renderNextSlideLayer(pBuffer.data(), bIsBitmapLayer, dScale, aJson)); CPPUNIT_ASSERT(aJson.isEmpty()); } diff --git a/sd/source/ui/inc/SlideshowLayerRenderer.hxx b/sd/source/ui/inc/SlideshowLayerRenderer.hxx index 0804dd78edc9..ac2faa645152 100644 --- a/sd/source/ui/inc/SlideshowLayerRenderer.hxx +++ b/sd/source/ui/inc/SlideshowLayerRenderer.hxx @@ -201,7 +201,7 @@ public: * The properties of the layer are written to the input string in JSON format. * * @returns false, if nothing was rendered and rendering is done */ - bool render(unsigned char* pBuffer, bool& bIsBitmapLayer, OString& rJsonMsg); + bool render(unsigned char* pBuffer, bool& bIsBitmapLayer, double& scale, OString& rJsonMsg); }; } // end of namespace sd diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx index 90134c120681..fcf40e94208d 100644 --- a/sd/source/ui/inc/unomodel.hxx +++ b/sd/source/ui/inc/unomodel.hxx @@ -299,7 +299,7 @@ public: /// @see vcl::ITiledRenderable::postSlideshowCleanup(). void postSlideshowCleanup() override; /// @see vcl::ITiledRenderable::renderNextSlideLayer(). - bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, OUString& rJsonMsg) override; + bool renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale, OUString& rJsonMsg) override; // XComponent diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx b/sd/source/ui/tools/SlideshowLayerRenderer.cxx index f447aa84f2c3..9ef86479e508 100644 --- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx +++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx @@ -61,13 +61,16 @@ private: EEControlBits mnSavedControlBits; Color maSavedBackgroundColor; + Fraction maScale; public: ScopedVclPtrInstance<VirtualDevice> maVirtualDevice; - RenderContext(unsigned char* pBuffer, SdrModel& rModel, SdrPage& rPage, Size const& rSlideSize) + RenderContext(unsigned char* pBuffer, SdrModel& rModel, SdrPage& rPage, Size const& rSlideSize, + const Fraction& rScale) : mrModel(rModel) , mrPage(rPage) + , maScale(rScale) , maVirtualDevice(DeviceFormat::WITHOUT_ALPHA) { SdrOutliner& rOutliner = mrModel.GetDrawOutliner(); @@ -82,8 +85,8 @@ public: maVirtualDevice->SetBackground(Wallpaper(COL_TRANSPARENT)); - maVirtualDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(rSlideSize, Fraction(1.0), - Point(), pBuffer); + maVirtualDevice->SetOutputSizePixelScaleOffsetAndLOKBuffer(rSlideSize, maScale, Point(), + pBuffer); Size aPageSize(mrPage.GetSize()); MapMode aMapMode(MapUnit::Map100thMM); @@ -982,11 +985,12 @@ void SlideshowLayerRenderer::writeJSON(OString& rJsonMsg, RenderPass const& rRen maRenderState.incrementIndex(); } -bool SlideshowLayerRenderer::render(unsigned char* pBuffer, bool& bIsBitmapLayer, OString& rJsonMsg) +bool SlideshowLayerRenderer::render(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale, + OString& rJsonMsg) { // We want to render one pass (one iteration through objects) - RenderContext aRenderContext(pBuffer, mrModel, mrPage, maSlideSize); + RenderContext aRenderContext(pBuffer, mrModel, mrPage, maSlideSize, Fraction(rScale)); // Render Background and analyze other passes if (maRenderState.meStage == RenderStage::Background) @@ -1009,7 +1013,7 @@ bool SlideshowLayerRenderer::render(unsigned char* pBuffer, bool& bIsBitmapLayer // We need to return a valid layer, so if background has to be skipped // render the next layer if (!mbRenderBackground) - render(pBuffer, bIsBitmapLayer, rJsonMsg); + render(pBuffer, bIsBitmapLayer, rScale, rJsonMsg); } else { diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index ecc7d7c16f07..3c04c2276eec 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -4749,7 +4749,7 @@ void SdXImpressDocument::postSlideshowCleanup() pViewSh->destroyXSlideShowInstance(); } -bool SdXImpressDocument::renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, OUString& rJsonMsg) +bool SdXImpressDocument::renderNextSlideLayer(unsigned char* pBuffer, bool& bIsBitmapLayer, double& rScale, OUString& rJsonMsg) { bool bDone = true; @@ -4757,7 +4757,7 @@ bool SdXImpressDocument::renderNextSlideLayer(unsigned char* pBuffer, bool& bIsB return bDone; OString sMsg; - bool bOK = mpSlideshowLayerRenderer->render(pBuffer, bIsBitmapLayer, sMsg); + bool bOK = mpSlideshowLayerRenderer->render(pBuffer, bIsBitmapLayer, rScale, sMsg); if (bOK) { |