Gfx: Additional changes to d003db6

This commit is contained in:
Birunthan Mohanathas 2013-09-29 17:57:21 +03:00
parent d003db6531
commit 21d9c0698f
3 changed files with 9 additions and 2 deletions

View File

@ -305,9 +305,10 @@ void CanvasD2D::SetTextRenderingOptions(float gamma, float enhancedContrast)
HRESULT hr = c_DWFactory->CreateRenderingParams(defaultRenderingParams.GetAddressOf());
if (SUCCEEDED(hr))
{
hr = c_DWFactory->CreateCustomRenderingParams(
hr = ((IDWriteFactory1*)c_DWFactory.Get())->CreateCustomRenderingParams(
gamma,
enhancedContrast,
enhancedContrast,
defaultRenderingParams->GetClearTypeLevel(),
defaultRenderingParams->GetPixelGeometry(),
defaultRenderingParams->GetRenderingMode(),

View File

@ -91,7 +91,7 @@ private:
void UpdateTargetTransform();
Microsoft::WRL::ComPtr<ID2D1RenderTarget> m_Target;
Microsoft::WRL::ComPtr<IDWriteRenderingParams> m_TextRenderingParams;
Microsoft::WRL::ComPtr<IDWriteRenderingParams1> m_TextRenderingParams;
// Underlying pixel data shared by both m_Target and m_GdipBitmap.
Util::WICBitmapDIB m_Bitmap;

View File

@ -2080,6 +2080,12 @@ bool MeterWindow::ReadSkin()
m_Canvas = Gfx::Canvas::Create(useD2D ? 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);