Patch by James Robinson <jamesr@chromium.org> on 2011-07-13
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jul 2011 23:14:57 +0000 (23:14 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 13 Jul 2011 23:14:57 +0000 (23:14 +0000)
commit0b5b4dcaa65840913421fd3b8ad9ec55eb58e3a6
tree723ecdca71ee74ba808614efdd3f91b82e459369
parent266d848e8e5c7cb98c3606455e1fa3522f9eff35
Patch by James Robinson <jamesr@chromium.org> on 2011-07-13
Reviewed by Kenneth Russell.

[chromium] Move draw implementation for ContentLayerChromium/ImageLayerChromium to the appropriate CCLayerImpl subclass
https://bugs.webkit.org/show_bug.cgi?id=58833

Adds a TiledLayerChromium class to handle the tiling logic shared by ContentLayerChromium and ImageLayerChromium
so that they can be siblings in the class hierarchy instead of children. Also adds a CCTiledLayerImpl to handle
the drawing responsibilities for tiled layers.

TiledLayerChromium maintains a tiler, tiling options, and calculates the tiling transform. Subclasses are
responsible for providing an appropriate texture updater implementation. CCTiledLayerImpl takes the tiler,
tiling transform and layer properties and draws the layer.  Longer term it'd be better of the CCTiledLayerImpl
owned the tiler and the TiledLayerChromium only owned an updater, but getting there will require changing the
way tile eviction works.

* WebCore.gypi:
* platform/graphics/chromium/ContentLayerChromium.cpp:
(WebCore::ContentLayerChromium::ContentLayerChromium):
(WebCore::ContentLayerChromium::paintContentsIfDirty):
(WebCore::ContentLayerChromium::drawsContent):
* platform/graphics/chromium/ContentLayerChromium.h:
(WebCore::ContentLayerChromium::textureUpdater):
* platform/graphics/chromium/ImageLayerChromium.cpp:
(WebCore::ImageLayerChromium::ImageLayerChromium):
(WebCore::ImageLayerChromium::cleanupResources):
(WebCore::ImageLayerChromium::paintContentsIfDirty):
(WebCore::ImageLayerChromium::textureUpdater):
(WebCore::ImageLayerChromium::contentBounds):
(WebCore::ImageLayerChromium::drawsContent):
(WebCore::ImageLayerChromium::createTextureUpdaterIfNeeded):
* platform/graphics/chromium/ImageLayerChromium.h:
* platform/graphics/chromium/LayerChromium.cpp:
(WebCore::LayerChromium::pushPropertiesTo):
(WebCore::LayerChromium::ccLayerImpl):
* platform/graphics/chromium/LayerChromium.h:
* platform/graphics/chromium/LayerRendererChromium.cpp:
(WebCore::LayerRendererChromium::drawRootLayer):
* platform/graphics/chromium/LayerTilerChromium.cpp:
(WebCore::LayerTilerChromium::updateRect):
(WebCore::LayerTilerChromium::draw):
(WebCore::LayerTilerChromium::drawTiles):
* platform/graphics/chromium/LayerTilerChromium.h:
* platform/graphics/chromium/TiledLayerChromium.cpp: Added.
(WebCore::TiledLayerChromium::TiledLayerChromium):
(WebCore::TiledLayerChromium::~TiledLayerChromium):
(WebCore::TiledLayerChromium::createCCLayerImpl):
(WebCore::TiledLayerChromium::cleanupResources):
(WebCore::TiledLayerChromium::setLayerRenderer):
(WebCore::TiledLayerChromium::updateTileSizeAndTilingOption):
(WebCore::TiledLayerChromium::drawsContent):
(WebCore::TiledLayerChromium::createTilerIfNeeded):
(WebCore::TiledLayerChromium::updateCompositorResources):
(WebCore::TiledLayerChromium::setTilingOption):
(WebCore::TiledLayerChromium::setIsMask):
(WebCore::TiledLayerChromium::tilingTransform):
(WebCore::TiledLayerChromium::pushPropertiesTo):
(WebCore::writeIndent):
(WebCore::TiledLayerChromium::dumpLayerProperties):
* platform/graphics/chromium/TiledLayerChromium.h: Added.
* platform/graphics/chromium/cc/CCLayerImpl.cpp:
(WebCore::CCLayerImpl::draw):
* platform/graphics/chromium/cc/CCLayerImpl.h:
(WebCore::CCLayerImpl::setDrawsContent):
(WebCore::CCLayerImpl::drawsContent):
* platform/graphics/chromium/cc/CCTiledLayerImpl.cpp: Added.
(WebCore::CCTiledLayerImpl::CCTiledLayerImpl):
(WebCore::CCTiledLayerImpl::~CCTiledLayerImpl):
(WebCore::CCTiledLayerImpl::draw):
(WebCore::CCTiledLayerImpl::bindContentsTexture):
(WebCore::CCTiledLayerImpl::dumpLayerProperties):
* platform/graphics/chromium/cc/CCTiledLayerImpl.h: Added.
(WebCore::CCTiledLayerImpl::create):
(WebCore::CCTiledLayerImpl::setTilingTransform):
(WebCore::CCTiledLayerImpl::setTiler):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@90963 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.gypi
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/ContentLayerChromium.h
Source/WebCore/platform/graphics/chromium/ImageLayerChromium.cpp
Source/WebCore/platform/graphics/chromium/ImageLayerChromium.h
Source/WebCore/platform/graphics/chromium/LayerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerChromium.h
Source/WebCore/platform/graphics/chromium/LayerRendererChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerTextureUpdater.h
Source/WebCore/platform/graphics/chromium/LayerTilerChromium.cpp
Source/WebCore/platform/graphics/chromium/LayerTilerChromium.h
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/TiledLayerChromium.h [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.cpp
Source/WebCore/platform/graphics/chromium/cc/CCLayerImpl.h
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.cpp [new file with mode: 0644]
Source/WebCore/platform/graphics/chromium/cc/CCTiledLayerImpl.h [new file with mode: 0644]