diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-12-20 11:38:47 +0000 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2022-03-15 08:07:10 +0100 |
commit | f793891368d1fbe47b6dc119a89a1cd3e7a40082 (patch) | |
tree | 3744441055bc5cb1d54d46232ed95855db41a167 /vcl/inc/win | |
parent | 08bc6c1101b30b064119cdabf0a6d60e39cb321a (diff) |
tdf#144862 use resolution independent positions for writer's screen-rendering
in favor of pushing it down to the text renderers and leave
it to them to optimized as best they can the the rendering
to make it look as well as possible.
Change-Id: Ic0849c091a36e1a90453771b1c91b8ff706b679e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128418
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 4ed26badfd6fd9190cb6e54078b41eb38cb37dca)
Diffstat (limited to 'vcl/inc/win')
-rw-r--r-- | vcl/inc/win/DWriteTextRenderer.hxx | 17 | ||||
-rw-r--r-- | vcl/inc/win/salgdi.h | 2 | ||||
-rw-r--r-- | vcl/inc/win/winlayout.hxx | 8 |
3 files changed, 16 insertions, 11 deletions
diff --git a/vcl/inc/win/DWriteTextRenderer.hxx b/vcl/inc/win/DWriteTextRenderer.hxx index 6e097546d1e2..b64cc48a1c6a 100644 --- a/vcl/inc/win/DWriteTextRenderer.hxx +++ b/vcl/inc/win/DWriteTextRenderer.hxx @@ -37,12 +37,13 @@ enum class D2DTextAntiAliasMode class D2DWriteTextOutRenderer : public TextOutRenderer { public: - explicit D2DWriteTextOutRenderer(); + explicit D2DWriteTextOutRenderer(bool bRenderingModeNatural); virtual ~D2DWriteTextOutRenderer() override; - bool operator ()(GenericSalLayout const &rLayout, + bool operator()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, - HDC hDC) override; + HDC hDC, + bool bRenderingModeNatural) override; HRESULT BindDC(HDC hDC, tools::Rectangle const & rRect = tools::Rectangle(0, 0, 1, 1)); @@ -54,12 +55,13 @@ public: IDWriteFontFace * GetFontFace() const { return mpFontFace; } float GetEmHeight() const { return mlfEmHeight; } - HRESULT CreateRenderTarget(); + HRESULT CreateRenderTarget(bool bRenderingModeNatural); bool Ready() const; - void applyTextAntiAliasMode(); - void changeTextAntiAliasMode(D2DTextAntiAliasMode eMode); + void applyTextAntiAliasMode(bool bRenderingModeNatural); + + bool GetRenderingModeNatural() const { return mbRenderingModeNatural; } private: // This is a singleton object disable copy ctor and assignment operator @@ -67,7 +69,7 @@ private: D2DWriteTextOutRenderer & operator = (const D2DWriteTextOutRenderer &) = delete; bool GetDWriteFaceFromHDC(HDC hDC, IDWriteFontFace ** ppFontFace, float * lfSize) const; - bool performRender(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC, bool& bRetry); + bool performRender(GenericSalLayout const &rLayout, SalGraphics &rGraphics, HDC hDC, bool& bRetry, bool bRenderingModeNatural); ID2D1Factory * mpD2DFactory; IDWriteFactory * mpDWriteFactory; @@ -78,6 +80,7 @@ private: IDWriteFontFace * mpFontFace; float mlfEmHeight; HDC mhDC; + bool mbRenderingModeNatural; D2DTextAntiAliasMode meTextAntiAliasMode; }; diff --git a/vcl/inc/win/salgdi.h b/vcl/inc/win/salgdi.h index b472ece0a256..7833f988bd18 100644 --- a/vcl/inc/win/salgdi.h +++ b/vcl/inc/win/salgdi.h @@ -316,7 +316,7 @@ public: private: // local helpers - void DrawTextLayout(const GenericSalLayout&, HDC, bool bUseDWrite); + void DrawTextLayout(const GenericSalLayout&, HDC, bool bUseDWrite, bool bRenderingModeNatural); public: // public SalGraphics methods, the interface to the independent vcl part diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 0b43ef4eeca1..5f56fe6b0c5e 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -75,13 +75,14 @@ protected: TextOutRenderer & operator = (const TextOutRenderer &) = delete; public: - static TextOutRenderer & get(bool bUseDWrite); + static TextOutRenderer & get(bool bUseDWrite, bool bRenderingModeNatural); virtual ~TextOutRenderer() = default; virtual bool operator ()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, - HDC hDC) = 0; + HDC hDC, + bool bRenderingModeNatural) = 0; }; class ExTextOutRenderer : public TextOutRenderer @@ -94,7 +95,8 @@ public: bool operator ()(GenericSalLayout const &rLayout, SalGraphics &rGraphics, - HDC hDC) override; + HDC hDC, + bool bRenderingModeNatural) override; }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |