summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-22 20:25:27 +0000
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-02-23 11:49:09 +0100
commitaad647a86f2822a90a083b47f189f3f4c4638684 (patch)
tree945e7624eb953a5ea4f8cb2adce777b63e9677e5 /drawinglayer
parent94dc600334cbadeb5d37205893688b29ce856e90 (diff)
optimize the text drawing, that's what we do most of
maybe the alternative branch should be dropped, turned into a debugging option because it is obscure and presumably doesn't result in better results that using the platform text rendering Change-Id: Ief6882f7acf8737ca64b10e74e5d94aade60d71a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163811 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.cxx8
-rw-r--r--drawinglayer/source/processor2d/vclpixelprocessor2d.hxx3
2 files changed, 9 insertions, 2 deletions
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
index f9b0e0df6159..10f0e0570be7 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.cxx
@@ -75,6 +75,10 @@ VclPixelProcessor2D::VclPixelProcessor2D(const geometry::ViewInformation2D& rVie
const basegfx::BColorModifierStack& rInitStack)
: VclProcessor2D(rViewInformation, rOutDev, rInitStack)
, m_nOrigAntiAliasing(rOutDev.GetAntialiasing())
+ , m_bRenderSimpleTextDirect(
+ officecfg::Office::Common::Drawinglayer::RenderSimpleTextDirect::get())
+ , m_bRenderDecoratedTextDirect(
+ officecfg::Office::Common::Drawinglayer::RenderDecoratedTextDirect::get())
{
// prepare maCurrentTransformation matrix with viewTransformation to target directly to pixels
maCurrentTransformation = rViewInformation.getObjectToViewTransformation();
@@ -403,7 +407,7 @@ void VclPixelProcessor2D::processTextSimplePortionPrimitive2D(
const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode());
adaptTextToFillDrawMode();
- if (officecfg::Office::Common::Drawinglayer::RenderSimpleTextDirect::get())
+ if (SAL_LIKELY(m_bRenderSimpleTextDirect))
{
RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate);
}
@@ -423,7 +427,7 @@ void VclPixelProcessor2D::processTextDecoratedPortionPrimitive2D(
const DrawModeFlags nOriginalDrawMode(mpOutputDevice->GetDrawMode());
adaptTextToFillDrawMode();
- if (officecfg::Office::Common::Drawinglayer::RenderDecoratedTextDirect::get())
+ if (SAL_LIKELY(m_bRenderDecoratedTextDirect))
{
RenderTextSimpleOrDecoratedPortionPrimitive2D(rCandidate);
}
diff --git a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
index c144ba9647eb..185ed52ed897 100644
--- a/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
+++ b/drawinglayer/source/processor2d/vclpixelprocessor2d.hxx
@@ -55,6 +55,9 @@ class VclPixelProcessor2D final : public VclProcessor2D
{
AntialiasingFlags m_nOrigAntiAliasing;
+ bool m_bRenderSimpleTextDirect;
+ bool m_bRenderDecoratedTextDirect;
+
/* the local processor for BasePrimitive2D-Implementation based primitives,
called from the common process()-implementation
*/