summaryrefslogtreecommitdiffstats
path: root/cc/picture_layer.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cc/picture_layer.cc')
-rw-r--r--cc/picture_layer.cc21
1 files changed, 16 insertions, 5 deletions
diff --git a/cc/picture_layer.cc b/cc/picture_layer.cc
index 86842df..cac70f7 100644
--- a/cc/picture_layer.cc
+++ b/cc/picture_layer.cc
@@ -32,20 +32,31 @@ void PictureLayer::pushPropertiesTo(LayerImpl* base_layer) {
PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
pile_.PushPropertiesTo(layer_impl->pile_);
- // TODO(enne): Need to sync tiling from active tree prior to this.
- layer_impl->tilings_.Invalidate(invalidation_);
- invalidation_.Clear();
+ // TODO(enne): Once we have two trees on the impl side, we need to
+ // sync the active layer's tiles prior to this Invalidate call since it
+ // will make new tiles for anything intersecting the invalidation.
+ layer_impl->tilings_.Invalidate(pile_invalidation_);
+ pile_invalidation_.Clear();
}
void PictureLayer::setNeedsDisplayRect(const gfx::RectF& layer_rect) {
gfx::Rect rect = gfx::ToEnclosedRect(layer_rect);
- invalidation_.Union(rect);
+ pending_invalidation_.Union(rect);
}
void PictureLayer::update(ResourceUpdateQueue&, const OcclusionTracker*,
RenderingStats& stats) {
+ if (pile_.size() == bounds() && pending_invalidation_.IsEmpty())
+ return;
+
pile_.Resize(bounds());
- pile_.Update(client_, stats);
+
+ // Calling paint in WebKit can sometimes cause invalidations, so save
+ // off the invalidation prior to calling update.
+ pile_invalidation_.Swap(pending_invalidation_);
+ pending_invalidation_.Clear();
+
+ pile_.Update(client_, pile_invalidation_, stats);
}
} // namespace cc