From 05cbcb9aa8e1ba2aaa59de829e00b78bc66274fe Mon Sep 17 00:00:00 2001 From: Brian Ferguson Date: Thu, 25 Jul 2013 15:03:14 -0600 Subject: [PATCH] Temporarily added "__UseD2D" to [Rainmeter] section of skin that overrides global "UseD2D" value to help in testing. --- Library/MeterWindow.cpp | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/Library/MeterWindow.cpp b/Library/MeterWindow.cpp index 7e1d4c2f..e40bfb37 100644 --- a/Library/MeterWindow.cpp +++ b/Library/MeterWindow.cpp @@ -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);