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 23983047: Pinch/Zoom Infrastructure & Plumbing CL (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Draft for review. Created 7 years, 1 month 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 9d3951b78afe49aeb46c6a24d90f877bad5a446c..e801b49249de57e2cfea804f148243763fd2f40e 100644
--- a/cc/layers/layer_impl.h
+++ b/cc/layers/layer_impl.h
@@ -356,8 +356,10 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
gfx::Vector2dF scroll_delta);
gfx::Vector2d scroll_offset() const { return scroll_offset_; }
- void SetMaxScrollOffset(gfx::Vector2d max_scroll_offset);
- gfx::Vector2d max_scroll_offset() const { return max_scroll_offset_; }
+ gfx::Vector2d MaxScrollOffset() const;
+ gfx::Vector2dF ClampScrollToMaxScrollOffset();
+ void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer,
+ LayerImpl* scrollbar_clip_layer) const;
void SetScrollDelta(gfx::Vector2dF scroll_delta);
gfx::Vector2dF ScrollDelta() const;
@@ -371,8 +373,8 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
// initial scroll
gfx::Vector2dF ScrollBy(gfx::Vector2dF scroll);
- void SetScrollable(bool scrollable) { scrollable_ = scrollable; }
- bool scrollable() const { return scrollable_; }
+ void SetScrollable(int clip_layer_id);
+ bool scrollable() const { return clip_layer_; }
void set_user_scrollable_horizontal(bool scrollable) {
user_scrollable_horizontal_ = scrollable;
@@ -464,15 +466,14 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
return scrollbar_animation_controller_.get();
}
- void SetHorizontalScrollbarLayer(ScrollbarLayerImplBase* scrollbar_layer);
- ScrollbarLayerImplBase* horizontal_scrollbar_layer() {
- return horizontal_scrollbar_layer_;
- }
-
- void SetVerticalScrollbarLayer(ScrollbarLayerImplBase* scrollbar_layer);
- ScrollbarLayerImplBase* vertical_scrollbar_layer() {
- return vertical_scrollbar_layer_;
- }
+ typedef std::set<ScrollbarLayerImplBase*> ScrollbarSet;
+ ScrollbarSet* scrollbars() { return scrollbars_.get(); }
+ void ClearScrollbars();
+ void AddScrollbar(ScrollbarLayerImplBase* layer);
+ void RemoveScrollbar(ScrollbarLayerImplBase* layer);
+ bool HasScrollbar(ScrollbarOrientation orientation) const;
+ void NotifyScrollbars();
enne (OOO) 2013/11/14 22:59:01 Can you name this more clearly? Maybe even just Sc
wjmaclean 2013/12/24 21:03:49 Done. I needs (I think) to remain public until Cl
+ int clip_height() { return clip_layer_ ? clip_layer_->bounds().height() : 0; }
gfx::Rect LayerRectToContentRect(const gfx::RectF& layer_rect) const;
@@ -514,8 +515,6 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
void NoteLayerPropertyChangedForDescendants();
private:
- void UpdateScrollbarPositions();
-
virtual const char* LayerTypeAsString() const;
// Properties internal to LayerImpl
@@ -548,7 +547,7 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
gfx::Size bounds_;
gfx::Vector2d scroll_offset_;
LayerScrollOffsetDelegate* scroll_offset_delegate_;
- bool scrollable_;
+ LayerImpl* clip_layer_;
bool should_scroll_on_main_thread_;
bool have_wheel_event_handlers_;
bool user_scrollable_horizontal_;
@@ -588,7 +587,7 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
gfx::Vector2dF scroll_delta_;
gfx::Vector2d sent_scroll_delta_;
- gfx::Vector2d max_scroll_offset_;
+// gfx::Vector2d max_scroll_offset_;
enne (OOO) 2013/11/14 22:59:01 Remove this line?
wjmaclean 2013/12/24 21:03:49 Done.
gfx::Vector2dF last_scroll_offset_;
// The global depth value of the center of the layer. This value is used
@@ -617,10 +616,7 @@ class CC_EXPORT LayerImpl : LayerAnimationValueObserver {
// Manages scrollbars for this layer
scoped_ptr<ScrollbarAnimationController> scrollbar_animation_controller_;
- // Weak pointers to this layer's scrollbars, if it has them. Updated during
- // tree synchronization.
- ScrollbarLayerImplBase* horizontal_scrollbar_layer_;
- ScrollbarLayerImplBase* vertical_scrollbar_layer_;
+ scoped_ptr<ScrollbarSet> scrollbars_;
ScopedPtrVector<CopyOutputRequest> copy_requests_;

Powered by Google App Engine
This is Rietveld 408576698