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 <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 } | 353 } |
354 int num_unclipped_descendants() const { | 354 int num_unclipped_descendants() const { |
355 return draw_properties_.num_unclipped_descendants; | 355 return draw_properties_.num_unclipped_descendants; |
356 } | 356 } |
357 | 357 |
358 // The client should be responsible for setting bounds, content bounds and | 358 // The client should be responsible for setting bounds, content bounds and |
359 // contents scale to appropriate values. LayerImpl doesn't calculate any of | 359 // contents scale to appropriate values. LayerImpl doesn't calculate any of |
360 // them from the other values. | 360 // them from the other values. |
361 | 361 |
362 void SetBounds(const gfx::Size& bounds); | 362 void SetBounds(const gfx::Size& bounds); |
363 void SetTemporaryImplBounds(const gfx::SizeF& bounds); | |
364 gfx::Size bounds() const; | 363 gfx::Size bounds() const; |
365 gfx::Vector2dF BoundsDelta() const { | 364 void SetBoundsDelta(const gfx::Vector2dF& bounds_delta); |
366 return gfx::Vector2dF(temporary_impl_bounds_.width() - bounds_.width(), | 365 gfx::Vector2dF bounds_delta() const { return bounds_delta_; } |
367 temporary_impl_bounds_.height() - bounds_.height()); | |
368 } | |
369 | 366 |
370 void SetContentBounds(const gfx::Size& content_bounds); | 367 void SetContentBounds(const gfx::Size& content_bounds); |
371 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } | 368 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } |
372 | 369 |
373 float contents_scale_x() const { return draw_properties_.contents_scale_x; } | 370 float contents_scale_x() const { return draw_properties_.contents_scale_x; } |
374 float contents_scale_y() const { return draw_properties_.contents_scale_y; } | 371 float contents_scale_y() const { return draw_properties_.contents_scale_y; } |
375 void SetContentsScale(float contents_scale_x, float contents_scale_y); | 372 void SetContentsScale(float contents_scale_x, float contents_scale_y); |
376 | 373 |
377 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate); | 374 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate); |
378 bool IsExternalFlingActive() const; | 375 bool IsExternalFlingActive() const; |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
598 int mask_layer_id_; | 595 int mask_layer_id_; |
599 scoped_ptr<LayerImpl> mask_layer_; | 596 scoped_ptr<LayerImpl> mask_layer_; |
600 int replica_layer_id_; // ditto | 597 int replica_layer_id_; // ditto |
601 scoped_ptr<LayerImpl> replica_layer_; | 598 scoped_ptr<LayerImpl> replica_layer_; |
602 int layer_id_; | 599 int layer_id_; |
603 LayerTreeImpl* layer_tree_impl_; | 600 LayerTreeImpl* layer_tree_impl_; |
604 | 601 |
605 // Properties synchronized from the associated Layer. | 602 // Properties synchronized from the associated Layer. |
606 gfx::Point3F transform_origin_; | 603 gfx::Point3F transform_origin_; |
607 gfx::Size bounds_; | 604 gfx::Size bounds_; |
608 gfx::SizeF temporary_impl_bounds_; | 605 gfx::Vector2dF bounds_delta_; |
609 gfx::Vector2d scroll_offset_; | 606 gfx::Vector2d scroll_offset_; |
610 ScrollOffsetDelegate* scroll_offset_delegate_; | 607 ScrollOffsetDelegate* scroll_offset_delegate_; |
611 LayerImpl* scroll_clip_layer_; | 608 LayerImpl* scroll_clip_layer_; |
612 bool scrollable_ : 1; | 609 bool scrollable_ : 1; |
613 bool should_scroll_on_main_thread_ : 1; | 610 bool should_scroll_on_main_thread_ : 1; |
614 bool have_wheel_event_handlers_ : 1; | 611 bool have_wheel_event_handlers_ : 1; |
615 bool have_scroll_event_handlers_ : 1; | 612 bool have_scroll_event_handlers_ : 1; |
616 bool user_scrollable_horizontal_ : 1; | 613 bool user_scrollable_horizontal_ : 1; |
617 bool user_scrollable_vertical_ : 1; | 614 bool user_scrollable_vertical_ : 1; |
618 bool stacking_order_changed_ : 1; | 615 bool stacking_order_changed_ : 1; |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 DrawProperties<LayerImpl> draw_properties_; | 701 DrawProperties<LayerImpl> draw_properties_; |
705 | 702 |
706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 703 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
707 | 704 |
708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 705 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
709 }; | 706 }; |
710 | 707 |
711 } // namespace cc | 708 } // namespace cc |
712 | 709 |
713 #endif // CC_LAYERS_LAYER_IMPL_H_ | 710 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |