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 |
11 #include <map> | 11 #include <map> |
12 #include <memory> | 12 #include <memory> |
13 #include <set> | 13 #include <set> |
14 #include <string> | 14 #include <string> |
15 #include <vector> | 15 #include <vector> |
16 | 16 |
17 #include "base/logging.h" | 17 #include "base/logging.h" |
18 #include "base/macros.h" | 18 #include "base/macros.h" |
19 #include "base/memory/ptr_util.h" | 19 #include "base/memory/ptr_util.h" |
20 #include "base/values.h" | 20 #include "base/values.h" |
21 #include "cc/base/region.h" | 21 #include "cc/base/region.h" |
22 #include "cc/base/synced_property.h" | 22 #include "cc/base/synced_property.h" |
23 #include "cc/cc_export.h" | 23 #include "cc/cc_export.h" |
24 #include "cc/debug/layer_tree_debug_state.h" | 24 #include "cc/debug/layer_tree_debug_state.h" |
25 #include "cc/input/input_handler.h" | 25 #include "cc/input/input_handler.h" |
| 26 #include "cc/input/scroll_boundary_behavior.h" |
26 #include "cc/layers/draw_properties.h" | 27 #include "cc/layers/draw_properties.h" |
27 #include "cc/layers/layer_collections.h" | 28 #include "cc/layers/layer_collections.h" |
28 #include "cc/layers/layer_impl_test_properties.h" | 29 #include "cc/layers/layer_impl_test_properties.h" |
29 #include "cc/layers/layer_position_constraint.h" | 30 #include "cc/layers/layer_position_constraint.h" |
30 #include "cc/layers/performance_properties.h" | 31 #include "cc/layers/performance_properties.h" |
31 #include "cc/layers/render_surface_impl.h" | 32 #include "cc/layers/render_surface_impl.h" |
32 #include "cc/quads/shared_quad_state.h" | 33 #include "cc/quads/shared_quad_state.h" |
33 #include "cc/resources/resource_provider.h" | 34 #include "cc/resources/resource_provider.h" |
34 #include "cc/tiles/tile_priority.h" | 35 #include "cc/tiles/tile_priority.h" |
35 #include "cc/trees/element_id.h" | 36 #include "cc/trees/element_id.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 return static_cast<ViewportLayerType>(viewport_layer_type_); | 289 return static_cast<ViewportLayerType>(viewport_layer_type_); |
289 } | 290 } |
290 | 291 |
291 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); | 292 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); |
292 gfx::ScrollOffset CurrentScrollOffset() const; | 293 gfx::ScrollOffset CurrentScrollOffset() const; |
293 | 294 |
294 gfx::ScrollOffset MaxScrollOffset() const; | 295 gfx::ScrollOffset MaxScrollOffset() const; |
295 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; | 296 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; |
296 gfx::Vector2dF ClampScrollToMaxScrollOffset(); | 297 gfx::Vector2dF ClampScrollToMaxScrollOffset(); |
297 | 298 |
| 299 void SetScrollBoundaryBehavior(const ScrollBoundaryBehavior&); |
| 300 ScrollBoundaryBehavior scroll_boundary_behavior() { |
| 301 return scroll_boundary_behavior_; |
| 302 } |
| 303 |
298 // Returns the delta of the scroll that was outside of the bounds of the | 304 // Returns the delta of the scroll that was outside of the bounds of the |
299 // initial scroll | 305 // initial scroll |
300 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); | 306 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); |
301 | 307 |
302 void SetScrollClipLayer(int scroll_clip_layer_id); | 308 void SetScrollClipLayer(int scroll_clip_layer_id); |
303 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } | 309 int scroll_clip_layer_id() const { return scroll_clip_layer_id_; } |
304 LayerImpl* scroll_clip_layer() const; | 310 LayerImpl* scroll_clip_layer() const; |
305 bool scrollable() const; | 311 bool scrollable() const; |
306 | 312 |
307 void set_user_scrollable_horizontal(bool scrollable); | 313 void set_user_scrollable_horizontal(bool scrollable); |
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
558 bool has_will_change_transform_hint_ : 1; | 564 bool has_will_change_transform_hint_ : 1; |
559 bool needs_push_properties_ : 1; | 565 bool needs_push_properties_ : 1; |
560 bool scrollbars_hidden_ : 1; | 566 bool scrollbars_hidden_ : 1; |
561 | 567 |
562 // The needs_show_scrollbars_ bit tracks a pending request from Blink to show | 568 // The needs_show_scrollbars_ bit tracks a pending request from Blink to show |
563 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar | 569 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar |
564 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation. | 570 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation. |
565 bool needs_show_scrollbars_ : 1; | 571 bool needs_show_scrollbars_ : 1; |
566 | 572 |
567 bool raster_even_if_not_in_rsll_ : 1; | 573 bool raster_even_if_not_in_rsll_ : 1; |
| 574 ScrollBoundaryBehavior scroll_boundary_behavior_; |
568 | 575 |
569 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 576 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
570 }; | 577 }; |
571 | 578 |
572 } // namespace cc | 579 } // namespace cc |
573 | 580 |
574 #endif // CC_LAYERS_LAYER_IMPL_H_ | 581 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |