vcl/inc/win/winlayout.hxx | 14 -------- vcl/win/gdi/winlayout.cxx | 76 ++-------------------------------------------- 2 files changed, 4 insertions(+), 86 deletions(-)
New commits: commit c8c26b466f28222618b2edae15d66eb7ad020e67 Author: Andras Timar <andras.ti...@collabora.com> Date: Thu Sep 28 21:35:51 2017 +0200 Revert "tdf#112486 Do not force GDI in no OpenGL" This reverts commit b62fd70ad353da26c74d993bef8d884c2b3a73b7. diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index f555d86325f2..18c17b02abc2 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -3873,7 +3873,7 @@ void WinSalGraphics::DrawSalLayout(const CommonSalLayout& rLayout) if (!bUseOpenGL) { // no OpenGL, just classic rendering - DrawTextLayout(rLayout, hDC, false); + DrawTextLayout(rLayout, hDC, !bForceGDI); } else if (!bForceGDI && CacheGlyphs(rLayout) && DrawCachedGlyphs(rLayout)) commit 3e572c5210a7202ad2933ae293e079fbdf57943e Author: Andras Timar <andras.ti...@collabora.com> Date: Thu Sep 28 21:35:31 2017 +0200 Revert "tdf#106990 set cleartype setting / force to use GDI render mode" This reverts commit a3c9704f4c0cf2a0c6a4982bfb8124af63a506b0. diff --git a/vcl/inc/win/winlayout.hxx b/vcl/inc/win/winlayout.hxx index 61ecfdf8c8d8..d733e185d59d 100644 --- a/vcl/inc/win/winlayout.hxx +++ b/vcl/inc/win/winlayout.hxx @@ -432,13 +432,6 @@ public: Point* pPos, int* pGetNextGlypInfo) override; }; -enum class D2DTextAntiAliasMode -{ - Default, - ClearType, - AntiAliased, -}; - class D2DWriteTextOutRenderer : public TextOutRenderer { typedef HRESULT(WINAPI *pD2D1CreateFactory_t)(D2D1_FACTORY_TYPE, @@ -488,11 +481,6 @@ public: inline bool Ready() const { return mpGdiInterop && mpRT; } - void applyTextAntiAliasMode(); - void setTextAntiAliasMode(D2DTextAntiAliasMode eMode) - { - meTextAntiAliasMode = eMode; - } private: static void CleanupModules(); @@ -512,8 +500,6 @@ private: IDWriteFontFace * mpFontFace; float mlfEmHeight; HDC mhDC; - D2DTextAntiAliasMode meTextAntiAliasMode; - IDWriteRenderingParams* mpRenderingParameters; }; #endif // INCLUDED_VCL_INC_WIN_WINLAYOUT_HXX diff --git a/vcl/win/gdi/winlayout.cxx b/vcl/win/gdi/winlayout.cxx index 7b363ef83689..f555d86325f2 100644 --- a/vcl/win/gdi/winlayout.cxx +++ b/vcl/win/gdi/winlayout.cxx @@ -97,8 +97,6 @@ bool WinFontInstance::CacheGlyphToAtlas(bool bRealGlyphIndices, HDC hDC, HFONT h if (!pTxt) return false; - pTxt->setTextAntiAliasMode(D2DTextAntiAliasMode::AntiAliased); - if (!pTxt->BindFont(aHDC.get())) { SAL_WARN("vcl.gdi", "Binding of font failed. The font might not be supported by Direct Write."); @@ -214,7 +212,6 @@ bool WinFontInstance::CacheGlyphToAtlas(bool bRealGlyphIndices, HDC hDC, HFONT h }; pRT->BeginDraw(); - pTxt->applyTextAntiAliasMode(); pRT->DrawGlyphRun(baseline, &glyphs, pBrush); HRESULT hResult = pRT->EndDraw(); @@ -3157,47 +3154,6 @@ bool ExTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC, } return (pRectToErase && nGlyphs >= 1); } -namespace -{ - -D2DTextAntiAliasMode lclGetSystemTextAntiAliasMode() -{ - D2DTextAntiAliasMode eMode = D2DTextAntiAliasMode::Default; - - BOOL bFontSmoothing; - if (!SystemParametersInfo(SPI_GETFONTSMOOTHING, 0, &bFontSmoothing, 0)) - return eMode; - - if (bFontSmoothing) - { - UINT nType; - if (!SystemParametersInfo(SPI_GETFONTSMOOTHINGTYPE, 0, &nType, 0)) - return eMode; - - eMode = (nType == FE_FONTSMOOTHINGCLEARTYPE) ? D2DTextAntiAliasMode::ClearType - : D2DTextAntiAliasMode::AntiAliased; - } - - return eMode; -} - -IDWriteRenderingParams* lclSetRenderingMode(IDWriteFactory* pDWriteFactory, DWRITE_RENDERING_MODE eRenderingMode) -{ - IDWriteRenderingParams* pDefaultParameters = nullptr; - pDWriteFactory->CreateRenderingParams(&pDefaultParameters); - - IDWriteRenderingParams* pParameters = nullptr; - pDWriteFactory->CreateCustomRenderingParams( - pDefaultParameters->GetGamma(), - pDefaultParameters->GetEnhancedContrast(), - pDefaultParameters->GetClearTypeLevel(), - pDefaultParameters->GetPixelGeometry(), - eRenderingMode, - &pParameters); - return pParameters; -} - -} // end anonymous namespace D2DWriteTextOutRenderer::D2DWriteTextOutRenderer() : mpD2DFactory(nullptr), @@ -3205,12 +3161,11 @@ D2DWriteTextOutRenderer::D2DWriteTextOutRenderer() mpGdiInterop(nullptr), mpRT(nullptr), mRTProps(D2D1::RenderTargetProperties(D2D1_RENDER_TARGET_TYPE_DEFAULT, - D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), - 0, 0)), + D2D1::PixelFormat(DXGI_FORMAT_B8G8R8A8_UNORM, D2D1_ALPHA_MODE_PREMULTIPLIED), + 0, 0)), mpFontFace(nullptr), mlfEmHeight(0.0f), - mhDC(nullptr), - meTextAntiAliasMode(D2DTextAntiAliasMode::Default) + mhDC(nullptr) { HRESULT hr = S_OK; hr = D2D1CreateFactory(D2D1_FACTORY_TYPE_SINGLE_THREADED, __uuidof(ID2D1Factory), nullptr, reinterpret_cast<void **>(&mpD2DFactory)); @@ -3220,8 +3175,6 @@ D2DWriteTextOutRenderer::D2DWriteTextOutRenderer() hr = mpDWriteFactory->GetGdiInterop(&mpGdiInterop); hr = CreateRenderTarget(); } - meTextAntiAliasMode = lclGetSystemTextAntiAliasMode(); - mpRenderingParameters = lclSetRenderingMode(mpDWriteFactory, DWRITE_RENDERING_MODE_CLEARTYPE_GDI_CLASSIC); } D2DWriteTextOutRenderer::~D2DWriteTextOutRenderer() @@ -3237,26 +3190,6 @@ D2DWriteTextOutRenderer::~D2DWriteTextOutRenderer() CleanupModules(); } -void D2DWriteTextOutRenderer::applyTextAntiAliasMode() -{ - D2D1_TEXT_ANTIALIAS_MODE eMode = D2D1_TEXT_ANTIALIAS_MODE_DEFAULT; - switch (meTextAntiAliasMode) - { - case D2DTextAntiAliasMode::Default: - eMode = D2D1_TEXT_ANTIALIAS_MODE_ALIASED; - break; - case D2DTextAntiAliasMode::AntiAliased: - eMode = D2D1_TEXT_ANTIALIAS_MODE_GRAYSCALE; - break; - case D2DTextAntiAliasMode::ClearType: - eMode = D2D1_TEXT_ANTIALIAS_MODE_CLEARTYPE; - break; - default: - break; - } - mpRT->SetTextAntialiasMode(eMode); - mpRT->SetTextRenderingParams(mpRenderingParameters); -} bool D2DWriteTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC, const Rectangle* pRectToErase, @@ -3304,7 +3237,6 @@ bool D2DWriteTextOutRenderer::operator ()(SalLayout const &rLayout, HDC hDC, } mpRT->BeginDraw(); - applyTextAntiAliasMode(); D2D1_MATRIX_3X2_F aOrigTrans, aRotTrans; mpRT->GetTransform(&aOrigTrans); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits