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

Don't create the Direct3D device before it's first needed

We only need the device once we decide to render. There's no point in creating it before
then.

Reviewed by Sam Weinig.

* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::setWindow): Removed the call to createRenderer() from here.
We already have code to create it when we first try to draw.
(WebCore::CACFLayerTreeHost::createRenderer): Flush the context after we set our layer's
bounds so that the bounds will take effect the next time we render (which could be just
after this function returns).

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@76764 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 5f544946
2011-01-26 Adam Roben <aroben@apple.com>
Don't create the Direct3D device before it's first needed
We only need the device once we decide to render. There's no point in creating it before
then.
Reviewed by Sam Weinig.
* platform/graphics/ca/win/CACFLayerTreeHost.cpp:
(WebCore::CACFLayerTreeHost::setWindow): Removed the call to createRenderer() from here.
We already have code to create it when we first try to draw.
(WebCore::CACFLayerTreeHost::createRenderer): Flush the context after we set our layer's
bounds so that the bounds will take effect the next time we render (which could be just
after this function returns).
2011-01-26 Adam Roben <aroben@apple.com>
 
Add assertions that CACFLayerTreeHost gains and loses an HWND only once
......@@ -258,9 +258,6 @@ void CACFLayerTreeHost::setWindow(HWND window)
destroyRenderer();
m_window = window;
if (m_window)
createRenderer();
}
PlatformCALayer* CACFLayerTreeHost::rootLayer() const
......@@ -362,8 +359,10 @@ bool CACFLayerTreeHost::createRenderer()
wkCACFContextSetD3DDevice(m_context, m_d3dDevice.get());
if (IsWindow(m_window))
if (IsWindow(m_window)) {
m_rootLayer->setBounds(bounds());
wkCACFContextFlush(m_context);
}
return true;
}
......
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