summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGeorge Mount <mount@google.com>2012-05-07 07:29:14 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-07 07:29:14 -0700
commit5331af464fa0f4a08cbfe84f1de2ebab0038f2c1 (patch)
tree0a45d464a7566987dfa197cd3238a33114f81b21
parente712b54e831d077c789984b8206f64d81dbceaa2 (diff)
parent0e43fd01178d539d44a5dfade3bf15aa6efbe02a (diff)
downloadexternal_webkit-5331af464fa0f4a08cbfe84f1de2ebab0038f2c1.zip
external_webkit-5331af464fa0f4a08cbfe84f1de2ebab0038f2c1.tar.gz
external_webkit-5331af464fa0f4a08cbfe84f1de2ebab0038f2c1.tar.bz2
Merge "Ensure updateGLPositionsAndScale is called from updateLayerPosition." into jb-dev
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp8
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h1
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp10
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h6
-rw-r--r--Source/WebKit/android/nav/WebView.cpp2
5 files changed, 16 insertions, 11 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
index bc3b04b..4f89dc9 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
@@ -69,6 +69,14 @@ IFrameLayerAndroid* BaseLayerAndroid::updatePosition(SkRect viewport,
return LayerAndroid::updatePosition(viewport, parentIframeLayer);
}
+void BaseLayerAndroid::updatePositionsRecursive(const SkRect& visibleContentRect)
+{
+ updateLayerPositions(visibleContentRect);
+ TransformationMatrix ident;
+ FloatRect clip(0, 0, 1e10, 1e10);
+ updateGLPositionsAndScale(ident, clip, 1, state()->scale());
+}
+
ForegroundBaseLayerAndroid::ForegroundBaseLayerAndroid(LayerContent* content)
: LayerAndroid((RenderLayer*)0)
{
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
index dc4c25f..6275dfd 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
@@ -42,6 +42,7 @@ public:
virtual bool needsTexture() { return content(); }
virtual IFrameLayerAndroid* updatePosition(SkRect viewport,
IFrameLayerAndroid* parentIframeLayer);
+ void updatePositionsRecursive(const SkRect& visibleContentRect);
void setBackgroundColor(Color& color) { m_color = color; }
Color getBackgroundColor() { return m_color; }
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
index 0bdbf38..ef91f04 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.cpp
@@ -33,7 +33,7 @@
#include "BaseLayerAndroid.h"
#include "ClassTracker.h"
#include "GLWebViewState.h"
-#include "LayerAndroid.h"
+#include "BaseLayerAndroid.h"
#include "Surface.h"
#include "ScrollableLayerAndroid.h"
#include "TilesManager.h"
@@ -44,7 +44,7 @@ namespace WebCore {
// TILED PAINTING / SURFACES //
////////////////////////////////////////////////////////////////////////////////
-SurfaceCollection::SurfaceCollection(LayerAndroid* layer)
+SurfaceCollection::SurfaceCollection(BaseLayerAndroid* layer)
: m_compositedRoot(layer)
{
// layer must be non-null.
@@ -233,11 +233,7 @@ void SurfaceCollection::updateScrollableLayer(int layerId, int x, int y)
void SurfaceCollection::updateLayerPositions(const SkRect& visibleContentRect)
{
- TransformationMatrix ident;
- m_compositedRoot->updateLayerPositions(visibleContentRect);
- FloatRect clip(0, 0, 1e10, 1e10);
- m_compositedRoot->updateGLPositionsAndScale(
- ident, clip, 1, m_compositedRoot->state()->scale());
+ m_compositedRoot->updatePositionsRecursive(visibleContentRect);
#ifdef DEBUG
m_compositedRoot->showLayer(0);
diff --git a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
index 5cfd943..dc5fec4 100644
--- a/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
+++ b/Source/WebCore/platform/graphics/android/rendering/SurfaceCollection.h
@@ -37,14 +37,14 @@ class SkRegion;
namespace WebCore {
-class LayerAndroid;
+class BaseLayerAndroid;
class Surface;
class TexturesResult;
class SurfaceCollection : public SkRefCnt {
// TODO: investigate webkit threadsafe ref counting
public:
- SurfaceCollection(LayerAndroid* compositedRoot);
+ SurfaceCollection(BaseLayerAndroid* compositedRoot);
virtual ~SurfaceCollection();
// Tiled painting methods (executed on groups)
@@ -68,7 +68,7 @@ public:
private:
void updateLayerPositions(const SkRect& visibleContentRect);
- LayerAndroid* m_compositedRoot;
+ BaseLayerAndroid* m_compositedRoot;
WTF::Vector<Surface*> m_surfaces;
};
diff --git a/Source/WebKit/android/nav/WebView.cpp b/Source/WebKit/android/nav/WebView.cpp
index 603b9d1..dae34d8 100644
--- a/Source/WebKit/android/nav/WebView.cpp
+++ b/Source/WebKit/android/nav/WebView.cpp
@@ -590,7 +590,7 @@ const TransformationMatrix* getLayerTransform(int layerId) {
// We need to make sure the drawTransform is up to date as this is
// called before a draw() or drawGL()
if (layer) {
- m_baseLayer->updateLayerPositions(m_visibleContentRect);
+ m_baseLayer->updatePositionsRecursive(m_visibleContentRect);
return layer->drawTransform();
}
}