Index: cc/picture_layer.cc |
diff --git a/cc/picture_layer.cc b/cc/picture_layer.cc |
index 4f192da7e180fdb51eaa7071aaad1d5107143fce..7924739259a2dc3b748977a0522d2c575fb7d85f 100644 |
--- a/cc/picture_layer.cc |
+++ b/cc/picture_layer.cc |
@@ -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); |
} |