OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TREES_SCROLL_NODE_H_ | 5 #ifndef CC_TREES_SCROLL_NODE_H_ |
6 #define CC_TREES_SCROLL_NODE_H_ | 6 #define CC_TREES_SCROLL_NODE_H_ |
7 | 7 |
8 #include "cc/base/cc_export.h" | 8 #include "cc/base/cc_export.h" |
9 #include "cc/output/filter_operations.h" | 9 #include "cc/output/filter_operations.h" |
10 #include "ui/gfx/geometry/size.h" | 10 #include "ui/gfx/geometry/size.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 namespace trace_event { | 13 namespace trace_event { |
14 class TracedValue; | 14 class TracedValue; |
15 } // namespace trace_event | 15 } // namespace trace_event |
16 } // namespace base | 16 } // namespace base |
17 | 17 |
18 namespace cc { | 18 namespace cc { |
19 | 19 |
20 namespace proto { | 20 namespace proto { |
21 class TreeNode; | 21 class TreeNode; |
22 } // namespace proto | 22 } // namespace proto |
23 | 23 |
24 struct CC_EXPORT ScrollNode { | 24 struct CC_EXPORT ScrollNode { |
25 ScrollNode(); | 25 ScrollNode(); |
26 ScrollNode(const ScrollNode& other); | 26 ScrollNode(const ScrollNode& other); |
27 | 27 |
28 int id; | 28 int id; |
29 int parent_id; | 29 int parent_id; |
30 | |
31 // This is the layer id that corresponds to the layer that is scrolled. In | |
32 // blink this corresponds to the scrolling content layer. | |
33 // TODO(pdr): Clarify this with Ali and Xianda. | |
30 int owner_id; | 34 int owner_id; |
31 | 35 |
36 // This could be false when you have a layer that is not scrollable itself but | |
37 // is inside a scroller. | |
38 // TODO(pdr): Clarify this with Ali and Xianda. | |
32 bool scrollable; | 39 bool scrollable; |
40 | |
33 uint32_t main_thread_scrolling_reasons; | 41 uint32_t main_thread_scrolling_reasons; |
34 bool contains_non_fast_scrollable_region; | 42 bool contains_non_fast_scrollable_region; |
43 | |
44 // Size of the clipped area, not including scrollbars. | |
chrishtr
2016/09/02 18:04:37
Except for overlay scrollbars.
| |
35 gfx::Size scroll_clip_layer_bounds; | 45 gfx::Size scroll_clip_layer_bounds; |
46 | |
47 // Bounds of the overflow scrolling area. | |
36 gfx::Size bounds; | 48 gfx::Size bounds; |
49 | |
37 bool max_scroll_offset_affected_by_page_scale; | 50 bool max_scroll_offset_affected_by_page_scale; |
38 bool is_inner_viewport_scroll_layer; | 51 bool is_inner_viewport_scroll_layer; |
39 bool is_outer_viewport_scroll_layer; | 52 bool is_outer_viewport_scroll_layer; |
53 | |
54 // TODO(pdr): Clarify this with Ali and Xianda. | |
55 // Why isn't this == TransformToOffsetParent(Transform(transform_id)). | |
chrishtr
2016/09/02 18:04:37
Used if |scrollable| is false, and there doesn't h
| |
40 gfx::Vector2dF offset_to_transform_parent; | 56 gfx::Vector2dF offset_to_transform_parent; |
57 | |
41 bool should_flatten; | 58 bool should_flatten; |
42 bool user_scrollable_horizontal; | 59 bool user_scrollable_horizontal; |
43 bool user_scrollable_vertical; | 60 bool user_scrollable_vertical; |
44 ElementId element_id; | 61 ElementId element_id; |
45 int transform_id; | 62 int transform_id; |
63 | |
46 // Number of drawn layers pointing to this node or any of its descendants. | 64 // Number of drawn layers pointing to this node or any of its descendants. |
47 int num_drawn_descendants; | 65 int num_drawn_descendants; |
48 | 66 |
49 bool operator==(const ScrollNode& other) const; | 67 bool operator==(const ScrollNode& other) const; |
50 | 68 |
51 void ToProtobuf(proto::TreeNode* proto) const; | 69 void ToProtobuf(proto::TreeNode* proto) const; |
52 void FromProtobuf(const proto::TreeNode& proto); | 70 void FromProtobuf(const proto::TreeNode& proto); |
53 void AsValueInto(base::trace_event::TracedValue* value) const; | 71 void AsValueInto(base::trace_event::TracedValue* value) const; |
54 }; | 72 }; |
55 | 73 |
56 } // namespace cc | 74 } // namespace cc |
57 | 75 |
58 #endif // CC_TREES_SCROLL_NODE_H_ | 76 #endif // CC_TREES_SCROLL_NODE_H_ |
OLD | NEW |