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 |
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
262 | 262 |
263 // The client should be responsible for setting bounds, content bounds and | 263 // The client should be responsible for setting bounds, content bounds and |
264 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 264 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
265 // them from the other values. | 265 // them from the other values. |
266 | 266 |
267 void SetBounds(const gfx::Size& bounds); | 267 void SetBounds(const gfx::Size& bounds); |
268 gfx::Size bounds() const; | 268 gfx::Size bounds() const; |
269 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions | 269 // Like bounds() but doesn't snap to int. Lossy on giant pages (e.g. millions |
270 // of pixels) due to use of single precision float. | 270 // of pixels) due to use of single precision float. |
271 gfx::SizeF BoundsForScrolling() const; | 271 gfx::SizeF BoundsForScrolling() const; |
272 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); | 272 void SetViewportBoundsDelta(const gfx::Vector2dF& bounds_delta); |
273 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } | 273 gfx::Vector2dF ViewportBoundsDelta() const; |
wkorman
2017/04/25 18:38:05
Document what this does in brief? In particular, r
| |
274 | 274 |
275 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); | 275 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); |
276 gfx::ScrollOffset CurrentScrollOffset() const; | 276 gfx::ScrollOffset CurrentScrollOffset() const; |
277 | 277 |
278 gfx::ScrollOffset MaxScrollOffset() const; | 278 gfx::ScrollOffset MaxScrollOffset() const; |
279 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; | 279 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; |
280 gfx::Vector2dF ClampScrollToMaxScrollOffset(); | 280 gfx::Vector2dF ClampScrollToMaxScrollOffset(); |
281 | 281 |
282 // Returns the delta of the scroll that was outside of the bounds of the | 282 // Returns the delta of the scroll that was outside of the bounds of the |
283 // initial scroll | 283 // initial scroll |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
464 | 464 |
465 void ValidateQuadResourcesInternal(DrawQuad* quad) const; | 465 void ValidateQuadResourcesInternal(DrawQuad* quad) const; |
466 | 466 |
467 virtual const char* LayerTypeAsString() const; | 467 virtual const char* LayerTypeAsString() const; |
468 | 468 |
469 int layer_id_; | 469 int layer_id_; |
470 LayerTreeImpl* layer_tree_impl_; | 470 LayerTreeImpl* layer_tree_impl_; |
471 | 471 |
472 std::unique_ptr<LayerImplTestProperties> test_properties_; | 472 std::unique_ptr<LayerImplTestProperties> test_properties_; |
473 | 473 |
474 gfx::Vector2dF bounds_delta_; | |
475 | |
476 // Properties synchronized from the associated Layer. | 474 // Properties synchronized from the associated Layer. |
477 gfx::Size bounds_; | 475 gfx::Size bounds_; |
478 int scroll_clip_layer_id_; | 476 int scroll_clip_layer_id_; |
479 | 477 |
480 gfx::Vector2dF offset_to_transform_parent_; | 478 gfx::Vector2dF offset_to_transform_parent_; |
481 uint32_t main_thread_scrolling_reasons_; | 479 uint32_t main_thread_scrolling_reasons_; |
482 | 480 |
483 bool user_scrollable_horizontal_ : 1; | 481 bool user_scrollable_horizontal_ : 1; |
484 bool user_scrollable_vertical_ : 1; | 482 bool user_scrollable_vertical_ : 1; |
485 bool should_flatten_transform_from_property_tree_ : 1; | 483 bool should_flatten_transform_from_property_tree_ : 1; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
553 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar | 551 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar |
554 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation. | 552 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation. |
555 bool needs_show_scrollbars_ : 1; | 553 bool needs_show_scrollbars_ : 1; |
556 | 554 |
557 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 555 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
558 }; | 556 }; |
559 | 557 |
560 } // namespace cc | 558 } // namespace cc |
561 | 559 |
562 #endif // CC_LAYERS_LAYER_IMPL_H_ | 560 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |