summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-05-31 19:17:27 -0700
committerChris Craik <ccraik@google.com>2012-06-01 10:15:01 -0700
commit25c25a826222bf0fa1df56f6cfd8582296357b49 (patch)
tree3b26e038249111f87517db36e67632edcab02cb5
parentb5d3edac71ca2c54cbf9ce5bf42cc7727216ac09 (diff)
downloadexternal_webkit-25c25a826222bf0fa1df56f6cfd8582296357b49.zip
external_webkit-25c25a826222bf0fa1df56f6cfd8582296357b49.tar.gz
external_webkit-25c25a826222bf0fa1df56f6cfd8582296357b49.tar.bz2
Disable clipping on the base surface
Base surface can expand dynamically (see BaseLayerAndroid::updatePosition) to fill the viewport, so disable clipping on it. bug:6593707 Change-Id: I3afafb28fbe95d3162c76f8e835932577ded65ce
-rw-r--r--Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp7
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Surface.cpp18
2 files changed, 14 insertions, 11 deletions
diff --git a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
index 82af3bf..8069778 100644
--- a/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
+++ b/Source/WebCore/platform/graphics/android/layers/BaseLayerAndroid.cpp
@@ -84,7 +84,12 @@ void BaseLayerAndroid::updatePositionsRecursive(const SkRect& visibleContentRect
updateLayerPositions(visibleContentRect);
TransformationMatrix ident;
- FloatRect clip(0, 0, getWidth(), getHeight());
+
+ // Start with an unnecessarily large clip, since the base layer can
+ // dynamically increase in size to cover the viewport, and we cache its draw
+ // clip. This way the base layer will never have it's visible area clipped
+ // by its m_clippingRect, only the viewport.
+ FloatRect clip(0, 0, 1e10, 1e10);
bool forcePositionCalculation = !m_positionsCalculated;
float scale = 1.0f;
diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
index 9df1a7a..d68051d 100644
--- a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
@@ -230,17 +230,15 @@ bool Surface::drawGL(bool layerTilesDisabled)
if (singleLayer() && !getFirstLayer()->visible())
return false;
- bool isBaseLayer = isBase()
- || getFirstLayer()->subclassType() == LayerAndroid::FixedBackgroundImageLayer
- || getFirstLayer()->subclassType() == LayerAndroid::ForegroundBaseLayer;
-
- FloatRect drawClip = getFirstLayer()->drawClip();
- if (!singleLayer()) {
- for (unsigned int i = 1; i < m_layers.size(); i++)
- drawClip.unite(m_layers[i]->drawClip());
+ if (!isBase()) {
+ FloatRect drawClip = getFirstLayer()->drawClip();
+ if (!singleLayer()) {
+ for (unsigned int i = 1; i < m_layers.size(); i++)
+ drawClip.unite(m_layers[i]->drawClip());
+ }
+ FloatRect clippingRect = TilesManager::instance()->shader()->rectInInvViewCoord(drawClip);
+ TilesManager::instance()->shader()->clip(clippingRect);
}
- FloatRect clippingRect = TilesManager::instance()->shader()->rectInInvViewCoord(drawClip);
- TilesManager::instance()->shader()->clip(clippingRect);
bool askRedraw = false;
if (m_surfaceBacking && !tilesDisabled) {