drawinglayer/source/processor2d/cairopixelprocessor2d.cxx | 8 ++++---- vcl/inc/sallayout.hxx | 2 ++ vcl/source/gdi/sallayout.cxx | 8 ++++++++ 3 files changed, 14 insertions(+), 4 deletions(-)
New commits: commit 19cea16244956382f7e985c934c008392e13552f Author: Armin Le Grand (Collabora) <[email protected]> AuthorDate: Mon Aug 19 17:38:52 2024 +0200 Commit: Armin Le Grand <[email protected]> CommitDate: Mon Aug 19 19:51:52 2024 +0200 CairoSDPR: Make PixelSnap better aligned Change-Id: I64ca3e6bd0690ea14e95f3ed0969c320a45f30d6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172043 Tested-by: Jenkins Reviewed-by: Armin Le Grand <[email protected]> diff --git a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx index 3f2df4822b23..5fbc9dfc2749 100644 --- a/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx +++ b/drawinglayer/source/processor2d/cairopixelprocessor2d.cxx @@ -329,12 +329,12 @@ void checkAndDoPixelSnap(cairo_t* pRT, // transform to discrete pixels cairo_user_to_device(pRT, pX, pY); - // round them, also subtract 0.5 which will be as transform in + // round them, also add 0.5 which will be as transform in // the paint method to move to 'inside' pixels when AA used. // remember: this is only done when AA is active (see bPixelSnap - // above) - *pX = basegfx::fround(*pX) - 0.5; - *pY = basegfx::fround(*pY) - 0.5; + // above) and moves the hairline to full-pixel position + *pX = trunc(*pX) + 0.5; + *pY = trunc(*pY) + 0.5; // transform back to former transformed state cairo_device_to_user(pRT, pX, pY); commit fe27013495d58beedf982414bbd00f6ea577ff81 Author: Armin Le Grand (Collabora) <[email protected]> AuthorDate: Mon Aug 19 14:57:06 2024 +0200 Commit: Armin Le Grand <[email protected]> CommitDate: Mon Aug 19 19:51:42 2024 +0200 CairoSDPR: Text render needs MultiSalLayout support Change-Id: I418675012392a9707dc515eb1e05a2689ec902aa Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172039 Tested-by: Jenkins Reviewed-by: Armin Le Grand <[email protected]> diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx index 6b299322441e..ed539f058402 100644 --- a/vcl/inc/sallayout.hxx +++ b/vcl/inc/sallayout.hxx @@ -90,6 +90,8 @@ public: SAL_DLLPRIVATE virtual ~MultiSalLayout() override; + virtual void drawSalLayout(void* /*pSurface*/, const basegfx::BColor& /*rTextColor*/, bool /*bAntiAliased*/) const override; + private: MultiSalLayout( const MultiSalLayout& ) = delete; MultiSalLayout& operator=( const MultiSalLayout& ) = delete; diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index 9e2c0b66b9f9..1a63504ecc88 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -1277,4 +1277,12 @@ SalLayoutGlyphs MultiSalLayout::GetGlyphs() const return glyphs; } +void MultiSalLayout::drawSalLayout(void* pSurface, const basegfx::BColor& rTextColor, bool bAntiAliased) const +{ + for( int i = mnLevel; --i >= 0; ) + { + Application::GetDefaultDevice()->GetGraphics()->DrawSalLayout(*mpLayouts[ i ], pSurface, rTextColor, bAntiAliased); + } +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
