summaryrefslogtreecommitdiffstats
path: root/Source/WebCore
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-06-05 09:22:02 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-06-05 09:22:02 -0700
commit17b3099982f6143d60ef0c88efdbb2c04b3fd294 (patch)
treee223e42428d7e44a17cb2fc5b73ca4ce87f5ddd6 /Source/WebCore
parent2348a346744a3172d32faf2e03369596b9402071 (diff)
parenta70a7851d9c5daeef242cb9e6641dfcc449324c3 (diff)
downloadexternal_webkit-17b3099982f6143d60ef0c88efdbb2c04b3fd294.zip
external_webkit-17b3099982f6143d60ef0c88efdbb2c04b3fd294.tar.gz
external_webkit-17b3099982f6143d60ef0c88efdbb2c04b3fd294.tar.bz2
am a70a7851: am 988183e3: Size change on the base surface invalidates the larger of the new/old dimensions
* commit 'a70a7851d9c5daeef242cb9e6641dfcc449324c3': Size change on the base surface invalidates the larger of the new/old dimensions
Diffstat (limited to 'Source/WebCore')
-rw-r--r--Source/WebCore/platform/graphics/android/rendering/Surface.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
index d68051d..73466d3 100644
--- a/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
+++ b/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
@@ -90,13 +90,24 @@ bool Surface::tryUpdateSurface(Surface* oldSurface)
return true;
}
+ SkRegion invalRegion;
+ bool fullInval = false;
if (singleLayer() && oldSurface->singleLayer()) {
// both are single matching layers, simply apply inval
SkRegion* layerInval = getFirstLayer()->getInvalRegion();
- m_surfaceBacking->markAsDirty(*layerInval);
+ invalRegion = *layerInval;
+
+ if (isBase()) {
+ // the base layer paints outside it's content area to ensure the
+ // viewport is convered, so fully invalidate all tiles if its size
+ // changes to ensure no stale content remains
+ LayerContent* newContent = getFirstLayer()->content();
+ LayerContent* oldContent = oldSurface->getFirstLayer()->content();
+ fullInval = newContent->width() != oldContent->width()
+ || newContent->height() != oldContent->height();
+ }
} else {
- SkRegion invalRegion;
- bool fullInval = m_layers.size() != oldSurface->m_layers.size();
+ fullInval = m_layers.size() != oldSurface->m_layers.size();
if (!fullInval) {
for (unsigned int i = 0; i < m_layers.size(); i++) {
if ((m_layers[i]->uniqueId() != oldSurface->m_layers[i]->uniqueId())
@@ -111,16 +122,15 @@ bool Surface::tryUpdateSurface(Surface* oldSurface)
FloatRect layerPos = m_layers[i]->fullContentAreaMapped();
m_layers[i]->getInvalRegion()->translate(layerPos.x(), layerPos.y());
invalRegion.op(*(m_layers[i]->getInvalRegion()), SkRegion::kUnion_Op);
- break;
}
}
}
+ }
- if (fullInval)
- invalRegion.setRect(-1e8, -1e8, 2e8, 2e8);
+ if (fullInval)
+ invalRegion.setRect(-1e8, -1e8, 2e8, 2e8);
- m_surfaceBacking->markAsDirty(invalRegion);
- }
+ m_surfaceBacking->markAsDirty(invalRegion);
return true;
}