Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Side by Side Diff: cc/layers/layer_impl.h

Issue 2840433002: Move LayerImpl's bounds_delta to property trees (Closed)
Patch Set: Document ViewportBoundsDelta better Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | cc/layers/layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
273 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } 273 // Viewport bounds delta are used for viewport layers and accounts for changes
274 // in the viewport layers from browser controls and page scale factors. These
275 // deltas are only set on the active tree.
276 void SetViewportBoundsDelta(const gfx::Vector2dF& bounds_delta);
277 gfx::Vector2dF ViewportBoundsDelta() const;
274 278
275 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset); 279 void SetCurrentScrollOffset(const gfx::ScrollOffset& scroll_offset);
276 gfx::ScrollOffset CurrentScrollOffset() const; 280 gfx::ScrollOffset CurrentScrollOffset() const;
277 281
278 gfx::ScrollOffset MaxScrollOffset() const; 282 gfx::ScrollOffset MaxScrollOffset() const;
279 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const; 283 gfx::ScrollOffset ClampScrollOffsetToLimits(gfx::ScrollOffset offset) const;
280 gfx::Vector2dF ClampScrollToMaxScrollOffset(); 284 gfx::Vector2dF ClampScrollToMaxScrollOffset();
281 285
282 // Returns the delta of the scroll that was outside of the bounds of the 286 // Returns the delta of the scroll that was outside of the bounds of the
283 // initial scroll 287 // initial scroll
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
464 468
465 void ValidateQuadResourcesInternal(DrawQuad* quad) const; 469 void ValidateQuadResourcesInternal(DrawQuad* quad) const;
466 470
467 virtual const char* LayerTypeAsString() const; 471 virtual const char* LayerTypeAsString() const;
468 472
469 int layer_id_; 473 int layer_id_;
470 LayerTreeImpl* layer_tree_impl_; 474 LayerTreeImpl* layer_tree_impl_;
471 475
472 std::unique_ptr<LayerImplTestProperties> test_properties_; 476 std::unique_ptr<LayerImplTestProperties> test_properties_;
473 477
474 gfx::Vector2dF bounds_delta_;
475
476 // Properties synchronized from the associated Layer. 478 // Properties synchronized from the associated Layer.
477 gfx::Size bounds_; 479 gfx::Size bounds_;
478 int scroll_clip_layer_id_; 480 int scroll_clip_layer_id_;
479 481
480 gfx::Vector2dF offset_to_transform_parent_; 482 gfx::Vector2dF offset_to_transform_parent_;
481 uint32_t main_thread_scrolling_reasons_; 483 uint32_t main_thread_scrolling_reasons_;
482 484
483 bool user_scrollable_horizontal_ : 1; 485 bool user_scrollable_horizontal_ : 1;
484 bool user_scrollable_vertical_ : 1; 486 bool user_scrollable_vertical_ : 1;
485 bool should_flatten_transform_from_property_tree_ : 1; 487 bool should_flatten_transform_from_property_tree_ : 1;
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
553 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar 555 // the overlay scrollbars. It's set on the scroll layer (not the scrollbar
554 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation. 556 // layers) and consumed by LayerTreeImpl::PushPropertiesTo during activation.
555 bool needs_show_scrollbars_ : 1; 557 bool needs_show_scrollbars_ : 1;
556 558
557 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 559 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
558 }; 560 };
559 561
560 } // namespace cc 562 } // namespace cc
561 563
562 #endif // CC_LAYERS_LAYER_IMPL_H_ 564 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698