[Chromium] Avoid unnecessary full tile updates without breaking atomicity of commits.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 05:26:00 +0000 (05:26 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 9 Feb 2012 05:26:00 +0000 (05:26 +0000)
commit3769bf8b35532523a502e223988aa772c800a7dd
tree2525f0d04c49a5b8bdab1bf524e5932a8785c021
parentfe85222808be32403acbe52282badd7c06d9745b
[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
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerTreeHost.h
Source/WebCore/platform/graphics/chromium/cc/CCProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCSingleThreadProxy.h
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTextureUpdater.h
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.cpp
Source/WebCore/platform/graphics/chromium/cc/CCThreadProxy.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/tests/CCLayerTreeHostTest.cpp
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp