diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-07-16 22:00:42 +0200 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-07-17 13:58:51 +0200 |
commit | 8134fb802635f3798eb72e414450b64409de5ef9 (patch) | |
tree | e5c6bd06861dcd0618c5a2784a9da0b018cb37ef /vcl | |
parent | 3141dd460bffb26b0b697600a17e7ab6e18580bc (diff) |
DWrite: move impl. of some methods to the cxx
Change-Id: I34b4163176dc5a4a8f5cd326918df375c3475a1a
Reviewed-on: https://gerrit.libreoffice.org/40019
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl')
-rwxr-xr-x | vcl/inc/win/DWriteTextRenderer.hxx | 15 | ||||
-rwxr-xr-x | vcl/win/gdi/DWriteTextRenderer.cxx | 23 |
2 files changed, 26 insertions, 12 deletions
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) |