diff options
author | Nicolas Roard <nicolas@android.com> | 2010-02-19 15:34:04 +0000 |
---|---|---|
committer | Nicolas Roard <nicolas@android.com> | 2010-02-19 16:10:31 +0000 |
commit | 8ff99dc8bb0a50c117e493be7f1fba4668c2cf91 (patch) | |
tree | 6b91a5d32afea2a14f80aa81b4d6cee73fe0375c /WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | |
parent | ff38e49a48fa4d5f7810ce815794d262dabf5183 (diff) | |
download | external_webkit-8ff99dc8bb0a50c117e493be7f1fba4668c2cf91.zip external_webkit-8ff99dc8bb0a50c117e493be7f1fba4668c2cf91.tar.gz external_webkit-8ff99dc8bb0a50c117e493be7f1fba4668c2cf91.tar.bz2 |
Set the fixed position values when changed via setPosition()
Fix Bug:2450033
Diffstat (limited to 'WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 9470bb9..7f6ffe4 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -122,19 +122,10 @@ GraphicsLayerAndroid::GraphicsLayerAndroid(GraphicsLayerClient* client) : m_currentPosition(0, 0) { m_contentLayer = new LayerAndroid(true); - if (client) { - RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(client); + if (m_client) { + RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_client); RenderLayer* renderLayer = backing->owningLayer(); m_contentLayer->setIsRootLayer(renderLayer->isRootLayer()); - RenderView* view = static_cast<RenderView*>(renderLayer->renderer()); - if (view->isPositioned() && view->style()->position() == FixedPosition) { - SkLength left, top, right, bottom; - left = convertLength(view->style()->left()); - top = convertLength(view->style()->top()); - right = convertLength(view->style()->right()); - bottom = convertLength(view->style()->bottom()); - m_contentLayer->setFixedPosition(left, top, right, bottom); - } } gDebugGraphicsLayerAndroidInstances++; } @@ -227,6 +218,23 @@ void GraphicsLayerAndroid::needsSyncChildren() askForSync(); } +void GraphicsLayerAndroid::updateFixedPosition() +{ + if (m_client) { + RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_client); + RenderLayer* renderLayer = backing->owningLayer(); + RenderView* view = static_cast<RenderView*>(renderLayer->renderer()); + if (view->isPositioned() && view->style()->position() == FixedPosition) { + SkLength left, top, right, bottom; + left = convertLength(view->style()->left()); + top = convertLength(view->style()->top()); + right = convertLength(view->style()->right()); + bottom = convertLength(view->style()->bottom()); + m_contentLayer->setFixedPosition(left, top, right, bottom); + } + } +} + void GraphicsLayerAndroid::setPosition(const FloatPoint& point) { m_currentPosition = point; @@ -236,6 +244,7 @@ void GraphicsLayerAndroid::setPosition(const FloatPoint& point) this, point.x(), point.y(), m_currentPosition.x(), m_currentPosition.y(), m_anchorPoint.x(), m_anchorPoint.y(), m_size.width(), m_size.height()); #endif + updateFixedPosition(); askForSync(); } @@ -448,8 +457,8 @@ bool GraphicsLayerAndroid::repaint(const FloatRect& rect) TLOG("(%x) repaint(%.2f,%.2f,%.2f,%.2f) on (%.2f,%.2f) contentlayer(%.2f,%.2f,%.2f,%.2f)paintGraphicsLayer called!", this, rect.x(), rect.y(), rect.width(), rect.height(), m_size.width(), m_size.height(), - m_contentLayer->position().x(), - m_contentLayer->position().y(), + m_contentLayer->position().fX, + m_contentLayer->position().fY, m_contentLayer->size().width(), m_contentLayer->size().height()); } |