[Libreoffice-commits] core.git: vcl/inc vcl/win

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Mon Jul 17 11:59:25 UTC 2017


 vcl/inc/win/DWriteTextRenderer.hxx |   15 +++------------
 vcl/win/gdi/DWriteTextRenderer.cxx |   23 +++++++++++++++++++++++
 2 files changed, 26 insertions(+), 12 deletions(-)

New commits:
commit 8134fb802635f3798eb72e414450b64409de5ef9
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Sun Jul 16 22:00:42 2017 +0200

    DWrite: move impl. of some methods to the cxx
    
    Change-Id: I34b4163176dc5a4a8f5cd326918df375c3475a1a
    Reviewed-on: https://gerrit.libreoffice.org/40019
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tomaž Vajngerl <quikee at gmail.com>

diff --git a/vcl/inc/win/DWriteTextRenderer.hxx b/vcl/inc/win/DWriteTextRenderer.hxx
index 462e99050083..611a134396f7 100755
--- a/vcl/inc/win/DWriteTextRenderer.hxx
+++ b/vcl/inc/win/DWriteTextRenderer.hxx
@@ -55,13 +55,7 @@ public:
         SalGraphics &rGraphics,
         HDC hDC) override;
 
-    bool BindDC(HDC hDC, tools::Rectangle const & rRect = tools::Rectangle(0, 0, 1, 1))
-    {
-        if (rRect.GetWidth() == 0 || rRect.GetHeight() == 0)
-            return false;
-        RECT const rc = { rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() };
-        return SUCCEEDED(mpRT->BindDC(hDC, &rc));
-    }
+    bool BindDC(HDC hDC, tools::Rectangle const & rRect = tools::Rectangle(0, 0, 1, 1));
 
     bool BindFont(HDC hDC) /*override*/;
     bool ReleaseFont() /*override*/;
@@ -71,12 +65,9 @@ public:
     IDWriteFontFace   * GetFontFace() const { return mpFontFace; }
     float               GetEmHeight() const { return mlfEmHeight; }
 
-    HRESULT CreateRenderTarget() {
-        if (mpRT) mpRT->Release(); mpRT = nullptr;
-        return mpD2DFactory->CreateDCRenderTarget(&mRTProps, &mpRT);
-    }
+    HRESULT CreateRenderTarget();
 
-    bool Ready() const { return mpGdiInterop && mpRT; }
+    bool Ready() const;
 
     void applyTextAntiAliasMode();
     void setTextAntiAliasMode(D2DTextAntiAliasMode eMode)
diff --git a/vcl/win/gdi/DWriteTextRenderer.cxx b/vcl/win/gdi/DWriteTextRenderer.cxx
index ea13e05b8a60..8ccb1f451cda 100755
--- a/vcl/win/gdi/DWriteTextRenderer.cxx
+++ b/vcl/win/gdi/DWriteTextRenderer.cxx
@@ -169,6 +169,29 @@ void D2DWriteTextOutRenderer::applyTextAntiAliasMode()
     mpRT->SetTextRenderingParams(mpRenderingParameters);
 }
 
+HRESULT D2DWriteTextOutRenderer::CreateRenderTarget()
+{
+    if (mpRT)
+    {
+        mpRT->Release();
+        mpRT = nullptr;
+    }
+    return mpD2DFactory->CreateDCRenderTarget(&mRTProps, &mpRT);
+}
+
+bool D2DWriteTextOutRenderer::Ready() const
+{
+    return mpGdiInterop && mpRT;
+}
+
+bool D2DWriteTextOutRenderer::BindDC(HDC hDC, tools::Rectangle const & rRect)
+{
+    if (rRect.GetWidth() == 0 || rRect.GetHeight() == 0)
+        return false;
+    RECT const rc = { rRect.Left(), rRect.Top(), rRect.Right(), rRect.Bottom() };
+    return SUCCEEDED(mpRT->BindDC(hDC, &rc));
+}
+
 bool D2DWriteTextOutRenderer::operator ()(CommonSalLayout const &rLayout,
     SalGraphics &rGraphics,
     HDC hDC)


More information about the Libreoffice-commits mailing list