summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/platform/graphics/android/rendering/Surface.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2012-06-04 16:42:54 -0700
committerChris Craik <ccraik@google.com>2012-06-04 18:12:19 -0700
commit988183e308148947b034b108c552e719eaff74fb (patch)
tree3f130ce39a047336265d134e4f198563532224fb /Source/WebCore/platform/graphics/android/rendering/Surface.cpp
parent06100d01966af4c0332fd964d9deb20f052c308d (diff)
downloadexternal_webkit-988183e308148947b034b108c552e719eaff74fb.zip
external_webkit-988183e308148947b034b108c552e719eaff74fb.tar.gz
external_webkit-988183e308148947b034b108c552e719eaff74fb.tar.bz2
Size change on the base surface invalidates the larger of the new/old dimensions
Fixes an issue where tiles outside the new bounds weren't invalidated, as the layer shrank in one dimension. bug:6609350 Change-Id: I1f6715670654c9e6211dbec71875aa2ea11cd8f8
Diffstat (limited to 'Source/WebCore/platform/graphics/android/rendering/Surface.cpp')
-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;
}