mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Gfx: Additional changes to d003db6
This commit is contained in:
parent
d003db6531
commit
21d9c0698f
@ -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(),
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user