[Threaded Compositor] Modernize and simplify threaded compositor code
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2016 07:52:25 +0000 (07:52 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 Jun 2016 07:52:25 +0000 (07:52 +0000)
commit67c4fe10a911b4c95c6918b998bd952a58691c58
tree17f09bf183fdab2e10d81a0fff61a08988a3dd2a
parentdf4daa336ae0fb5653fd750f31bbf80e4c8b34bf
[Threaded Compositor] Modernize and simplify threaded compositor code
https://bugs.webkit.org/show_bug.cgi?id=158615

Reviewed by Žan Doberšek.

* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp:
(WebKit::CompositingRunLoop::performTask): Use NoncopyableFunction.
(WebKit::CompositingRunLoop::performTaskSync): Ditto.
(WebKit::CompositingRunLoop::startUpdateTimer): Just renamed to start instead of set.
(WebKit::CompositingRunLoop::run): Expose run/stop methods instead of the internal RunLoop object.
(WebKit::CompositingRunLoop::stop): Also stop the update timer instead of relying on the caller to do it.
(WebKit::CompositingRunLoop::setUpdateTimer): Deleted.
(WebKit::CompositingRunLoop::stopUpdateTimer): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h:
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp:
(WebKit::ThreadedCompositor::setNativeSurfaceHandleForCompositing): Protects this directly in lambda capture.
(WebKit::ThreadedCompositor::setDeviceScaleFactor): Ditto.
(WebKit::ThreadedCompositor::didChangeViewportSize): Ditto.
(WebKit::ThreadedCompositor::didChangeViewportAttribute): Ditto.
(WebKit::ThreadedCompositor::didChangeContentsSize): Ditto.
(WebKit::ThreadedCompositor::scrollTo): Ditto.
(WebKit::ThreadedCompositor::scrollBy): Ditto.
(WebKit::ThreadedCompositor::updateViewport): Use startUpdateTimer().
(WebKit::ThreadedCompositor::scheduleDisplayImmediately): Ditto.
(WebKit::ThreadedCompositor::didChangeVisibleRect): Improve lambda captures.
(WebKit::ThreadedCompositor::renderLayerTree): Use m_viewportController directly.
(WebKit::ThreadedCompositor::createCompositingThread): Use createThread() version that receives a function.
(WebKit::ThreadedCompositor::runCompositingThread): Use run method and don't stop the update timer when the run
loop finishes.
(WebKit::ThreadedCompositor::terminateCompositingThread): Use stop method.
(WebKit::ThreadedCompositor::ThreadedCompositor): Deleted.
(WebKit::ThreadedCompositor::compositingThreadEntry): Deleted.
* Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h:
(WebKit::ThreadedCompositor::viewportController): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@202038 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.cpp
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/CompositingRunLoop.h
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.cpp
Source/WebKit2/Shared/CoordinatedGraphics/threadedcompositor/ThreadedCompositor.h