drawinglayer/source/processor2d/processor2dtools.cxx | 56 ++++++++++--------- 1 file changed, 31 insertions(+), 25 deletions(-)
New commits: commit af4d7eb9fdb1921a2bac78b51c17e1975ae908c5 Author: Armin Le Grand (Collabora) <armin.le.gr...@me.com> AuthorDate: Tue Mar 4 13:51:28 2025 +0100 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Wed Mar 5 09:43:35 2025 +0100 tdf#165437: regression: CairoSDPR: Exclude SDPR when mirrored This one is similar to tdf#165061 due to not using CairoSDPR when RTL is used, but it seems that not all cases of 'mirroring' are covered with using IsRTLEnabled. It also needs to check HasMirroredGraphics, so I added that. Change-Id: Ia86add7841e69657d8f64f7001eea4a57e927043 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182481 Tested-by: Jenkins Reviewed-by: Armin Le Grand <armin.le.gr...@me.com> (cherry picked from commit dedaef9565dba5856ef68a49c634b614cb3ef24d) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182504 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> diff --git a/drawinglayer/source/processor2d/processor2dtools.cxx b/drawinglayer/source/processor2d/processor2dtools.cxx index f892acfc1563..f04d121467c5 100644 --- a/drawinglayer/source/processor2d/processor2dtools.cxx +++ b/drawinglayer/source/processor2d/processor2dtools.cxx @@ -108,35 +108,41 @@ std::unique_ptr<BaseProcessor2D> createPixelProcessor2DFromOutputDevice( // possibility to deactivate for easy test/request testing static bool bUsePrimitiveRenderer(nullptr == std::getenv("DISABLE_SYSTEM_DEPENDENT_PRIMITIVE_RENDERER")); - if (bUsePrimitiveRenderer + if (bUsePrimitiveRenderer) + { // tdf#165061 do not use SDPR when RTL is enabled, SDPR is designed // for rendering EditViews and does not support RTL (yet?) - && !rTargetOutDev.IsRTLEnabled()) - { - SystemGraphicsData aData(rTargetOutDev.GetSystemGfxData()); - - // create CairoPixelProcessor2D, make use of the possibility to - // add an initial clip relative to the real pixel dimensions of - // the target surface. This is e.g. needed here due to the - // existence of 'virtual' target surfaces that internally use an - // offset and limited pixel size, mainly used for UI elements. - // let the CairoPixelProcessor2D do this, it has internal, - // system-specific possibilities to do that in an elegant and - // efficient way (using cairo_surface_create_for_rectangle). - std::unique_ptr<CairoPixelProcessor2D> aRetval( - std::make_unique<CairoPixelProcessor2D>( - rViewInformation2D, static_cast<cairo_surface_t*>(aData.pSurface), - rTargetOutDev.GetOutOffXPixel(), rTargetOutDev.GetOutOffYPixel(), - rTargetOutDev.GetOutputWidthPixel(), rTargetOutDev.GetOutputHeightPixel())); + // tdf#165437 also need to check for HasMirroredGraphics to + // get *all* mirrorings covered + const bool bMirrored(rTargetOutDev.IsRTLEnabled() || rTargetOutDev.HasMirroredGraphics()); - if (aRetval->valid()) + if (!bMirrored) { - // if we construct a CairoPixelProcessor2D from OutputDevice, - // additionally set the XGraphics that can be obtained from - // there. It may be used e.g. to render FormControls directly - aRetval->setXGraphics(rTargetOutDev.CreateUnoGraphics()); - - return aRetval; + SystemGraphicsData aData(rTargetOutDev.GetSystemGfxData()); + + // create CairoPixelProcessor2D, make use of the possibility to + // add an initial clip relative to the real pixel dimensions of + // the target surface. This is e.g. needed here due to the + // existence of 'virtual' target surfaces that internally use an + // offset and limited pixel size, mainly used for UI elements. + // let the CairoPixelProcessor2D do this, it has internal, + // system-specific possibilities to do that in an elegant and + // efficient way (using cairo_surface_create_for_rectangle). + std::unique_ptr<CairoPixelProcessor2D> aRetval( + std::make_unique<CairoPixelProcessor2D>( + rViewInformation2D, static_cast<cairo_surface_t*>(aData.pSurface), + rTargetOutDev.GetOutOffXPixel(), rTargetOutDev.GetOutOffYPixel(), + rTargetOutDev.GetOutputWidthPixel(), rTargetOutDev.GetOutputHeightPixel())); + + if (aRetval->valid()) + { + // if we construct a CairoPixelProcessor2D from OutputDevice, + // additionally set the XGraphics that can be obtained from + // there. It may be used e.g. to render FormControls directly + aRetval->setXGraphics(rTargetOutDev.CreateUnoGraphics()); + + return aRetval; + } } } #endif