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

Unified Diff: cc/layers/layer_impl.h

Issue 1736073002: cc: Move SyncedScrollOffset to scroll tree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove scroll_offset() from LayerImpl Created 4 years, 10 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
Index: cc/layers/layer_impl.h
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index fdc5261e673b99ef9b558dfd331a3dacaf40688b..37b98ee0d81273c28ad1681ec48a10eaa749340a 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -83,20 +83,12 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
public LayerAnimationValueProvider,
public AnimationDelegate {
public:
- typedef SyncedProperty<AdditionGroup<gfx::ScrollOffset>> SyncedScrollOffset;
typedef LayerImplList RenderSurfaceListType;
typedef LayerImplList LayerListType;
typedef RenderSurfaceImpl RenderSurfaceType;
enum RenderingContextConstants { NO_RENDERING_CONTEXT = 0 };
- static scoped_ptr<LayerImpl> Create(
- LayerTreeImpl* tree_impl,
- int id,
- scoped_refptr<SyncedScrollOffset> scroll_offset) {
- return make_scoped_ptr(new LayerImpl(tree_impl, id, scroll_offset));
- }
-
static scoped_ptr<LayerImpl> Create(LayerTreeImpl* tree_impl, int id) {
return make_scoped_ptr(new LayerImpl(tree_impl, id));
}
@@ -462,13 +454,12 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
gfx::Vector2dF bounds_delta() const { return bounds_delta_; }
void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset);
+ // must only be called by tests when updating scroll offset of a single layer,
+ // the standard process to update scroll offsets is to call
+ // ScrollTree::UpdateScrollOffsetMap() which updates scroll offsets of all
+ // layers.
void PushScrollOffsetFromMainThread(const gfx::ScrollOffset& scroll_offset);
- // This method is similar to PushScrollOffsetFromMainThread but will cause the
- // scroll offset given to clobber any scroll changes on the active tree in the
- // time until this value is pushed to the active tree.
- void PushScrollOffsetFromMainThreadAndClobberActiveValue(
- const gfx::ScrollOffset& scroll_offset);
- gfx::ScrollOffset PullDeltaForMainThread();
+
gfx::ScrollOffset CurrentScrollOffset() const;
gfx::ScrollOffset BaseScrollOffset() const;
gfx::Vector2dF ScrollDelta() const;
@@ -506,8 +497,6 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
bool user_scrollable(ScrollbarOrientation orientation) const;
- void ApplySentScrollDeltasFromAbortedCommit();
-
void set_main_thread_scrolling_reasons(
uint32_t main_thread_scrolling_reasons);
uint32_t main_thread_scrolling_reasons() const {
@@ -636,7 +625,8 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
}
void GatherFrameTimingRequestIds(std::vector<int64_t>* request_ids);
- SyncedScrollOffset* synced_scroll_offset() { return scroll_offset_.get(); }
+ const SyncedScrollOffset* synced_scroll_offset() const;
+ SyncedScrollOffset* synced_scroll_offset();
// Get the correct invalidation region instead of conservative Rect
// for layers that provide it.
@@ -686,6 +676,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
}
void NoteLayerPropertyChanged();
+ void DidUpdateScrollOffset();
void PushLayerPropertyChangedForSubtree();
@@ -719,8 +710,6 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
private:
void ValidateQuadResourcesInternal(DrawQuad* quad) const;
- void PushScrollOffset(const gfx::ScrollOffset* scroll_offset);
- void DidUpdateScrollOffset();
void NoteLayerPropertyChangedForDescendantsInternal();
void PushLayerPropertyChangedForSubtreeInternal();
@@ -750,8 +739,6 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
int layer_id_;
LayerTreeImpl* layer_tree_impl_;
- // Properties dynamically changeable on active tree.
- scoped_refptr<SyncedScrollOffset> scroll_offset_;
gfx::Vector2dF bounds_delta_;
// Properties synchronized from the associated Layer.
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | cc/layers/layer_impl_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698