[chromium] Hook WebCompositor interface for input events up to the compositor proper
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 18:46:10 +0000 (18:46 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 5 Oct 2011 18:46:10 +0000 (18:46 +0000)
commit31835dadaa8dd92485a28d675152e7e81a4a87c6
treebc804a496c72d78a12fb72aa3529a78f91fdfa6e
parent082c883d1ef56634b09a4d51f8116acb8426c90b
[chromium] Hook WebCompositor interface for input events up to the compositor proper
https://bugs.webkit.org/show_bug.cgi?id=69394

Reviewed by Darin Fisher.

Source/WebCore:

This wires up WebCompositorImpl to the compositor itself so we can handle input events as scrolls on the
compositor thread, although it doesn't actually wire up any input events to actual scrolling. The way this
works:

- CCThreadProxy owns an adapter that implements the CCScrollController interface
- CCThreadProxy owns a CCInputHandler, which is implemented by WebKit::WebCompositorImpl, that has a pointer to
the adapter
- CCLayerTreeHost has an identifier (an int) for its WebKit::WebCompositorImpl that's initialized in
initializeLayerRenderer. This identifier is exposed to its owner (WebKit::WebViewImpl) so the embedder can wire
up the threading logic behind the scenes.

This is just plumbing, no change in behavior.

* WebCore.gypi:
* platform/graphics/chromium/cc/CCInputHandler.h: Added.
(WebCore::CCInputHandler::~CCInputHandler):
(WebCore::CCInputHandler::CCInputHandler):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::initialize):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCLayerTreeHost::compositorIdentifier):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp:
(WebCore::CCLayerTreeHostImpl::scrollRootLayer):
* platform/graphics/chromium/cc/CCLayerTreeHostImpl.h:
* platform/graphics/chromium/cc/CCProxy.h:
* platform/graphics/chromium/cc/CCScrollController.h: Added.
(WebCore::CCScrollController::CCScrollController):
(WebCore::CCScrollController::~CCScrollController):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::CCSingleThreadProxy):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(WebCore::CCSingleThreadProxy::compositorIdentifier):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WebCore::CCThreadProxyScrollControllerAdapter::create):
(WebCore::CCThreadProxyScrollControllerAdapter::~CCThreadProxyScrollControllerAdapter):
(WebCore::CCThreadProxyScrollControllerAdapter::scrollRootLayer):
(WebCore::CCThreadProxyScrollControllerAdapter::CCThreadProxyScrollControllerAdapter):
(WebCore::CCThreadProxy::CCThreadProxy):
(WebCore::CCThreadProxy::initializeLayerRenderer):
(WebCore::CCThreadProxy::compositorIdentifier):
(WebCore::CCThreadProxy::beginFrameAndCommit):
(WebCore::CCThreadProxy::initializeLayerRendererOnCCThread):
(WebCore::CCThreadProxy::layerTreeHostClosedOnCCThread):
* platform/graphics/chromium/cc/CCThreadProxy.h:

Source/WebKit/chromium:

This teaches WebCompositorImpl about WebCore::CCInputHandler, which WebCompositorImpl implements, and
CCScrollController, which WebCompositorImpl will use in the future to do actual scrolling. One thing that is a
bit unusual here is WebCore::CCInputHandler::create() which is defined in WebCompositorImpl.cpp.  This is
because we need a WebKit object (WebKit::WebCompositorImpl) to be owned by a WebCore object (WebCore::CCThreadProxy).
The WebCore side only needs to know about the interface, CCInputHandler, but the actual implementation has to
live in WebKit in order to know about the concrete type.

* src/WebCompositorImpl.cpp:
(WebCore::CCInputHandler::create):
(WebKit::WebCompositor::fromIdentifier):
(WebKit::WebCompositorImpl::fromIdentifier):
(WebKit::WebCompositorImpl::WebCompositorImpl):
(WebKit::WebCompositorImpl::~WebCompositorImpl):
(WebKit::WebCompositorImpl::setClient):
(WebKit::WebCompositorImpl::handleInputEvent):
(WebKit::WebCompositorImpl::identifier):
* src/WebCompositorImpl.h:
(WebKit::WebCompositorImpl::create):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setIsAcceleratedCompositingActive):
* src/WebViewImpl.h:
* tests/WebCompositorImplTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@96736 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/cc/CCInputHandler.h [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHostImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCScrollController.h [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebCompositorImpl.cpp
Source/WebKit/chromium/src/WebCompositorImpl.h
Source/WebKit/chromium/src/WebViewImpl.cpp
Source/WebKit/chromium/src/WebViewImpl.h
Source/WebKit/chromium/tests/WebCompositorImplTest.cpp