summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d
diff options
context:
space:
mode:
authorArmin Le Grand (Collabora) <Armin.Le.Grand@me.com>2024-08-26 14:25:19 +0200
committerArmin Le Grand <Armin.Le.Grand@me.com>2024-08-27 13:05:19 +0200
commitbf3cd8e50f886084500e3a8ff72ff4ffab05ddd7 (patch)
tree13c1b188d71e0c76625aea7786ba35476670233f /drawinglayer/source/processor2d
parent67fe2bff5a19f5be603ad9f151938c96ca87ce63 (diff)
CairoSDPR: Make using SDPR dependent of ExperimentalMode
Change-Id: Ia25fe2f3c5ff4904530ea8c296d10bbbe2823af5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172394 Tested-by: Jenkins Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'drawinglayer/source/processor2d')
-rw-r--r--drawinglayer/source/processor2d/processor2dtools.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/drawinglayer/source/processor2d/processor2dtools.cxx b/drawinglayer/source/processor2d/processor2dtools.cxx
index 585f312c7c60..742115f0b156 100644
--- a/drawinglayer/source/processor2d/processor2dtools.cxx
+++ b/drawinglayer/source/processor2d/processor2dtools.cxx
@@ -27,6 +27,7 @@
#include <drawinglayer/processor2d/d2dpixelprocessor2d.hxx>
#elif USE_HEADLESS_CODE
#include <drawinglayer/processor2d/cairopixelprocessor2d.hxx>
+#include <officecfg/Office/Common.hxx>
#endif
namespace drawinglayer::processor2d
@@ -35,10 +36,23 @@ std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice(
OutputDevice& rTargetOutDev,
const drawinglayer::geometry::ViewInformation2D& rViewInformation2D)
{
- static const bool bTestSystemPrimitiveRenderer(nullptr != std::getenv("TEST_SYSTEM_PRIMITIVE_RENDERER"));
- if(bTestSystemPrimitiveRenderer)
+ static bool bUsePrimitiveRenderer(
+#if defined(_WIN32)
+ // Windows: make still dependent on TEST_SYSTEM_PRIMITIVE_RENDERER
+ nullptr != std::getenv("TEST_SYSTEM_PRIMITIVE_RENDERER")
+#elif USE_HEADLESS_CODE
+ // Linux/Cairo: make dependent on ExperimentalMode now
+ officecfg::Office::Common::Misc::ExperimentalMode::get()
+#else
+ // all others: do not use, not (yet) supported
+ false
+#endif
+ );
+
+ if(bUsePrimitiveRenderer)
{
drawinglayer::geometry::ViewInformation2D aViewInformation2D(rViewInformation2D);
+
// if mnOutOffX/mnOutOffY is set (a 'hack' to get a cheap additional offset), apply it additionally
if(0 != rTargetOutDev.GetOutOffXPixel() || 0 != rTargetOutDev.GetOutOffYPixel())
{
@@ -46,6 +60,7 @@ std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice(
aTransform.translate(rTargetOutDev.GetOutOffXPixel(), rTargetOutDev.GetOutOffYPixel());
aViewInformation2D.setViewTransformation(aTransform);
}
+
#if defined(_WIN32)
SystemGraphicsData aData(rTargetOutDev.GetSystemGfxData());
std::unique_ptr<D2DPixelProcessor2D> aRetval(
@@ -61,7 +76,7 @@ std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice(
#endif
}
- // create Pixel Vcl-Processor
+ // default: create Pixel Vcl-Processor
return std::make_unique<VclPixelProcessor2D>(rViewInformation2D, rTargetOutDev);
}