diff options
author | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-17 11:43:05 +0000 |
---|---|---|
committer | skyostil@chromium.org <skyostil@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-17 11:43:05 +0000 |
commit | f657d5140d661aca265c0350772d9fa78a0c8316 (patch) | |
tree | 5496bfe25afabfc267dab4ef812e3df2ad7678a0 | |
parent | c7f4d795a59d8ae355e926324fda81d918736ace (diff) | |
download | chromium_src-f657d5140d661aca265c0350772d9fa78a0c8316.zip chromium_src-f657d5140d661aca265c0350772d9fa78a0c8316.tar.gz chromium_src-f657d5140d661aca265c0350772d9fa78a0c8316.tar.bz2 |
Add scrolling related getters to WebLayerImpl
This patch adds a number of scrolling related getters to WebLayerImpl
and LayerChromium for testing purposes. They will be used by the
ScrollingCoordinatorChromium test (http://webkit.org/b/96657).
Note that the WebLayerImpl getters aren't marked with OVERRIDE because
the corresponding changes to WebLayer aren't in place yet. This will be
corrected later.
BUG=none
Review URL: https://chromiumcodereview.appspot.com/10909233
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157101 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | cc/LayerChromium.h | 8 | ||||
-rw-r--r-- | webkit/compositor_bindings/WebLayerImpl.cpp | 39 | ||||
-rw-r--r-- | webkit/compositor_bindings/WebLayerImpl.h | 7 |
3 files changed, 53 insertions, 1 deletions
diff --git a/cc/LayerChromium.h b/cc/LayerChromium.h index fed90bf..40c6da3 100644 --- a/cc/LayerChromium.h +++ b/cc/LayerChromium.h @@ -134,11 +134,17 @@ public: void setScrollable(bool); bool scrollable() const { return m_scrollable; } + void setShouldScrollOnMainThread(bool); + bool shouldScrollOnMainThread() const { return m_shouldScrollOnMainThread; } + void setHaveWheelEventHandlers(bool); - const Region& nonFastScrollableRegion() { return m_nonFastScrollableRegion; } + bool haveWheelEventHandlers() const { return m_haveWheelEventHandlers; } + void setNonFastScrollableRegion(const Region&); void setNonFastScrollableRegionChanged() { m_nonFastScrollableRegionChanged = true; } + const Region& nonFastScrollableRegion() const { return m_nonFastScrollableRegion; } + void setLayerScrollClient(WebKit::WebLayerScrollClient* layerScrollClient) { m_layerScrollClient = layerScrollClient; } void setDrawCheckerboardForMissingTiles(bool); diff --git a/webkit/compositor_bindings/WebLayerImpl.cpp b/webkit/compositor_bindings/WebLayerImpl.cpp index 0d86f19..6bd4f21 100644 --- a/webkit/compositor_bindings/WebLayerImpl.cpp +++ b/webkit/compositor_bindings/WebLayerImpl.cpp @@ -348,21 +348,41 @@ void WebLayerImpl::setMaxScrollPosition(WebSize maxScrollPosition) m_layer->setMaxScrollPosition(convert(maxScrollPosition)); } +WebSize WebLayerImpl::maxScrollPosition() const +{ + return convert(m_layer->maxScrollPosition()); +} + void WebLayerImpl::setScrollable(bool scrollable) { m_layer->setScrollable(scrollable); } +bool WebLayerImpl::scrollable() const +{ + return m_layer->scrollable(); +} + void WebLayerImpl::setHaveWheelEventHandlers(bool haveWheelEventHandlers) { m_layer->setHaveWheelEventHandlers(haveWheelEventHandlers); } +bool WebLayerImpl::haveWheelEventHandlers() const +{ + return m_layer->haveWheelEventHandlers(); +} + void WebLayerImpl::setShouldScrollOnMainThread(bool shouldScrollOnMainThread) { m_layer->setShouldScrollOnMainThread(shouldScrollOnMainThread); } +bool WebLayerImpl::shouldScrollOnMainThread() const +{ + return m_layer->shouldScrollOnMainThread(); +} + void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) { WebCore::Region region; @@ -374,16 +394,35 @@ void WebLayerImpl::setNonFastScrollableRegion(const WebVector<WebRect>& rects) } +WebVector<WebRect> WebLayerImpl::nonFastScrollableRegion() const +{ + Vector<WebCore::IntRect> regionRects = m_layer->nonFastScrollableRegion().rects(); + WebVector<WebRect> result(regionRects.size()); + for (size_t i = 0; i < regionRects.size(); ++i) + result[i] = convert(regionRects[i]); + return result; +} + void WebLayerImpl::setIsContainerForFixedPositionLayers(bool enable) { m_layer->setIsContainerForFixedPositionLayers(enable); } +bool WebLayerImpl::isContainerForFixedPositionLayers() const +{ + return m_layer->isContainerForFixedPositionLayers(); +} + void WebLayerImpl::setFixedToContainerLayer(bool enable) { m_layer->setFixedToContainerLayer(enable); } +bool WebLayerImpl::fixedToContainerLayer() const +{ + return m_layer->fixedToContainerLayer(); +} + void WebLayerImpl::setScrollClient(WebLayerScrollClient* scrollClient) { m_layer->setLayerScrollClient(scrollClient); diff --git a/webkit/compositor_bindings/WebLayerImpl.h b/webkit/compositor_bindings/WebLayerImpl.h index e6bcefe..013d7a9 100644 --- a/webkit/compositor_bindings/WebLayerImpl.h +++ b/webkit/compositor_bindings/WebLayerImpl.h @@ -75,12 +75,19 @@ public: virtual void setScrollPosition(WebPoint) OVERRIDE; virtual WebPoint scrollPosition() const OVERRIDE; virtual void setMaxScrollPosition(WebSize) OVERRIDE; + virtual WebSize maxScrollPosition() const; virtual void setScrollable(bool) OVERRIDE; + virtual bool scrollable() const; virtual void setHaveWheelEventHandlers(bool) OVERRIDE; + virtual bool haveWheelEventHandlers() const; virtual void setShouldScrollOnMainThread(bool) OVERRIDE; + virtual bool shouldScrollOnMainThread() const; virtual void setNonFastScrollableRegion(const WebVector<WebRect>&) OVERRIDE; + virtual WebVector<WebRect> nonFastScrollableRegion() const; virtual void setIsContainerForFixedPositionLayers(bool) OVERRIDE; + virtual bool isContainerForFixedPositionLayers() const; virtual void setFixedToContainerLayer(bool) OVERRIDE; + virtual bool fixedToContainerLayer() const; virtual void setScrollClient(WebLayerScrollClient*) OVERRIDE; cc::LayerChromium* layer() const; |