Commit 5f544946 authored by aroben@apple.com's avatar aroben@apple.com
Browse files

Add assertions that CACFLayerTreeHost gains and loses an HWND only once

CACFLayerTreeHost doesn't support any other use pattern.

Reviewed by Sam Weinig.

* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::CACFLayerTreeHost): Initialize new member.
(WebCore::CACFLayerTreeHost::setWindow): Assert that we transition from not having a window,
to having a window, to not having a window just once over the lifetime of this object.

* platform/graphics/ca/win/CACFLayerTreeHost.h: Added m_state.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76763 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9e3fd540
2011-01-26 Adam Roben <aroben@apple.com>
Add assertions that CACFLayerTreeHost gains and loses an HWND only once
CACFLayerTreeHost doesn't support any other use pattern.
Reviewed by Sam Weinig.
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::CACFLayerTreeHost): Initialize new member.
(WebCore::CACFLayerTreeHost::setWindow): Assert that we transition from not having a window,
to having a window, to not having a window just once over the lifetime of this object.
* platform/graphics/ca/win/CACFLayerTreeHost.h: Added m_state.
2011-01-26 Adam Roben <aroben@apple.com>
 
Notify layers that their animations have started when we flush the context, not when we
......@@ -190,6 +190,9 @@ CACFLayerTreeHost::CACFLayerTreeHost()
, m_mustResetLostDeviceBeforeRendering(false)
, m_shouldFlushPendingGraphicsLayerChanges(false)
, m_isFlushingLayerChanges(false)
#if !ASSERT_DISABLED
, m_state(WindowNotSet)
#endif
{
// Point the CACFContext to this
wkCACFContextSetUserData(m_context, this);
......@@ -233,6 +236,24 @@ void CACFLayerTreeHost::setWindow(HWND window)
if (window == m_window)
return;
#if !ASSERT_DISABLED
switch (m_state) {
case WindowNotSet:
ASSERT_ARG(window, window);
ASSERT(!m_window);
m_state = WindowSet;
break;
case WindowSet:
ASSERT_ARG(window, !window);
ASSERT(m_window);
m_state = WindowCleared;
break;
case WindowCleared:
ASSERT_NOT_REACHED();
break;
}
#endif
if (m_window)
destroyRenderer();
......
......@@ -118,6 +118,9 @@ private:
#ifndef NDEBUG
bool m_printTree;
#endif
#if !ASSERT_DISABLED
enum { WindowNotSet, WindowSet, WindowCleared } m_state;
#endif
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment