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(ScrollBoundaryBehavior); | |
bokan
2017/05/19 19:35:57
pass by const-ref
sunyunjia
2017/05/25 20:07:10
Done.
| |
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 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
570 bool has_will_change_transform_hint_ : 1; | 576 bool has_will_change_transform_hint_ : 1; |
571 bool needs_push_properties_ : 1; | 577 bool needs_push_properties_ : 1; |
572 bool scrollbars_hidden_ : 1; | 578 bool scrollbars_hidden_ : 1; |
573 | 579 |
574 // The needs_show_scrollbars_ bit tracks a pending request from Blink to show | 580 // The needs_show_scrollbars_ bit tracks a pending request from Blink to show |
575 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar | 581 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar |
576 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation. | 582 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation. |
577 bool needs_show_scrollbars_ : 1; | 583 bool needs_show_scrollbars_ : 1; |
578 | 584 |
579 bool raster_even_if_not_in_rsll_ : 1; | 585 bool raster_even_if_not_in_rsll_ : 1; |
586 ScrollBoundaryBehavior scroll_boundary_behavior_; | |
580 | 587 |
581 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 588 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
582 }; | 589 }; |
583 | 590 |
584 } // namespace cc | 591 } // namespace cc |
585 | 592 |
586 #endif // CC_LAYERS_LAYER_IMPL_H_ | 593 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |