diff options
author | Nicolas Roard <nicolasroard@google.com> | 2012-03-07 16:13:39 -0800 |
---|---|---|
committer | Nicolas Roard <nicolasroard@google.com> | 2012-03-08 11:41:31 -0800 |
commit | ce76304e955cb279f6f237a84c0ba4fd40a2b2ba (patch) | |
tree | aa30a37cb34c8096ae33dd512c2da9fac86cb06d /Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | |
parent | 47b8a953ab1b71113b605fd84489f63938bd7dd7 (diff) | |
download | external_webkit-ce76304e955cb279f6f237a84c0ba4fd40a2b2ba.zip external_webkit-ce76304e955cb279f6f237a84c0ba4fd40a2b2ba.tar.gz external_webkit-ce76304e955cb279f6f237a84c0ba4fd40a2b2ba.tar.bz2 |
Change the way we apply fixed position to layers
With the latest refactoring we lost the possibility of having a layer
other than LayerAndroid be fixed positioned. This CL remove the
FixedLayerAndroid class (rename it into FixedPositioning) of the
hierarchy, and use delegation to apply fixed position.
Change-Id: Ib291fcaefe6a4431849ccfe2cf458fac6cac58aa
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r-- | Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index 447ab28..1ac90e9 100644 --- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -22,7 +22,7 @@ #include "AndroidAnimation.h" #include "Animation.h" #include "FloatRect.h" -#include "FixedLayerAndroid.h" +#include "FixedPositioning.h" #include "GraphicsContext.h" #include "IFrameContentLayerAndroid.h" #include "IFrameLayerAndroid.h" @@ -272,23 +272,19 @@ void GraphicsLayerAndroid::updateFixedPosition() viewRect.set(paintingOffsetX, paintingOffsetY, paintingOffsetX + w, paintingOffsetY + h); IntPoint renderLayerPos(renderLayer->x(), renderLayer->y()); - if (!m_contentLayer->isFixed()) { - FixedLayerAndroid* layer = new FixedLayerAndroid(*m_contentLayer); - m_contentLayer->unref(); - m_contentLayer = layer; + FixedPositioning* fixedPosition = m_contentLayer->fixedPosition(); + if (!fixedPosition) { + fixedPosition = new FixedPositioning(); + m_contentLayer->setFixedPosition(fixedPosition); } - FixedLayerAndroid* layer = static_cast<FixedLayerAndroid*>(m_contentLayer); - layer->setFixedPosition(left, top, right, bottom, - marginLeft, marginTop, - marginRight, marginBottom, - renderLayerPos, - viewRect); - } else if (m_contentLayer->isFixed()) { - LayerAndroid* layer = new LayerAndroid(*m_contentLayer); - m_contentLayer->unref(); - m_contentLayer = layer; - } + fixedPosition->setFixedPosition(left, top, right, bottom, + marginLeft, marginTop, + marginRight, marginBottom, + renderLayerPos, + viewRect); + } else if (m_contentLayer->isFixed()) + m_contentLayer->setFixedPosition(0); } void GraphicsLayerAndroid::setPosition(const FloatPoint& point) |