| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ | 5 #ifndef CC_LAYERS_LAYER_IMPL_H_ |
| 6 #define CC_LAYERS_LAYER_IMPL_H_ | 6 #define CC_LAYERS_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 292 void SetBounds(const gfx::Size& bounds); | 292 void SetBounds(const gfx::Size& bounds); |
| 293 gfx::Size bounds() const; | 293 gfx::Size bounds() const; |
| 294 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions | 294 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions |
| 295 // of pixels) due to use of single precision float. | 295 // of pixels) due to use of single precision float. |
| 296 gfx::SizeF BoundsForScrolling() const; | 296 gfx::SizeF BoundsForScrolling() const; |
| 297 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); | 297 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); |
| 298 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } | 298 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } |
| 299 | 299 |
| 300 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); | 300 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); |
| 301 gfx::ScrollOffset CurrentScrollOffset() const; | 301 gfx::ScrollOffset CurrentScrollOffset() const; |
| 302 void SetCurrentOverscroll(const gfx::ScrollOffset& overscroll); |
| 303 gfx::ScrollOffset CurrentOverscroll() const; |
| 302 | 304 |
| 303 gfx::ScrollOffset MaxScrollOffset() const; | 305 gfx::ScrollOffset MaxScrollOffset() const; |
| 304 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; | 306 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; |
| 305 gfx::Vector2dF ClampScrollToMaxScrollOffset(); | 307 gfx::Vector2dF ClampScrollToMaxScrollOffset(); |
| 306 | 308 |
| 307 // Returns the delta of the scroll that was outside of the bounds of the | 309 // Returns the delta of the scroll that was outside of the bounds of the |
| 308 // initial scroll | 310 // initial scroll |
| 309 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); | 311 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); |
| 310 | 312 |
| 311 void SetScrollClipLayer(int scroll_clip_layer_id); | 313 // TODO(tapted): Remove this overload. |
| 314 void SetScrollClipLayer(int scroll_clip_layer_id) { |
| 315 SetScrollClipAndCanOverscroll(scroll_clip_layer_id, false); |
| 316 } |
| 317 void SetScrollClipAndCanOverscroll(int scroll_clip_layer_id, |
| 318 bool can_overscroll); |
| 312 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } | 319 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } |
| 313 LayerImpl* scroll_clip_layer() const; | 320 LayerImpl* scroll_clip_layer() const; |
| 314 bool scrollable() const; | 321 bool scrollable() const; |
| 322 bool can_overscroll() const { return can_overscroll_; } |
| 315 | 323 |
| 316 void set_user_scrollable_horizontal(bool scrollable); | 324 void set_user_scrollable_horizontal(bool scrollable); |
| 317 bool user_scrollable_horizontal() const { | 325 bool user_scrollable_horizontal() const { |
| 318 return user_scrollable_horizontal_; | 326 return user_scrollable_horizontal_; |
| 319 } | 327 } |
| 320 void set_user_scrollable_vertical(bool scrollable); | 328 void set_user_scrollable_vertical(bool scrollable); |
| 321 bool user_scrollable_vertical() const { return user_scrollable_vertical_; } | 329 bool user_scrollable_vertical() const { return user_scrollable_vertical_; } |
| 322 | 330 |
| 323 bool user_scrollable(ScrollbarOrientation orientation) const; | 331 bool user_scrollable(ScrollbarOrientation orientation) const; |
| 324 | 332 |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 502 |
| 495 // Properties synchronized from the associated Layer. | 503 // Properties synchronized from the associated Layer. |
| 496 gfx::Size bounds_; | 504 gfx::Size bounds_; |
| 497 int scroll_clip_layer_id_; | 505 int scroll_clip_layer_id_; |
| 498 | 506 |
| 499 gfx::Vector2dF offset_to_transform_parent_; | 507 gfx::Vector2dF offset_to_transform_parent_; |
| 500 uint32_t main_thread_scrolling_reasons_; | 508 uint32_t main_thread_scrolling_reasons_; |
| 501 | 509 |
| 502 bool user_scrollable_horizontal_ : 1; | 510 bool user_scrollable_horizontal_ : 1; |
| 503 bool user_scrollable_vertical_ : 1; | 511 bool user_scrollable_vertical_ : 1; |
| 512 bool can_overscroll_ : 1; |
| 504 bool should_flatten_transform_from_property_tree_ : 1; | 513 bool should_flatten_transform_from_property_tree_ : 1; |
| 505 | 514 |
| 506 // Tracks if drawing-related properties have changed since last redraw. | 515 // Tracks if drawing-related properties have changed since last redraw. |
| 507 bool layer_property_changed_ : 1; | 516 bool layer_property_changed_ : 1; |
| 508 bool may_contain_video_ : 1; | 517 bool may_contain_video_ : 1; |
| 509 | 518 |
| 510 bool masks_to_bounds_ : 1; | 519 bool masks_to_bounds_ : 1; |
| 511 bool contents_opaque_ : 1; | 520 bool contents_opaque_ : 1; |
| 512 bool use_parent_backface_visibility_ : 1; | 521 bool use_parent_backface_visibility_ : 1; |
| 513 bool use_local_transform_for_backface_visibility_ : 1; | 522 bool use_local_transform_for_backface_visibility_ : 1; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 bool scrolls_drawn_descendant_ : 1; | 577 bool scrolls_drawn_descendant_ : 1; |
| 569 bool has_will_change_transform_hint_ : 1; | 578 bool has_will_change_transform_hint_ : 1; |
| 570 bool needs_push_properties_ : 1; | 579 bool needs_push_properties_ : 1; |
| 571 | 580 |
| 572 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 581 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 573 }; | 582 }; |
| 574 | 583 |
| 575 } // namespace cc | 584 } // namespace cc |
| 576 | 585 |
| 577 #endif // CC_LAYERS_LAYER_IMPL_H_ | 586 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |