OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 virtual void setScrollParent(WebLayer*) = 0; | 157 virtual void setScrollParent(WebLayer*) = 0; |
158 | 158 |
159 // A layer will not respect any clips established by layers between it and | 159 // A layer will not respect any clips established by layers between it and |
160 // its nearest clipping ancestor. Note, the clip parent must be an ancestor. | 160 // its nearest clipping ancestor. Note, the clip parent must be an ancestor. |
161 // This is not a requirement of the scroll parent. | 161 // This is not a requirement of the scroll parent. |
162 virtual void setClipParent(WebLayer*) = 0; | 162 virtual void setClipParent(WebLayer*) = 0; |
163 | 163 |
164 // Scrolling | 164 // Scrolling |
165 virtual void setScrollPositionDouble(WebDoublePoint) = 0; | 165 virtual void setScrollPositionDouble(WebDoublePoint) = 0; |
166 virtual WebDoublePoint scrollPositionDouble() const = 0; | 166 virtual WebDoublePoint scrollPositionDouble() const = 0; |
| 167 // Blink tells cc the scroll offset through setScrollPositionDouble() using |
| 168 // floating precision but it currently can only position cc layers at intege
r |
| 169 // boundary. So Blink needs to also call setScrollCompensationAdjustment() |
| 170 // to tell cc what's the part of the scroll offset that Blink doesn't handle |
| 171 // but cc needs to take into consideration, e.g. compensating |
| 172 // for fixed-position layer that's positioned in Blink using only integer sc
roll |
| 173 // offset. |
| 174 // We make this call explicit, instead of letting cc to infer the fractional
part |
| 175 // from the scroll offset, to be clear that this is Blink's limitation. Once |
| 176 // Blink can fully handle fractional scroll offset, it can stop calling |
| 177 // this function and cc side would just work. |
| 178 virtual void setScrollCompensationAdjustment(WebDoublePoint) = 0; |
167 | 179 |
168 // To set a WebLayer as scrollable we must specify the corresponding clip la
yer. | 180 // To set a WebLayer as scrollable we must specify the corresponding clip la
yer. |
169 virtual void setScrollClipLayer(WebLayer*) = 0; | 181 virtual void setScrollClipLayer(WebLayer*) = 0; |
170 virtual bool scrollable() const = 0; | 182 virtual bool scrollable() const = 0; |
171 virtual void setUserScrollable(bool horizontal, bool vertical) = 0; | 183 virtual void setUserScrollable(bool horizontal, bool vertical) = 0; |
172 virtual bool userScrollableHorizontal() const = 0; | 184 virtual bool userScrollableHorizontal() const = 0; |
173 virtual bool userScrollableVertical() const = 0; | 185 virtual bool userScrollableVertical() const = 0; |
174 | 186 |
175 virtual void setHaveWheelEventHandlers(bool) = 0; | 187 virtual void setHaveWheelEventHandlers(bool) = 0; |
176 virtual bool haveWheelEventHandlers() const = 0; | 188 virtual bool haveWheelEventHandlers() const = 0; |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
212 | 224 |
213 // True if the layer is not part of a tree attached to a WebLayerTreeView. | 225 // True if the layer is not part of a tree attached to a WebLayerTreeView. |
214 virtual bool isOrphan() const = 0; | 226 virtual bool isOrphan() const = 0; |
215 | 227 |
216 virtual void setWebLayerClient(WebLayerClient*) = 0; | 228 virtual void setWebLayerClient(WebLayerClient*) = 0; |
217 }; | 229 }; |
218 | 230 |
219 } // namespace blink | 231 } // namespace blink |
220 | 232 |
221 #endif // WebLayer_h | 233 #endif // WebLayer_h |
OLD | NEW |