[chromium] Avoid pushing dirty tiles to the impl layer
authorjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Nov 2011 22:22:34 +0000 (22:22 +0000)
committerjamesr@google.com <jamesr@google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Nov 2011 22:22:34 +0000 (22:22 +0000)
commit24964d2d0dfb2675b9a1fe6530f43220ad693234
tree0a535df37a7baf1e81c369f86a0f2931fac7c7b7
parent2fc6ce09077927bb4c2e2c10aa0d580b4847a8a1
[chromium] Avoid pushing dirty tiles to the impl layer
https://bugs.webkit.org/show_bug.cgi?id=72765

Reviewed by Kenneth Russell.

Source/WebCore:

If a tile has invalidations at pushPropertiesTo, then we know the contents of that tile are no longer valid even
if they still have valid backing textures. This avoids pushing that texture to the impl side so it is not
displayed to the user. The texture is still kept around (managed by the TextureManager) so that when we later do
decide to update the contents for that tile we can use partial results if they are still valid.

Covered by new unit test in TiledLayerChromiumTest.cpp

* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::UpdatableTile::isDirty):
(WebCore::TiledLayerChromium::updateTileSizeAndTilingOption):
(WebCore::TiledLayerChromium::setTileSize):
(WebCore::TiledLayerChromium::setLayerTreeHost):
(WebCore::TiledLayerChromium::createTiler):
(WebCore::TiledLayerChromium::updateCompositorResources):
(WebCore::TiledLayerChromium::pushPropertiesTo):
* platform/graphics/chromium/TiledLayerChromium.h:
(WebCore::TiledLayerChromium::setTextureFormat):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp:
(WebCore::CCTiledLayerImpl::hasTileAt):
(WebCore::CCTiledLayerImpl::drawTiles):
* platform/graphics/chromium/cc/CCTiledLayerImpl.h:

Source/WebKit/chromium:

Add unit test for TiledLayerChromium's tile pushing behavior. Requires a fair amount of fake classes. If these
fakes are useful in other tests, they should be moved to a shared location.

* WebKit.gypi:
* tests/TiledLayerChromiumTest.cpp: Added.
(::FakeTextureAllocator::createTexture):
(::FakeTextureAllocator::deleteTexture):
(::FakeLayerTextureUpdater::FakeLayerTextureUpdater):
(::FakeLayerTextureUpdater::~FakeLayerTextureUpdater):
(::FakeLayerTextureUpdater::orientation):
(::FakeLayerTextureUpdater::sampledTexelFormat):
(::FakeLayerTextureUpdater::prepareToUpdate):
(::FakeLayerTextureUpdater::updateTextureRect):
(::FakeCCTiledLayerImpl::FakeCCTiledLayerImpl):
(::FakeCCTiledLayerImpl::~FakeCCTiledLayerImpl):
(::FakeCCTiledLayerImpl::hasTileAt):
(::FakeTiledLayerChromium::FakeTiledLayerChromium):
(::FakeTiledLayerChromium::~FakeTiledLayerChromium):
(::FakeTiledLayerChromium::invalidateRect):
(::FakeTiledLayerChromium::prepareToUpdate):
(::FakeTiledLayerChromium::textureManager):
(::FakeTiledLayerChromium::createTextureUpdater):
(::FakeTiledLayerChromium::textureUpdater):
(::TEST):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@100958 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/WebKit.gypi
Source/WebKit/chromium/tests/TiledLayerChromiumTest.cpp [new file with mode: 0644]