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

Unified Diff: cc/layers/layer.cc

Issue 2767213003: First Implementation of Snapped Points
Patch Set: Rebase and format Created 3 years, 6 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/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer.cc
diff --git a/cc/layers/layer.cc b/cc/layers/layer.cc
index f4ff01d5022577a6792c8fc3d353a3ad1d7b1bb8..9971493c7edf31c9d56184547857047d70ea7d08 100644
--- a/cc/layers/layer.cc
+++ b/cc/layers/layer.cc
@@ -310,6 +310,15 @@ void Layer::SetBounds(const gfx::Size& size) {
SetNeedsCommit();
}
+void Layer::SetScrollSnapOffsets(const SnapPointList& offsets) {
+ DCHECK(IsPropertyChangeAllowed());
+ if (inputs_.snap_offsets == offsets)
+ return;
+ inputs_.snap_offsets = offsets;
+ SetPropertyTreesNeedRebuild();
+ SetNeedsCommit();
+}
+
Layer* Layer::RootLayer() {
Layer* layer = this;
while (layer->parent())
@@ -1197,6 +1206,11 @@ void Layer::PushPropertiesTo(LayerImpl* layer) {
layer->SetUpdateRect(inputs_.update_rect);
layer->SetHasWillChangeTransformHint(has_will_change_transform_hint());
+ layer->SetScrollSnapOffsets(inputs_.snap_offsets);
+ /*for (SnapPoint point : inputs_.snap_offsets.horizontal) {
+ LOG(ERROR) << point.offset << " " << point.must_snap << " "
+ << point.is_start << " " << point.is_end;
+ }*/
layer->SetNeedsPushProperties();
// Reset any state that should be cleared for the next update.
« no previous file with comments | « cc/layers/layer.h ('k') | cc/layers/layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698