Temporarily added "__UseD2D" to [Rainmeter] section of skin that overrides global "UseD2D" value to help in testing.

This commit is contained in:
Brian Ferguson 2013-07-25 15:03:14 -06:00
parent b27bf1ee63
commit 05cbcb9aa8

View File

@ -142,9 +142,6 @@ MeterWindow::MeterWindow(const std::wstring& folderPath, const std::wstring& fil
m_FontCollection(),
m_ToolTipHidden(false)
{
m_Canvas = (Platform::IsAtLeastWinVista() && GetRainmeter().CanUseD2D()) ?
(Gfx::Canvas*)new Gfx::CanvasD2D() : (Gfx::Canvas*)new Gfx::CanvasGDIP();
if (!c_DwmInstance && Platform::IsAtLeastWinVista())
{
c_DwmInstance = System::RmLoadLibrary(L"dwmapi.dll");
@ -203,9 +200,6 @@ MeterWindow::~MeterWindow()
c_DwmIsCompositionEnabled = nullptr;
}
}
delete m_Canvas;
m_Canvas = nullptr;
}
/*
@ -270,6 +264,9 @@ void MeterWindow::Dispose(bool refresh)
m_Window = nullptr;
}
}
delete m_Canvas;
m_Canvas = nullptr;
}
/*
@ -297,9 +294,6 @@ void MeterWindow::Initialize()
// Mark the window to ignore the Aero peek
IgnoreAeroPeek();
// Gotta have some kind of buffer during initialization
CreateDoubleBuffer(1, 1);
Refresh(true, true);
if (!m_WindowStartHidden)
{
@ -2077,6 +2071,19 @@ bool MeterWindow::ReadSkin()
// Read options from Rainmeter.ini.
ReadOptions();
// Temporarily read "__UseD2D" from skin for easy testing
bool useD2D = GetRainmeter().CanUseD2D();
if (revision_beta)
{
useD2D = 0!=m_Parser.ReadInt(L"Rainmeter", L"__UseD2D", useD2D ? 1 : 0);
}
m_Canvas = (Platform::IsAtLeastWinVista() && useD2D) ?
(Gfx::Canvas*)new Gfx::CanvasD2D() : (Gfx::Canvas*)new Gfx::CanvasGDIP();
// Gotta have some kind of buffer during initialization
CreateDoubleBuffer(1, 1);
m_AccurateText = 0!=m_Parser.ReadInt(L"Rainmeter", L"AccurateText", 0);
m_Canvas->SetAccurateText(m_AccurateText);