Source/WebCore: [Chromium] Improve tile invalidation
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 07:40:05 +0000 (07:40 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Dec 2011 07:40:05 +0000 (07:40 +0000)
commitb25790b4f520abb9f3dae0e4e4f6a0292ee1da69
tree141ad32ada5dea459be1d0d279aea1bb5c283df8
parente1871565fbb7ae588f651bf5769888bc51391acb
Source/WebCore: [Chromium] Improve tile invalidation
https://bugs.webkit.org/show_bug.cgi?id=71872

Patch by David Reveman <reveman@chromium.org> on 2011-11-30
Reviewed by James Robinson.

Virtualize LayerChromium::setNeedsDisplay so that dirty rectangles can
be handled directly by the TiledLayerChromium class. Replace
LayerChromium::dirtyRect() with LayerChromium::needsDisplay() and
remove unnecessary union of dirty rectangles. By invalidating existing
tiles using the initial dirty rectangles instead of their union we
avoid a large amount of unnecessary tile updates.

Update LayerChromiumTest.

* platform/graphics/chromium/Canvas2DLayerChromium.cpp:
(WebCore::Canvas2DLayerChromium::updateCompositorResources):
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerChromium::paintContentsIfDirty):
* platform/graphics/chromium/GraphicsLayerChromium.cpp:
(WebCore::GraphicsLayerChromium::setNeedsDisplayInRect):
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerChromium::setContents):
(WebCore::ImageLayerChromium::paintContentsIfDirty):
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::LayerChromium):
(WebCore::LayerChromium::setBounds):
(WebCore::LayerChromium::setNeedsDisplayRect):
* platform/graphics/chromium/LayerChromium.h:
(WebCore::LayerChromium::setNeedsDisplay):
(WebCore::LayerChromium::needsDisplay):
* platform/graphics/chromium/TiledLayerChromium.cpp:
(WebCore::TiledLayerChromium::setNeedsDisplayRect):
(WebCore::TiledLayerChromium::invalidateRect):
* platform/graphics/chromium/TiledLayerChromium.h:
* platform/graphics/chromium/VideoLayerChromium.cpp:
(WebCore::VideoLayerChromium::updateCompositorResources):
* platform/graphics/chromium/WebGLLayerChromium.cpp:
(WebCore::WebGLLayerChromium::updateCompositorResources):

Source/WebKit/chromium: [Chromium] Improve tile invalidation.
https://bugs.webkit.org/show_bug.cgi?id=71872

Patch by David Reveman <reveman@chromium.org> on 2011-11-30
Reviewed by James Robinson.

Remove public API function WebContentLayer::invalidRect(). Add new
test case to
LayerChromiumTest.checkSetNeedsDisplayCausesCorrectBehavior that
verifies that calling setNeedsDisplay() on a LayerChromium with
empty bounds is handled correctly.

* public/WebContentLayer.h:
* src/WebContentLayer.cpp:
(WebKit::WebContentLayer::invalidateRect):
* src/WebMediaPlayerClientImpl.cpp:
(WebKit::WebMediaPlayerClientImpl::repaint):
* tests/LayerChromiumTest.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@101623 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/chromium/Canvas2DLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h
Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/WebGLLayerChromium.cpp
Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/public/WebContentLayer.h
Source/WebKit/chromium/src/WebContentLayer.cpp
Source/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
Source/WebKit/chromium/tests/LayerChromiumTest.cpp