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_mode.h" | 27 #include "cc/layers/draw_mode.h" |
27 #include "cc/layers/draw_properties.h" | 28 #include "cc/layers/draw_properties.h" |
28 #include "cc/layers/layer_collections.h" | 29 #include "cc/layers/layer_collections.h" |
29 #include "cc/layers/layer_impl_test_properties.h" | 30 #include "cc/layers/layer_impl_test_properties.h" |
30 #include "cc/layers/layer_position_constraint.h" | 31 #include "cc/layers/layer_position_constraint.h" |
31 #include "cc/layers/performance_properties.h" | 32 #include "cc/layers/performance_properties.h" |
32 #include "cc/layers/render_surface_impl.h" | 33 #include "cc/layers/render_surface_impl.h" |
33 #include "cc/layers/touch_action_region.h" | 34 #include "cc/layers/touch_action_region.h" |
34 #include "cc/quads/shared_quad_state.h" | 35 #include "cc/quads/shared_quad_state.h" |
35 #include "cc/resources/resource_provider.h" | 36 #include "cc/resources/resource_provider.h" |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
284 return viewport_layer_type() != NOT_VIEWPORT_LAYER; | 285 return viewport_layer_type() != NOT_VIEWPORT_LAYER; |
285 } | 286 } |
286 | 287 |
287 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); | 288 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); |
288 gfx::ScrollOffset CurrentScrollOffset() const; | 289 gfx::ScrollOffset CurrentScrollOffset() const; |
289 | 290 |
290 gfx::ScrollOffset MaxScrollOffset() const; | 291 gfx::ScrollOffset MaxScrollOffset() const; |
291 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; | 292 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; |
292 gfx::Vector2dF ClampScrollToMaxScrollOffset(); | 293 gfx::Vector2dF ClampScrollToMaxScrollOffset(); |
293 | 294 |
295 void SetScrollBoundaryBehavior(const ScrollBoundaryBehavior&); | |
296 ScrollBoundaryBehavior scroll_boundary_behavior() { | |
297 return scroll_boundary_behavior_; | |
ajuma
2017/06/30 20:46:49
Does LayerImpl need to have a copy of this value,
sunyunjia
2017/07/14 02:59:00
Done.
| |
298 } | |
299 | |
294 // Returns the delta of the scroll that was outside of the bounds of the | 300 // Returns the delta of the scroll that was outside of the bounds of the |
295 // initial scroll | 301 // initial scroll |
296 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); | 302 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); |
297 | 303 |
298 // Marks this layer as being scrollable and needing an associated scroll node. | 304 // Marks this layer as being scrollable and needing an associated scroll node. |
299 // The scroll node's bounds and scroll_clip_layer_bounds will be kept in sync | 305 // The scroll node's bounds and scroll_clip_layer_bounds will be kept in sync |
300 // with this layer. | 306 // with this layer. |
301 void SetScrollable(const gfx::Size& bounds); | 307 void SetScrollable(const gfx::Size& bounds); |
302 gfx::Size scroll_container_bounds() const { return scroll_container_bounds_; } | 308 gfx::Size scroll_container_bounds() const { return scroll_container_bounds_; } |
303 bool scrollable() const { return scrollable_; } | 309 bool scrollable() const { return scrollable_; } |
(...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
558 bool needs_show_scrollbars_ : 1; | 564 bool needs_show_scrollbars_ : 1; |
559 | 565 |
560 // This is set for layers that have a property because of which they are not | 566 // This is set for layers that have a property because of which they are not |
561 // drawn (singular transforms), but they can become visible soon (the property | 567 // drawn (singular transforms), but they can become visible soon (the property |
562 // is being animated). For this reason, while these layers are not drawn, they | 568 // is being animated). For this reason, while these layers are not drawn, they |
563 // are still rasterized. | 569 // are still rasterized. |
564 bool raster_even_if_not_drawn_ : 1; | 570 bool raster_even_if_not_drawn_ : 1; |
565 | 571 |
566 bool has_transform_node_ : 1; | 572 bool has_transform_node_ : 1; |
567 | 573 |
574 ScrollBoundaryBehavior scroll_boundary_behavior_; | |
575 | |
568 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 576 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
569 }; | 577 }; |
570 | 578 |
571 } // namespace cc | 579 } // namespace cc |
572 | 580 |
573 #endif // CC_LAYERS_LAYER_IMPL_H_ | 581 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |