+2012-01-18 David Levin <levin@chromium.org>
+
+ Allow delayed DC allocation in HWndDC.
+ https://bugs.webkit.org/show_bug.cgi?id=76737
+
+ Reviewed by Adam Roben.
+
+ No new functionality exposed so no new tests.
+
+ * platform/win/HWndDC.h: Changed this slightly to allow
+ for allocating a window DC after the initial creation since
+ this pattern occurrs in several places so this makes it easy to
+ replace them in an upcoming change.
+ (WebCore::HWndDC::HWndDC):
+ (WebCore::HWndDC::~HWndDC):
+ (WebCore::HWndDC::setHWnd):
+ (WebCore::HWndDC::clear):
+
2012-01-23 Arko Saha <nghq36@motorola.com>
MicroData: Compilation error while building Webkit with --microdata.
class HWndDC {
WTF_MAKE_NONCOPYABLE(HWndDC);
public:
+ HWndDC()
+ : m_hwnd(0)
+ , m_hdc(0)
+ {
+ }
+
explicit HWndDC(HWND hwnd)
: m_hwnd(hwnd)
, m_hdc(::GetDC(hwnd))
~HWndDC()
{
- if (m_hdc)
- ::ReleaseDC(m_hwnd, m_hdc);
+ clear();
+ }
+
+ HDC setHWnd(HWND hwnd)
+ {
+ clear();
+ m_hwnd = hwnd;
+ m_hdc = ::GetDC(hwnd);
+ return m_hdc;
+ }
+
+ void clear()
+ {
+ if (!m_hdc)
+ return;
+ ::ReleaseDC(m_hwnd, m_hdc);
+ m_hwnd = 0;
+ m_hdc = 0;
}
operator HDC()