cc: Sync scroll offsets and deltas for impl-side painting

Fix the issue where impl-side painting loses scroll deltas that occur
when there is a commit outstanding.  During Layer::pushPropertiesTo,
the previous code tried would ask the existing active tree LayerImpl about
its sent scroll delta and calculate what the new delta should be based on
this.  In the impl-side painting version, the sent scroll delta would
always be zero, because you can't begin a frame with a pending tree, and
so you can only send a scroll delta from an active tree, and activating a
pending tree would blow away the previous sent scroll delta, losing
scroll information.

Instead, during Layer::pushPropertiesTo, the new pending tree layer
needs to be updated with any scrolling that has happened since the begin
frame message was sent, by inquiring about its active twin.

The current state of the world is that the sent scroll delta on the
pending tree layer is always zero.  The sent scroll delta on the active
tree layer is whatever has been sent to the main thread.  If there is
currently a pending tree, this sent scroll delta will be reflected in the
pending layer's scroll offset, just like the sent scroll delta was reflected
in the main thread layer's scroll offset.

The new invariant is that a pending tree layer and its active tree layer
twin have the same difference between scroll delta and sent scroll delta.
In other words, the scroll delta for a layer is the amount that has been
scrolled since the begin frame message for the frame after that layer's
tree's source frame was sent.

For example, if there is no main thread scrolling whatsoever, then the
sum of scroll offset + scroll delta will be equal for the pending tree
layer and the active tree layers, although values will be distributed
differently given the above invariants.

[email protected]
BUG=167626


Review URL: https://chromiumcodereview.appspot.com/11692002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@175031 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/layer_tree_host_impl.h b/cc/layer_tree_host_impl.h
index 25922c86..6107726 100644
--- a/cc/layer_tree_host_impl.h
+++ b/cc/layer_tree_host_impl.h
@@ -212,7 +212,7 @@
     LayerTreeImpl* pendingTree() { return m_pendingTree.get(); }
     const LayerTreeImpl* pendingTree() const { return m_pendingTree.get(); }
     void createPendingTree();
-    void activatePendingTreeIfNeeded();
+    virtual void activatePendingTreeIfNeeded();
 
     // TODO(nduca): Remove these in favor of LayerTreeImpl.
     void setRootLayer(scoped_ptr<LayerImpl>);