diff options
author | Chris Craik <ccraik@google.com> | 2011-12-01 17:12:06 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2011-12-01 17:12:06 -0800 |
commit | 2b3fa9f062cc807eff2802da4d7eb075cc6023fc (patch) | |
tree | adf5e3ef9e7b0eb1f5e2cd0d1ec2d6d8aa455437 /Source/WebCore | |
parent | 931e90d171935ef706b6906c5867a51fc491a83d (diff) | |
parent | f286c7d338f3c0f398ee27abe1d37d670c51dbbb (diff) | |
download | external_webkit-2b3fa9f062cc807eff2802da4d7eb075cc6023fc.zip external_webkit-2b3fa9f062cc807eff2802da4d7eb075cc6023fc.tar.gz external_webkit-2b3fa9f062cc807eff2802da4d7eb075cc6023fc.tar.bz2 |
am f286c7d3: Merge "Scroll position now passed to all layers" into ics-mr1
* commit 'f286c7d338f3c0f398ee27abe1d37d670c51dbbb':
Scroll position now passed to all layers
Diffstat (limited to 'Source/WebCore')
5 files changed, 28 insertions, 5 deletions
diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp index cf91c00..1850509 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.cpp +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.cpp @@ -150,8 +150,10 @@ void GLWebViewState::setBaseLayer(BaseLayerAndroid* layer, const SkRegion& inval TilesManager::instance()->setShowVisualIndicator(showVisualIndicator); } -void GLWebViewState::scrolledLayer(ScrollableLayerAndroid*) +void GLWebViewState::scrollLayer(int layerId, int x, int y) { + m_treeManager.updateScrollableLayer(layerId, x, y); + // TODO: only inval the area of the scrolled layer instead of // doing a fullInval() if (m_layersRenderingMode == kSingleSurfaceRendering) diff --git a/Source/WebCore/platform/graphics/android/GLWebViewState.h b/Source/WebCore/platform/graphics/android/GLWebViewState.h index cffd28f..8d89704 100644 --- a/Source/WebCore/platform/graphics/android/GLWebViewState.h +++ b/Source/WebCore/platform/graphics/android/GLWebViewState.h @@ -248,7 +248,7 @@ public: }; LayersRenderingMode layersRenderingMode() { return m_layersRenderingMode; } - void scrolledLayer(ScrollableLayerAndroid*); + void scrollLayer(int layerId, int x, int y); void invalRegion(const SkRegion& region); diff --git a/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp index 2643d2c..3c2ced5 100644 --- a/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/ScrollableLayerAndroid.cpp @@ -22,9 +22,6 @@ bool ScrollableLayerAndroid::scrollTo(int x, int y) setPosition(m_scrollLimits.fLeft - newX, m_scrollLimits.fTop - newY); - if (state()) - state()->scrolledLayer(this); - return true; } diff --git a/Source/WebCore/platform/graphics/android/TreeManager.cpp b/Source/WebCore/platform/graphics/android/TreeManager.cpp index fe55df8..71e5f6b 100644 --- a/Source/WebCore/platform/graphics/android/TreeManager.cpp +++ b/Source/WebCore/platform/graphics/android/TreeManager.cpp @@ -28,6 +28,7 @@ #include "Layer.h" #include "BaseLayerAndroid.h" +#include "ScrollableLayerAndroid.h" #include "TilesManager.h" #include <cutils/log.h> @@ -175,6 +176,23 @@ void TreeManager::updateWithTree(Layer* newTree, bool brandNew) m_paintingTree->setIsPainting(m_drawingTree); } +void TreeManager::updateScrollableLayerInTree(Layer* tree, int layerId, int x, int y) +{ + LayerAndroid* layer; + if (tree && tree->countChildren()) { + layer = static_cast<LayerAndroid*>(tree->getChild(0))->findById(layerId); + if (layer && layer->contentIsScrollable()) + static_cast<ScrollableLayerAndroid*>(layer)->scrollTo(x, y); + } +} + +void TreeManager::updateScrollableLayer(int layerId, int x, int y) +{ + updateScrollableLayerInTree(m_queuedTree, layerId, x, y); + updateScrollableLayerInTree(m_paintingTree, layerId, x, y); + updateScrollableLayerInTree(m_drawingTree, layerId, x, y); +} + bool TreeManager::drawGL(double currentTime, IntRect& viewRect, SkRect& visibleRect, float scale, bool enterFastSwapMode, bool* treesSwappedPtr, bool* newTreeHasAnimPtr, diff --git a/Source/WebCore/platform/graphics/android/TreeManager.h b/Source/WebCore/platform/graphics/android/TreeManager.h index d2e10c8..83d5300 100644 --- a/Source/WebCore/platform/graphics/android/TreeManager.h +++ b/Source/WebCore/platform/graphics/android/TreeManager.h @@ -28,6 +28,7 @@ #include "TestExport.h" #include <utils/threads.h> +#include "PerformanceMonitor.h" class Layer; class SkRect; @@ -46,6 +47,8 @@ public: void updateWithTree(Layer* tree, bool brandNew); + void updateScrollableLayer(int layerId, int x, int y); + bool drawGL(double currentTime, IntRect& viewRect, SkRect& visibleRect, float scale, bool enterFastSwapMode, bool* treesSwappedPtr, bool* newTreeHasAnimPtr, @@ -60,6 +63,8 @@ public: int baseContentHeight(); private: + static void updateScrollableLayerInTree(Layer* tree, int layerId, int x, int y); + void swap(); void clearTrees(); @@ -70,6 +75,7 @@ private: Layer* m_queuedTree; bool m_fastSwapMode; + PerformanceMonitor m_perf; }; } // namespace WebCore |