Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3218)

Unified Diff: cc/picture_layer.cc

Issue 11574026: cc: Add some more infrastructure for two trees (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/layer_tree_impl.cc ('k') | cc/picture_layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/picture_layer.cc
diff --git a/cc/picture_layer.cc b/cc/picture_layer.cc
index ca2bf4a2988e8c71b9127b46488506f3fdfa71ee..b1fe87c1a238807fa5e4602500a4d1cceb71a034 100644
--- a/cc/picture_layer.cc
+++ b/cc/picture_layer.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "cc/picture_layer.h"
+
+#include "cc/layer_tree_impl.h"
#include "cc/picture_layer_impl.h"
#include "ui/gfx/rect_conversions.h"
@@ -29,15 +31,21 @@ scoped_ptr<LayerImpl> PictureLayer::createLayerImpl(LayerTreeImpl* treeImpl) {
void PictureLayer::pushPropertiesTo(LayerImpl* base_layer) {
Layer::pushPropertiesTo(base_layer);
+
PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
- layer_impl->didUpdateBounds();
+ layer_impl->tilings_.SetLayerBounds(bounds());
+ layer_impl->invalidation_.Clear();
+ layer_impl->invalidation_.Swap(pile_invalidation_);
pile_.PushPropertiesTo(layer_impl->pile_);
- // 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();
+ // TODO(enne): Remove this once syncing happens to the pending tree rather
+ // than the active one.
+ if (layer_impl->layerTreeImpl()->IsActiveTree()) {
+ layer_impl->tilings_.Invalidate(layer_impl->invalidation_);
+ return;
+ }
+
+ layer_impl->SyncFromActiveLayer();
}
void PictureLayer::setNeedsDisplayRect(const gfx::RectF& layer_rect) {
« no previous file with comments | « cc/layer_tree_impl.cc ('k') | cc/picture_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698