Gfx: Remove __D2DParams

This commit is contained in:
Birunthan Mohanathas 2013-10-06 17:07:00 +03:00
parent 6df7d5d509
commit 2fb733ef75
4 changed files with 0 additions and 37 deletions

View File

@ -84,9 +84,6 @@ public:
virtual void SetAntiAliasing(bool enable) = 0;
virtual void SetTextAntiAliasing(bool enable) = 0;
// FIXME: Temporary hack to test things out. This will be removed when no longer needed.
virtual void SetTextRenderingOptions(float gamma, float enhancedContrast) {};
virtual void Clear(const Gdiplus::Color& color = Gdiplus::Color(0, 0, 0, 0)) = 0;
virtual void DrawTextW(const WCHAR* str, UINT strLen, const TextFormat& format, Gdiplus::RectF& rect, const Gdiplus::SolidBrush& brush) = 0;

View File

@ -167,10 +167,6 @@ bool CanvasD2D::BeginTargetDraw()
if (SUCCEEDED(hr))
{
SetTextAntiAliasing(m_TextAntiAliasing);
if (m_TextRenderingParams)
{
m_Target->SetTextRenderingParams(m_TextRenderingParams.Get());
}
m_Target->BeginDraw();
@ -299,28 +295,6 @@ void CanvasD2D::SetTextAntiAliasing(bool enable)
}
}
void CanvasD2D::SetTextRenderingOptions(float gamma, float enhancedContrast)
{
Microsoft::WRL::ComPtr<IDWriteRenderingParams> defaultRenderingParams;
HRESULT hr = c_DWFactory->CreateRenderingParams(defaultRenderingParams.GetAddressOf());
if (SUCCEEDED(hr))
{
hr = ((IDWriteFactory1*)c_DWFactory.Get())->CreateCustomRenderingParams(
gamma,
enhancedContrast,
enhancedContrast,
defaultRenderingParams->GetClearTypeLevel(),
defaultRenderingParams->GetPixelGeometry(),
defaultRenderingParams->GetRenderingMode(),
m_TextRenderingParams.ReleaseAndGetAddressOf());
}
if (SUCCEEDED(hr) && m_Target)
{
m_Target->SetTextRenderingParams(m_TextRenderingParams.Get());
}
}
void CanvasD2D::Clear(const Gdiplus::Color& color)
{
if (!m_Target) // Use GDI+ if D2D render target has not been created.

View File

@ -63,7 +63,6 @@ public:
virtual void SetAntiAliasing(bool enable) override;
virtual void SetTextAntiAliasing(bool enable) override;
virtual void SetTextRenderingOptions(float gamma, float enhancedContrast) override;
virtual void Clear(const Gdiplus::Color& color) override;
@ -91,7 +90,6 @@ private:
void UpdateTargetTransform();
Microsoft::WRL::ComPtr<ID2D1RenderTarget> m_Target;
Microsoft::WRL::ComPtr<IDWriteRenderingParams1> m_TextRenderingParams;
// Underlying pixel data shared by both m_Target and m_GdipBitmap.
Util::WICBitmapDIB m_Bitmap;

View File

@ -2081,12 +2081,6 @@ bool MeterWindow::ReadSkin()
m_UseD2D && GetRainmeter().GetUseD2D() ? Gfx::Renderer::PreferD2D : Gfx::Renderer::GDIP);
m_Canvas->SetAccurateText(m_Parser.ReadBool(L"Rainmeter", L"AccurateText", false));
const auto d2dParams = m_Parser.ReadFloats(L"Rainmeter", L"__D2DParams");
if (d2dParams.size() == 2)
{
m_Canvas->SetTextRenderingOptions(d2dParams[0], d2dParams[1]);
}
// Gotta have some kind of buffer during initialization
CreateDoubleBuffer(1, 1);