Commit 7a9fc137 authored by vangelis@chromium.org's avatar vangelis@chromium.org

Clamp invalidation regions of PictureLayer to layer bounds

Clamps the incoming invalidation regions of PictureLayer to the actual layer bounds to avoid bloating the update region data structure. It also adds an early out when the invalidation rect is empty. 

Review URL: https://chromiumcodereview.appspot.com/11824013

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175952 0039d316-1c4b-4281-b951-d872f2087c98
parent faa03f13
......@@ -51,7 +51,11 @@ void PictureLayer::setLayerTreeHost(LayerTreeHost* host) {
void PictureLayer::setNeedsDisplayRect(const gfx::RectF& layer_rect) {
gfx::Rect rect = gfx::ToEnclosedRect(layer_rect);
pending_invalidation_.Union(rect);
if (!rect.IsEmpty()) {
// Clamp invalidation to the layer bounds.
rect.Intersect(gfx::Rect(bounds()));
pending_invalidation_.Union(rect);
}
Layer::setNeedsDisplayRect(layer_rect);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment