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

Unified Diff: cc/trees/layer_tree_host_impl.cc

Issue 2188133002: Scroll with Layers in views::ScrollView (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollTrack
Patch Set: bugref, scale_delta DCHECK + comment Created 4 years, 4 months 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/trees/layer_tree_host_impl.h ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 0e7a56fda49ef48a16d81796ecafb6443f98f697..68917861bc394e66377513ce51794d4d8fa8c511 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -627,6 +627,27 @@ ScrollElasticityHelper* LayerTreeHostImpl::CreateScrollElasticityHelper() {
return scroll_elasticity_helper_.get();
}
+bool LayerTreeHostImpl::GetScrollOffsetForLayer(int layer_id,
+ gfx::ScrollOffset* offset) {
+ LayerImpl* layer = active_tree()->FindActiveTreeLayerById(layer_id);
+ if (!layer)
+ return false;
+
+ *offset = layer->CurrentScrollOffset();
+ return true;
+}
+
+bool LayerTreeHostImpl::ScrollLayerTo(int layer_id,
+ const gfx::ScrollOffset& offset) {
+ LayerImpl* layer = active_tree()->FindActiveTreeLayerById(layer_id);
+ if (!layer)
+ return false;
+
+ layer->ScrollBy(
+ ScrollOffsetToVector2dF(offset - layer->CurrentScrollOffset()));
+ return true;
+}
+
void LayerTreeHostImpl::QueueSwapPromiseForMainThreadScrollUpdate(
std::unique_ptr<SwapPromise> swap_promise) {
swap_promises_for_main_thread_scroll_update_.push_back(
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | cc/trees/single_thread_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698