From 388e461f3d6bf782b3cfb4bb21bc6264cef9323c Mon Sep 17 00:00:00 2001 From: Nicolas Roard Date: Thu, 7 Jan 2010 14:22:22 +0000 Subject: Add proper support for fixed position elements this is two-part change, see http://android-git.corp.google.com/g/#change,37092 for the java counterpart. This CL implements fixed position elements (css position: fixed) using layers, supporting pixels and percent lengths. It addresses http://b/1914365 --- WebCore/platform/graphics/android/LayerAndroid.h | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'WebCore/platform/graphics/android/LayerAndroid.h') diff --git a/WebCore/platform/graphics/android/LayerAndroid.h b/WebCore/platform/graphics/android/LayerAndroid.h index 284185d..467c7dd 100644 --- a/WebCore/platform/graphics/android/LayerAndroid.h +++ b/WebCore/platform/graphics/android/LayerAndroid.h @@ -25,6 +25,7 @@ #include "FloatSize.h" #include "GraphicsContext.h" #include "GraphicsLayer.h" +#include "Length.h" #include "RefPtr.h" #include "StringHash.h" #include "Vector.h" @@ -64,7 +65,7 @@ public: void setBackgroundColor(const Color& color); void setIsRootLayer(bool isRootLayer) { m_isRootLayer = isRootLayer; } - void paintOn(float scrollX, float scrollY, float scale, SkCanvas*); + void paintOn(int scrollX, int scrollY, int width, int height, float scale, SkCanvas*); GraphicsContext* paintContext(); void removeAllChildren() { m_children.clear(); } void addChildren(LayerAndroid* layer) { m_children.append(layer); } @@ -77,7 +78,7 @@ public: FloatPoint translation() { return m_translation; } FloatSize size() { return m_size; } - void setFixedPosition(FloatPoint position); + void setFixedPosition(Length left, Length top, Length right, Length bottom); void addAnimation(PassRefPtr anim); void removeAnimation(const String& name); Vector >* evaluateAnimations() const; @@ -87,11 +88,13 @@ public: private: - void paintChildren(float scrollX, float scrollY, + void paintChildren(int scrollX, int scrollY, + int width, int height, float scale, SkCanvas* canvas, float opacity); - void paintMe(float scrollX, float scrollY, + void paintMe(int scrollX, int scrollY, + int width, int height, float scale, SkCanvas* canvas, float opacity); @@ -110,10 +113,14 @@ private: FloatSize m_size; FloatPoint m_position; FloatPoint m_translation; - FloatPoint m_fixedPosition; FloatPoint3D m_anchorPoint; FloatPoint3D m_scale; + Length m_fixedLeft; + Length m_fixedTop; + Length m_fixedRight; + Length m_fixedBottom; + SkPicture* m_recordingPicture; Color m_backgroundColor; -- cgit v1.1