[Chromium] Avoid unnecessary full tile updates without breaking atomicity of commits.
https://bugs.webkit.org/show_bug.cgi?id=76740
Patch by David Reveman <reveman@chromium.org> on 2012-02-08
Reviewed by James Robinson.
Source/WebCore:
Allow the final batch of texture uploads to be performed without
allocating new textures and re-painting complete tiles.
This patch is tested by the following unit test:
- CCLayerTreeHostTestAtomicCommitWithPartialUpdate.runMultiThread
- TiledLayerChromiumTest.partialUpdates
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::UpdatableTile::UpdatableTile):
(UpdatableTile):
(WebCore::TiledLayerChromium::updateCompositorResources):
(WebCore):
(WebCore::TiledLayerChromium::tileOnlyNeedsPartialUpdate):
(WebCore::TiledLayerChromium::tileNeedsBufferedUpdate):
(WebCore::TiledLayerChromium::prepareToUpdateTiles):
* platform/graphics/chromium/TiledLayerChromium.h:
(TiledLayerChromium):
* platform/graphics/chromium/cc/CCLayerTreeHost.cpp:
(WebCore::CCLayerTreeHost::CCLayerTreeHost):
(WebCore::CCLayerTreeHost::initializeLayerRenderer):
(WebCore::CCLayerTreeHost::updateLayers):
(WebCore::CCLayerTreeHost::requestPartialTextureUpdate):
(WebCore):
* platform/graphics/chromium/cc/CCLayerTreeHost.h:
(WebCore::CCSettings::CCSettings):
(CCSettings):
(CCLayerTreeHost):
* platform/graphics/chromium/cc/CCProxy.h:
(CCProxy):
* platform/graphics/chromium/cc/CCSingleThreadProxy.cpp:
(WebCore::CCSingleThreadProxy::doCommit):
* platform/graphics/chromium/cc/CCSingleThreadProxy.h:
(WebCore::CCSingleThreadProxy::maxPartialTextureUpdates):
* platform/graphics/chromium/cc/CCTextureUpdater.cpp:
(WebCore::CCTextureUpdater::append):
(WebCore):
(WebCore::CCTextureUpdater::appendPartial):
(WebCore::CCTextureUpdater::hasMoreUpdates):
(WebCore::CCTextureUpdater::update):
(WebCore::CCTextureUpdater::clear):
* platform/graphics/chromium/cc/CCTextureUpdater.h:
(CCTextureUpdater):
* platform/graphics/chromium/cc/CCThreadProxy.cpp:
(WTF):
(WebCore::CCThreadProxy::scheduledActionUpdateMoreResources):
(WebCore::CCThreadProxy::maxPartialTextureUpdates):
* platform/graphics/chromium/cc/CCThreadProxy.h:
(CCThreadProxy):
Source/WebKit/chromium:
Add CCLayerTreeHostTestAtomicCommitWithPartialUpdate and
TiledLayerChromiumTest.partialUpdates tests that verifies
atomicity of commits with partial updates.
* tests/CCLayerTreeHostTest.cpp:
(WTF::CCLayerTreeHostTestAtomicCommit::CCLayerTreeHostTestAtomicCommit):
(WTF::CCLayerTreeHostTestAtomicCommit::beginTest):
(WTF::CCLayerTreeHostTestAtomicCommit::commitCompleteOnCCThread):
(WTF::CCLayerTreeHostTestAtomicCommit::layout):
(CCLayerTreeHostTestAtomicCommit):
(CCLayerTreeHostTestAtomicCommitWithPartialUpdate):
(WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::CCLayerTreeHostTestAtomicCommitWithPartialUpdate):
(WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::beginTest):
(WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::commitCompleteOnCCThread):
(WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::drawLayersOnCCThread):
(WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::layout):
(WTF::CCLayerTreeHostTestAtomicCommitWithPartialUpdate::afterTest):
(WTF):
(WTF::TEST_F):
* tests/TiledLayerChromiumTest.cpp:
(WTF::FakeLayerTextureUpdater::Texture::Texture):
(WTF::FakeLayerTextureUpdater::Texture::updateRect):
(Texture):
(WTF::FakeLayerTextureUpdater::FakeLayerTextureUpdater):
(FakeLayerTextureUpdater):
(WTF::FakeLayerTextureUpdater::updateCount):
(WTF::FakeLayerTextureUpdater::clearUpdateCount):
(WTF::FakeLayerTextureUpdater::updateRect):
(WTF::FakeLayerTextureUpdater::createTexture):
(FakeTiledLayerChromium):
(WTF::TEST):
(WTF):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@107177
268f45cc-cd09-0410-ab3c-
d52691b4dbfc