Chromium Code Reviews| Index: cc/picture_layer.cc |
| diff --git a/cc/picture_layer.cc b/cc/picture_layer.cc |
| index 4f192da7e180fdb51eaa7071aaad1d5107143fce..4e7bbff44b63d467e14ff2b93066c7e32c3e9e5b 100644 |
| --- a/cc/picture_layer.cc |
| +++ b/cc/picture_layer.cc |
| @@ -51,7 +51,14 @@ 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()) { |
|
danakj
2013/01/09 00:31:57
you could also rect.Intersect(gfx::Rect(contentBou
|
| + // Clamp invalidation to the layer bounds. |
| + gfx::Rect clamped_rect = gfx::IntersectRects( |
| + rect, |
| + gfx::Rect(contentBounds())); |
| + if (!clamped_rect.IsEmpty()) |
| + pending_invalidation_.Union(clamped_rect); |
|
danakj
2013/01/09 00:31:57
union with an empty rect is a no-op, so you probab
|
| + } |
| Layer::setNeedsDisplayRect(layer_rect); |
| } |