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 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 void SetContentBounds(const gfx::Size& content_bounds); | 369 void SetContentBounds(const gfx::Size& content_bounds); |
370 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } | 370 gfx::Size content_bounds() const { return draw_properties_.content_bounds; } |
371 | 371 |
372 float contents_scale_x() const { return draw_properties_.contents_scale_x; } | 372 float contents_scale_x() const { return draw_properties_.contents_scale_x; } |
373 float contents_scale_y() const { return draw_properties_.contents_scale_y; } | 373 float contents_scale_y() const { return draw_properties_.contents_scale_y; } |
374 void SetContentsScale(float contents_scale_x, float contents_scale_y); | 374 void SetContentsScale(float contents_scale_x, float contents_scale_y); |
375 | 375 |
376 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate); | 376 void SetScrollOffsetDelegate(ScrollOffsetDelegate* scroll_offset_delegate); |
377 bool IsExternalFlingActive() const; | 377 bool IsExternalFlingActive() const; |
378 | 378 |
379 void SetScrollOffset(const gfx::Vector2d& scroll_offset); | 379 void SetScrollOffset(const gfx::Vector2dF& scroll_offset); |
380 void SetScrollOffsetAndDelta(const gfx::Vector2d& scroll_offset, | 380 void SetScrollOffsetAndDelta(const gfx::Vector2dF& scroll_offset, |
381 const gfx::Vector2dF& scroll_delta); | 381 const gfx::Vector2dF& scroll_delta); |
382 gfx::Vector2d scroll_offset() const { return scroll_offset_; } | 382 gfx::Vector2dF scroll_offset() const { return scroll_offset_; } |
383 | 383 |
384 gfx::Vector2d MaxScrollOffset() const; | 384 gfx::Vector2d MaxScrollOffset() const; |
385 gfx::Vector2dF ClampScrollToMaxScrollOffset(); | 385 gfx::Vector2dF ClampScrollToMaxScrollOffset(); |
386 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer, | 386 void SetScrollbarPosition(ScrollbarLayerImplBase* scrollbar_layer, |
387 LayerImpl* scrollbar_clip_layer) const; | 387 LayerImpl* scrollbar_clip_layer) const; |
388 void SetScrollDelta(const gfx::Vector2dF& scroll_delta); | 388 void SetScrollDelta(const gfx::Vector2dF& scroll_delta); |
389 gfx::Vector2dF ScrollDelta() const; | 389 gfx::Vector2dF ScrollDelta() const; |
390 | 390 |
391 gfx::Vector2dF TotalScrollOffset() const; | 391 gfx::Vector2dF TotalScrollOffset() const; |
392 | 392 |
393 void SetSentScrollDelta(const gfx::Vector2d& sent_scroll_delta); | 393 void SetSentScrollDelta(const gfx::Vector2dF& sent_scroll_delta); |
394 gfx::Vector2d sent_scroll_delta() const { return sent_scroll_delta_; } | 394 gfx::Vector2dF sent_scroll_delta() const { return sent_scroll_delta_; } |
395 | 395 |
396 // Returns the delta of the scroll that was outside of the bounds of the | 396 // Returns the delta of the scroll that was outside of the bounds of the |
397 // initial scroll | 397 // initial scroll |
398 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); | 398 gfx::Vector2dF ScrollBy(const gfx::Vector2dF& scroll); |
399 | 399 |
400 void SetScrollClipLayer(int scroll_clip_layer_id); | 400 void SetScrollClipLayer(int scroll_clip_layer_id); |
401 LayerImpl* scroll_clip_layer() const { return scroll_clip_layer_; } | 401 LayerImpl* scroll_clip_layer() const { return scroll_clip_layer_; } |
402 bool scrollable() const { return !!scroll_clip_layer_; } | 402 bool scrollable() const { return !!scroll_clip_layer_; } |
403 | 403 |
404 void set_user_scrollable_horizontal(bool scrollable) { | 404 void set_user_scrollable_horizontal(bool scrollable) { |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
599 scoped_ptr<LayerImpl> mask_layer_; | 599 scoped_ptr<LayerImpl> mask_layer_; |
600 int replica_layer_id_; // ditto | 600 int replica_layer_id_; // ditto |
601 scoped_ptr<LayerImpl> replica_layer_; | 601 scoped_ptr<LayerImpl> replica_layer_; |
602 int layer_id_; | 602 int layer_id_; |
603 LayerTreeImpl* layer_tree_impl_; | 603 LayerTreeImpl* layer_tree_impl_; |
604 | 604 |
605 // Properties synchronized from the associated Layer. | 605 // Properties synchronized from the associated Layer. |
606 gfx::Point3F transform_origin_; | 606 gfx::Point3F transform_origin_; |
607 gfx::Size bounds_; | 607 gfx::Size bounds_; |
608 gfx::Vector2dF bounds_delta_; | 608 gfx::Vector2dF bounds_delta_; |
609 gfx::Vector2d scroll_offset_; | 609 gfx::Vector2dF scroll_offset_; |
610 ScrollOffsetDelegate* scroll_offset_delegate_; | 610 ScrollOffsetDelegate* scroll_offset_delegate_; |
611 LayerImpl* scroll_clip_layer_; | 611 LayerImpl* scroll_clip_layer_; |
612 bool scrollable_ : 1; | 612 bool scrollable_ : 1; |
613 bool should_scroll_on_main_thread_ : 1; | 613 bool should_scroll_on_main_thread_ : 1; |
614 bool have_wheel_event_handlers_ : 1; | 614 bool have_wheel_event_handlers_ : 1; |
615 bool have_scroll_event_handlers_ : 1; | 615 bool have_scroll_event_handlers_ : 1; |
616 bool user_scrollable_horizontal_ : 1; | 616 bool user_scrollable_horizontal_ : 1; |
617 bool user_scrollable_vertical_ : 1; | 617 bool user_scrollable_vertical_ : 1; |
618 bool stacking_order_changed_ : 1; | 618 bool stacking_order_changed_ : 1; |
619 // Whether the "back" of this layer should draw. | 619 // Whether the "back" of this layer should draw. |
(...skipping 22 matching lines...) Expand all Loading... |
642 SkColor background_color_; | 642 SkColor background_color_; |
643 | 643 |
644 float opacity_; | 644 float opacity_; |
645 SkXfermode::Mode blend_mode_; | 645 SkXfermode::Mode blend_mode_; |
646 gfx::PointF position_; | 646 gfx::PointF position_; |
647 gfx::Transform transform_; | 647 gfx::Transform transform_; |
648 | 648 |
649 LayerPositionConstraint position_constraint_; | 649 LayerPositionConstraint position_constraint_; |
650 | 650 |
651 gfx::Vector2dF scroll_delta_; | 651 gfx::Vector2dF scroll_delta_; |
652 gfx::Vector2d sent_scroll_delta_; | 652 gfx::Vector2dF sent_scroll_delta_; |
653 gfx::Vector2dF last_scroll_offset_; | 653 gfx::Vector2dF last_scroll_offset_; |
654 | 654 |
655 int num_descendants_that_draw_content_; | 655 int num_descendants_that_draw_content_; |
656 | 656 |
657 // The global depth value of the center of the layer. This value is used | 657 // The global depth value of the center of the layer. This value is used |
658 // to sort layers from back to front. | 658 // to sort layers from back to front. |
659 float draw_depth_; | 659 float draw_depth_; |
660 | 660 |
661 FilterOperations filters_; | 661 FilterOperations filters_; |
662 FilterOperations background_filters_; | 662 FilterOperations background_filters_; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 DrawProperties<LayerImpl> draw_properties_; | 704 DrawProperties<LayerImpl> draw_properties_; |
705 | 705 |
706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; | 706 scoped_refptr<base::debug::ConvertableToTraceFormat> debug_info_; |
707 | 707 |
708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 708 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
709 }; | 709 }; |
710 | 710 |
711 } // namespace cc | 711 } // namespace cc |
712 | 712 |
713 #endif // CC_LAYERS_LAYER_IMPL_H_ | 713 #endif // CC_LAYERS_LAYER_IMPL_H_ |
OLD | NEW |