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

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

Issue 130443005: [#5] Pass gfx structs by const ref (gfx::Vector2dF) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporated the review comments Created 6 years, 11 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 | « cc/layers/layer.cc ('k') | 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 <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 10
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 int id() const { return layer_id_; } 77 int id() const { return layer_id_; }
78 78
79 // LayerAnimationValueProvider implementation. 79 // LayerAnimationValueProvider implementation.
80 virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE; 80 virtual gfx::Vector2dF ScrollOffsetForAnimation() const OVERRIDE;
81 81
82 // LayerAnimationValueObserver implementation. 82 // LayerAnimationValueObserver implementation.
83 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE; 83 virtual void OnFilterAnimated(const FilterOperations& filters) OVERRIDE;
84 virtual void OnOpacityAnimated(float opacity) OVERRIDE; 84 virtual void OnOpacityAnimated(float opacity) OVERRIDE;
85 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE; 85 virtual void OnTransformAnimated(const gfx::Transform& transform) OVERRIDE;
86 virtual void OnScrollOffsetAnimated(gfx::Vector2dF scroll_offset) OVERRIDE; 86 virtual void OnScrollOffsetAnimated(
87 const gfx::Vector2dF& scroll_offset) OVERRIDE;
87 virtual void OnAnimationWaitingForDeletion() OVERRIDE; 88 virtual void OnAnimationWaitingForDeletion() OVERRIDE;
88 virtual bool IsActive() const OVERRIDE; 89 virtual bool IsActive() const OVERRIDE;
89 90
90 // Tree structure. 91 // Tree structure.
91 LayerImpl* parent() { return parent_; } 92 LayerImpl* parent() { return parent_; }
92 const LayerImpl* parent() const { return parent_; } 93 const LayerImpl* parent() const { return parent_; }
93 const OwnedLayerImplList& children() const { return children_; } 94 const OwnedLayerImplList& children() const { return children_; }
94 OwnedLayerImplList& children() { return children_; } 95 OwnedLayerImplList& children() { return children_; }
95 LayerImpl* child_at(size_t index) const { return children_[index]; } 96 LayerImpl* child_at(size_t index) const { return children_[index]; }
96 void AddChild(scoped_ptr<LayerImpl> child); 97 void AddChild(scoped_ptr<LayerImpl> child);
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 gfx::PointF position() const { return position_; } 238 gfx::PointF position() const { return position_; }
238 239
239 void SetIsContainerForFixedPositionLayers(bool container) { 240 void SetIsContainerForFixedPositionLayers(bool container) {
240 is_container_for_fixed_position_layers_ = container; 241 is_container_for_fixed_position_layers_ = container;
241 } 242 }
242 // This is a non-trivial function in Layer. 243 // This is a non-trivial function in Layer.
243 bool IsContainerForFixedPositionLayers() const { 244 bool IsContainerForFixedPositionLayers() const {
244 return is_container_for_fixed_position_layers_; 245 return is_container_for_fixed_position_layers_;
245 } 246 }
246 247
247 void SetFixedContainerSizeDelta(gfx::Vector2dF delta) { 248 void SetFixedContainerSizeDelta(const gfx::Vector2dF& delta) {
248 fixed_container_size_delta_ = delta; 249 fixed_container_size_delta_ = delta;
249 } 250 }
250 gfx::Vector2dF fixed_container_size_delta() const { 251 gfx::Vector2dF fixed_container_size_delta() const {
251 return fixed_container_size_delta_; 252 return fixed_container_size_delta_;
252 } 253 }
253 254
254 void SetPositionConstraint(const LayerPositionConstraint& constraint) { 255 void SetPositionConstraint(const LayerPositionConstraint& constraint) {
255 position_constraint_ = constraint; 256 position_constraint_ = constraint;
256 } 257 }
257 const LayerPositionConstraint& position_constraint() const { 258 const LayerPositionConstraint& position_constraint() const {
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
362 float* contents_scale_x, 363 float* contents_scale_x,
363 float* contents_scale_y, 364 float* contents_scale_y,
364 gfx::Size* content_bounds); 365 gfx::Size* content_bounds);
365 366
366 void SetScrollOffsetDelegate( 367 void SetScrollOffsetDelegate(
367 LayerScrollOffsetDelegate* scroll_offset_delegate); 368 LayerScrollOffsetDelegate* scroll_offset_delegate);
368 bool IsExternalFlingActive() const; 369 bool IsExternalFlingActive() const;
369 370
370 void SetScrollOffset(gfx::Vector2d scroll_offset); 371 void SetScrollOffset(gfx::Vector2d scroll_offset);
371 void SetScrollOffsetAndDelta(gfx::Vector2d scroll_offset, 372 void SetScrollOffsetAndDelta(gfx::Vector2d scroll_offset,
372 gfx::Vector2dF scroll_delta); 373 const gfx::Vector2dF& scroll_delta);
373 gfx::Vector2d scroll_offset() const { return scroll_offset_; } 374 gfx::Vector2d scroll_offset() const { return scroll_offset_; }
374 375
375 void SetMaxScrollOffset(gfx::Vector2d max_scroll_offset); 376 void SetMaxScrollOffset(gfx::Vector2d max_scroll_offset);
376 gfx::Vector2d max_scroll_offset() const { return max_scroll_offset_; } 377 gfx::Vector2d max_scroll_offset() const { return max_scroll_offset_; }
377 378
378 void SetScrollDelta(gfx::Vector2dF scroll_delta); 379 void SetScrollDelta(const gfx::Vector2dF& scroll_delta);
379 gfx::Vector2dF ScrollDelta() const; 380 gfx::Vector2dF ScrollDelta() const;
380 381
381 gfx::Vector2dF TotalScrollOffset() const; 382 gfx::Vector2dF TotalScrollOffset() const;
382 383
383 void SetSentScrollDelta(gfx::Vector2d sent_scroll_delta); 384 void SetSentScrollDelta(gfx::Vector2d sent_scroll_delta);
384 gfx::Vector2d sent_scroll_delta() const { return sent_scroll_delta_; } 385 gfx::Vector2d sent_scroll_delta() const { return sent_scroll_delta_; }
385 386
386 // Returns the delta of the scroll that was outside of the bounds of the 387 // Returns the delta of the scroll that was outside of the bounds of the
387 // initial scroll 388 // initial scroll
388 gfx::Vector2dF ScrollBy(gfx::Vector2dF scroll); 389 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll);
389 390
390 void SetScrollable(bool scrollable) { scrollable_ = scrollable; } 391 void SetScrollable(bool scrollable) { scrollable_ = scrollable; }
391 bool scrollable() const { return scrollable_; } 392 bool scrollable() const { return scrollable_; }
392 393
393 void set_user_scrollable_horizontal(bool scrollable) { 394 void set_user_scrollable_horizontal(bool scrollable) {
394 user_scrollable_horizontal_ = scrollable; 395 user_scrollable_horizontal_ = scrollable;
395 } 396 }
396 void set_user_scrollable_vertical(bool scrollable) { 397 void set_user_scrollable_vertical(bool scrollable) {
397 user_scrollable_vertical_ = scrollable; 398 user_scrollable_vertical_ = scrollable;
398 } 399 }
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
667 DrawProperties<LayerImpl> draw_properties_; 668 DrawProperties<LayerImpl> draw_properties_;
668 669
669 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; 670 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_;
670 671
671 DISALLOW_COPY_AND_ASSIGN(LayerImpl); 672 DISALLOW_COPY_AND_ASSIGN(LayerImpl);
672 }; 673 };
673 674
674 } // namespace cc 675 } // namespace cc
675 676
676 #endif // CC_LAYERS_LAYER_IMPL_H_ 677 #endif // CC_LAYERS_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698