Simplify WKCACFLayerRenderer's API
authoraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 01:46:53 +0000 (01:46 +0000)
committeraroben@apple.com <aroben@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 18 Jan 2011 01:46:53 +0000 (01:46 +0000)
commit07b671ba4ec510f72b2bf7e82411c5f32d0e15fc
treec79bf0518218f1b8e0d7fc0ecfd1572ecb183ad4
parente8d0708b0b6422d5eeb683c6443a67065aec1f20
Simplify WKCACFLayerRenderer's API

createRenderer/destroyRenderer are now hidden behind setHostWindow.
WKCACFLayerRendererClient::animationsStarted has been removed, as it
was never called. (The work it was supposed to do was already being
accomplished by WKCACFLayerRenderer::render telling each layer that
animations are starting.)

Fixes <http://webkit.org/b/52587> WKCACFLayerRenderer is hard to use

Reviewed by Chris Marrin.

Source/WebCore:

* platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp:
(WebCore::MediaPlayerPrivateFullscreenWindow::createWindow): Moved the
call to setHostWindow here from the WM_CREATE handler. The WM_CREATE
handler was causing the Direct3D device to be created, but MSDN says
you shouldn't create a device while handling WM_CREATE. Removed
no-longer-needed call to createRenderer (setHostWindow does this now)
and the never-needed call to setNeedsDisplay (we never draw into the
root layer; this was just creating an unnecessary backing store the
size of the screen!).
(WebCore::MediaPlayerPrivateFullscreenWindow::wndProc): Moved WM_CREATE
code, as described above. Removed call to destroyRenderer when handling
WM_DESTROY; setHostWindow does this now. Fixed up our WM_PAINT handler
to do a synchronous paint and to clear our dirty region, while I was in
here.

* platform/graphics/win/WKCACFLayerRenderer.cpp:
(WebCore::WKCACFLayerRenderer::~WKCACFLayerRenderer): Changed to call
setHostWindow instead of destroyRenderer; the former calls the latter
if needed.
(WebCore::WKCACFLayerRenderer::setHostWindow): Moved here from the
header file. Destroys our old renderer (i.e., IDirect3DDevice9) if
we're losing our window, or creates a renderer if we're gaining a
window.
(WebCore::WKCACFLayerRenderer::createRenderer): Updated for WKSI function rename.
(WebCore::WKCACFLayerRenderer::destroyRenderer): Changed to clear the
D3D device from our context before releasing the device.

* platform/graphics/win/WKCACFLayerRenderer.h: Removed
WKCACFLayerRendererClient::animationsStarted. Removed setNeedsDisplay.
Make createRenderer, destroyRenderer, and renderSoon private.

WebKit/win:

Update for WKCACFLayerRenderer changes

* WebView.cpp:
(WebView::WebViewWndProc): Removed call to layerRendererBecameVisible
when handling WM_SHOWWINDOW. All this did was try to create the
renderer, but it had already been created in setAcceleratedCompositing,
so wasn't needed.
(WebView::setAcceleratedCompositing): Removed call to createRenderer;
setHostWindow does this for us now.

* WebView.h: Removed animationsStarted and layerRendererBecameVisible.

WebKitLibraries:

Make it possible to both set and clear a wkCACFContext's D3D device

* win/include/WebKitSystemInterface/WebKitSystemInterface.h:
* win/lib/WebKitSystemInterface.lib:

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@75988 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/win/MediaPlayerPrivateFullscreenWindow.cpp
Source/WebCore/platform/graphics/win/WKCACFLayerRenderer.cpp
Source/WebCore/platform/graphics/win/WKCACFLayerRenderer.h
Source/WebKit/win/ChangeLog
Source/WebKit/win/WebView.cpp
Source/WebKit/win/WebView.h
WebKitLibraries/ChangeLog
WebKitLibraries/win/include/WebKitSystemInterface/WebKitSystemInterface.h
WebKitLibraries/win/lib/WebKitSystemInterface.lib