summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-04-09 17:56:59 -0700
committerChris Craik <ccraik@google.com>2012-04-10 10:41:11 -0700
commit75fc360d144b97f5e50bedf7ed3222898cc56446 (patch)
tree0f295dac8cb8fec8798285f5e62efa4cd91d2caf /Source/WebCore
parent98e8504d9f510b8cbaca1b0144efea3a4d1a8eec (diff)
downloadexternal_webkit-75fc360d144b97f5e50bedf7ed3222898cc56446.zip
external_webkit-75fc360d144b97f5e50bedf7ed3222898cc56446.tar.gz
external_webkit-75fc360d144b97f5e50bedf7ed3222898cc56446.tar.bz2
Expand base layer bounds to fill viewport
Additionally, paint area outside the content bounds with content bg color in software rendering path. bug:6304213 Change-Id: I6fe5246e82d30fe000e570c8dccb605d46fc428d
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp13
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
index 1de5ae7..ce520b4 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
@@ -53,4 +53,17 @@ void BaseLayerAndroid::getLocalTransform(SkMatrix* matrix) const
matrix->preConcat(getMatrix());
}
+IFrameLayerAndroid* BaseLayerAndroid::updatePosition(SkRect viewport,
+ IFrameLayerAndroid* parentIframeLayer)
+{
+ if (viewport.fRight > getWidth() || viewport.fBottom > getHeight()) {
+ // To handle the viewport expanding past the layer's size with HW accel,
+ // expand the size of the layer, so that tiles will cover the viewport.
+ setSize(std::max(viewport.fRight, getWidth()),
+ std::max(viewport.fBottom, getHeight()));
+ }
+
+ return LayerAndroid::updatePosition(viewport, parentIframeLayer);
+}
+
} // namespace WebCore
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
index 0ef39c8..f4cf9f3 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.h
@@ -49,6 +49,8 @@ public:
virtual void getLocalTransform(SkMatrix* matrix) const;
virtual const TransformationMatrix* drawTransform() const { return 0; }
+ virtual IFrameLayerAndroid* updatePosition(SkRect viewport,
+ IFrameLayerAndroid* parentIframeLayer);
private:
// TODO: move to SurfaceCollection.
Color m_color;