diff options
author | Chris Craik <ccraik@google.com> | 2012-05-31 19:17:27 -0700 |
---|---|---|
committer | Chris Craik <ccraik@google.com> | 2012-06-01 10:15:01 -0700 |
commit | 25c25a826222bf0fa1df56f6cfd8582296357b49 (patch) | |
tree | 3b26e038249111f87517db36e67632edcab02cb5 | |
parent | b5d3edac71ca2c54cbf9ce5bf42cc7727216ac09 (diff) | |
download | webkit-25c25a826222bf0fa1df56f6cfd8582296357b49.tar.gz |
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.cpp | 7 | ||||
-rw-r--r-- | Source/WebCore/platform/graphics/android/rendering/Surface.cpp | 18 |
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 82af3bf19..80697784e 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 9df1a7a69..d68051db5 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) { |