summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
diff options
context:
space:
mode:
authorNicolas Roard <nicolasroard@google.com>2012-03-05 14:20:53 -0800
committerNicolas Roard <nicolasroard@google.com>2012-03-06 13:47:58 -0800
commit74eee052852e8c1761c48ad2a44a4b394714b8cf (patch)
tree2441e7dd0ced3bf4141ddca5176174c286868ee8 /Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
parent217e14b07cda7e459bdc5eb81d053a3050d39547 (diff)
downloadexternal_webkit-74eee052852e8c1761c48ad2a44a4b394714b8cf.zip
external_webkit-74eee052852e8c1761c48ad2a44a4b394714b8cf.tar.gz
external_webkit-74eee052852e8c1761c48ad2a44a4b394714b8cf.tar.bz2
Refactor LayerAndroid and add a FixedLayerAndroid class
Change-Id: Ic94e67678e7f5783bf6690308d0a13ce2202d1f2
Diffstat (limited to 'Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp')
-rw-r--r--Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
index c50f6a6..80325e2 100644
--- a/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp
@@ -22,6 +22,7 @@
#include "AndroidAnimation.h"
#include "Animation.h"
#include "FloatRect.h"
+#include "FixedLayerAndroid.h"
#include "GraphicsContext.h"
#include "Image.h"
#include "ImagesManager.h"
@@ -264,11 +265,23 @@ void GraphicsLayerAndroid::updateFixedPosition()
SkRect viewRect;
viewRect.set(paintingOffsetX, paintingOffsetY, paintingOffsetX + w, paintingOffsetY + h);
IntPoint renderLayerPos(renderLayer->x(), renderLayer->y());
- m_contentLayer->setFixedPosition(left, top, right, bottom,
+
+ if (!m_contentLayer->isFixed()) {
+ FixedLayerAndroid* layer = new FixedLayerAndroid(*m_contentLayer);
+ m_contentLayer->unref();
+ m_contentLayer = layer;
+ }
+
+ 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;
}
}