summaryrefslogtreecommitdiffstats
path: root/cc/layers/tiled_layer_impl.h
diff options
context:
space:
mode:
authoraelias <aelias@chromium.org>2015-01-31 05:44:49 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-31 13:45:47 +0000
commitd0070ba1ca9f06ad5d52272c7da3827f38b1ddf0 (patch)
tree1c5dfba19910dd99f74f07bf935b0ba36e093937 /cc/layers/tiled_layer_impl.h
parentc313f474933df016da94fbeb0892152a0d8e5b0f (diff)
downloadchromium_src-d0070ba1ca9f06ad5d52272c7da3827f38b1ddf0.zip
chromium_src-d0070ba1ca9f06ad5d52272c7da3827f38b1ddf0.tar.gz
chromium_src-d0070ba1ca9f06ad5d52272c7da3827f38b1ddf0.tar.bz2
Convert scroll offsets to use SyncedProperty.
This contains the logic used to synchronize scroll deltas between the main, pending and active tree into the generic SyncedProperty class. Each LayerImpl has a refptr to one, which is shared between the pending and active version of that layer. This removes the need for the logic to backsync deltas to the pending tree, reduces code duplication with analogous properties like page scale factor, and clarifies the principles behind CC's synchronization approach. This should be a no-op change. BUG= Review URL: https://codereview.chromium.org/800613009 Cr-Commit-Position: refs/heads/master@{#314053}
Diffstat (limited to 'cc/layers/tiled_layer_impl.h')
-rw-r--r--cc/layers/tiled_layer_impl.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/cc/layers/tiled_layer_impl.h b/cc/layers/tiled_layer_impl.h
index e3ace34..039bf19 100644
--- a/cc/layers/tiled_layer_impl.h
+++ b/cc/layers/tiled_layer_impl.h
@@ -18,7 +18,15 @@ class DrawableTile;
class CC_EXPORT TiledLayerImpl : public LayerImpl {
public:
static scoped_ptr<TiledLayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
- return make_scoped_ptr(new TiledLayerImpl(tree_impl, id));
+ return make_scoped_ptr(
+ new TiledLayerImpl(tree_impl, id, new LayerImpl::SyncedScrollOffset));
+ }
+ static scoped_ptr<TiledLayerImpl> Create(
+ LayerTreeImpl* tree_impl,
+ int id,
+ scoped_refptr<LayerImpl::SyncedScrollOffset> synced_scroll_offset) {
+ return make_scoped_ptr(
+ new TiledLayerImpl(tree_impl, id, synced_scroll_offset));
}
~TiledLayerImpl() override;
@@ -51,6 +59,10 @@ class CC_EXPORT TiledLayerImpl : public LayerImpl {
protected:
TiledLayerImpl(LayerTreeImpl* tree_impl, int id);
+ TiledLayerImpl(
+ LayerTreeImpl* tree_impl,
+ int id,
+ scoped_refptr<LayerImpl::SyncedScrollOffset> synced_scroll_offset);
// Exposed for testing.
bool HasTileAt(int i, int j) const;
bool HasResourceIdForTileAt(int i, int j) const;