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

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: Rebase and add comment 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
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/layer_impl.h
diff --git a/cc/layers/layer_impl.h b/cc/layers/layer_impl.h
index c7f0b4d7cfd346e4dd1212ac91fd6d6376678f17..70bec216680caff5c5e1f2cafa6da8ae8a74fea7 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));
}
@@ -463,13 +455,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;
@@ -507,8 +498,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 {
@@ -637,7 +626,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.
@@ -687,6 +677,7 @@ class CC_EXPORT LayerImpl : public LayerAnimationValueObserver,
}
void NoteLayerPropertyChanged();
+ void DidUpdateScrollOffset();
void PushLayerPropertyChangedForSubtree();
@@ -715,8 +706,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();
@@ -746,8 +735,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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698