summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@libreoffice.org>2023-07-17 12:16:58 +0300
committerخالد حسني <khaled@libreoffice.org>2023-07-23 06:01:31 +0200
commitc46f8c356d812230c3a43cd08fb79674be88d9a8 (patch)
tree005a5ee8a4794b590c52b7a7f20015f8fcad1281
parent172b500ccbc8dac0496cc2936a9bcca793c0b594 (diff)
vcl: Simplify AquaGraphics*::drawTextLayout() calling
Take TextRenderModeForResolutionIndependentLayout() from the SalLayout argument instead of passing it separately. Change-Id: I155ea645e401618ad884fdc36c4c1aeab69980ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/154516 Tested-by: Jenkins Reviewed-by: خالد حسني <khaled@libreoffice.org>
-rw-r--r--vcl/inc/quartz/salgdi.h4
-rw-r--r--vcl/inc/skia/osx/gdiimpl.hxx3
-rw-r--r--vcl/quartz/salgdi.cxx6
-rw-r--r--vcl/skia/osx/gdiimpl.cxx4
4 files changed, 8 insertions, 9 deletions
diff --git a/vcl/inc/quartz/salgdi.h b/vcl/inc/quartz/salgdi.h
index 01826c5c93e0..026f5e066382 100644
--- a/vcl/inc/quartz/salgdi.h
+++ b/vcl/inc/quartz/salgdi.h
@@ -292,7 +292,7 @@ public:
const tools::Rectangle &rControlRegion,
ControlState nState,
const ImplControlValue &aValue) = 0;
- virtual void drawTextLayout(const GenericSalLayout& layout, bool bTextRenderModeForResolutionIndependentLayout) = 0;
+ virtual void drawTextLayout(const GenericSalLayout& layout) = 0;
virtual void Flush() {}
virtual void Flush( const tools::Rectangle& ) {}
virtual void WindowBackingPropertiesChanged() {};
@@ -445,7 +445,7 @@ public:
ControlState nState,
const ImplControlValue &aValue) override;
- virtual void drawTextLayout(const GenericSalLayout& layout, bool bTextRenderModeForResolutionIndependentLayout) override;
+ virtual void drawTextLayout(const GenericSalLayout& layout) override;
bool supportsOperation(OutDevSupportType eType) const override;
};
diff --git a/vcl/inc/skia/osx/gdiimpl.hxx b/vcl/inc/skia/osx/gdiimpl.hxx
index b90b576a873f..b97245e86e11 100644
--- a/vcl/inc/skia/osx/gdiimpl.hxx
+++ b/vcl/inc/skia/osx/gdiimpl.hxx
@@ -38,8 +38,7 @@ public:
const tools::Rectangle& rControlRegion, ControlState nState,
const ImplControlValue& aValue) override;
- virtual void drawTextLayout(const GenericSalLayout& layout,
- bool bTextRenderModeForResolutionIndependentLayout) override;
+ virtual void drawTextLayout(const GenericSalLayout& layout) override;
virtual void Flush() override;
virtual void Flush(const tools::Rectangle&) override;
diff --git a/vcl/quartz/salgdi.cxx b/vcl/quartz/salgdi.cxx
index 4af4b28ffa2c..b06e0d41bdbd 100644
--- a/vcl/quartz/salgdi.cxx
+++ b/vcl/quartz/salgdi.cxx
@@ -306,10 +306,10 @@ bool AquaSalGraphics::AddTempDevFont(vcl::font::PhysicalFontCollection*,
void AquaSalGraphics::DrawTextLayout(const GenericSalLayout& rLayout)
{
- mpBackend->drawTextLayout(rLayout, rLayout.GetTextRenderModeForResolutionIndependentLayout());
+ mpBackend->drawTextLayout(rLayout);
}
-void AquaGraphicsBackend::drawTextLayout(const GenericSalLayout& rLayout, bool bTextRenderModeForResolutionIndependentLayout)
+void AquaGraphicsBackend::drawTextLayout(const GenericSalLayout& rLayout)
{
#ifdef IOS
if (!mrShared.checkContext())
@@ -397,7 +397,7 @@ void AquaGraphicsBackend::drawTextLayout(const GenericSalLayout& rLayout, bool b
CGContextSetTextDrawingMode(mrShared.maContextHolder.get(), kCGTextFillStroke);
}
- if (bTextRenderModeForResolutionIndependentLayout)
+ if (rLayout.GetTextRenderModeForResolutionIndependentLayout())
{
CGContextSetAllowsFontSubpixelQuantization(mrShared.maContextHolder.get(), false);
CGContextSetShouldSubpixelQuantizeFonts(mrShared.maContextHolder.get(), false);
diff --git a/vcl/skia/osx/gdiimpl.cxx b/vcl/skia/osx/gdiimpl.cxx
index fd0bdca04333..e392587c8836 100644
--- a/vcl/skia/osx/gdiimpl.cxx
+++ b/vcl/skia/osx/gdiimpl.cxx
@@ -294,9 +294,9 @@ bool AquaSkiaSalGraphicsImpl::drawNativeControl(ControlType nType, ControlPart n
return bOK;
}
-void AquaSkiaSalGraphicsImpl::drawTextLayout(const GenericSalLayout& rLayout,
- bool bSubpixelPositioning)
+void AquaSkiaSalGraphicsImpl::drawTextLayout(const GenericSalLayout& rLayout)
{
+ const bool bSubpixelPositioning = rLayout.GetTextRenderModeForResolutionIndependentLayout();
const CoreTextFont& rFont = *static_cast<const CoreTextFont*>(&rLayout.GetFont());
const vcl::font::FontSelectPattern& rFontSelect = rFont.GetFontSelectPattern();
int nHeight = rFontSelect.mnHeight;