summaryrefslogtreecommitdiffstats
path: root/cc/picture_layer.cc
diff options
context:
space:
mode:
authorenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-16 04:53:10 +0000
committerenne@chromium.org <enne@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-12-16 04:53:10 +0000
commitf117a4cc7c6cae265071109a9133ff5f853a06f1 (patch)
tree57eba0519d44af2d0d4f6b30b0492160c86c21c0 /cc/picture_layer.cc
parent344e58d0497d68437f9653fcfc3788d85f3f8450 (diff)
downloadchromium_src-f117a4cc7c6cae265071109a9133ff5f853a06f1.zip
chromium_src-f117a4cc7c6cae265071109a9133ff5f853a06f1.tar.gz
chromium_src-f117a4cc7c6cae265071109a9133ff5f853a06f1.tar.bz2
cc: Add some more infrastructure for two trees
PictureLayerImpl gets the ability to sync a tiling from active to pending tree when it gets created so that layers can share tiles. A few functions are added to make this possible. BUG=155209 Review URL: https://chromiumcodereview.appspot.com/11574026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@173366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/picture_layer.cc')
-rw-r--r--cc/picture_layer.cc20
1 files changed, 14 insertions, 6 deletions
diff --git a/cc/picture_layer.cc b/cc/picture_layer.cc
index ca2bf4a..b1fe87c 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) {