| 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 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/logging.h" | 12 #include "base/logging.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "cc/animation/animation_delegate.h" | 15 #include "cc/animation/animation_delegate.h" |
| 16 #include "cc/animation/layer_animation_controller.h" | 16 #include "cc/animation/layer_animation_controller.h" |
| 17 #include "cc/animation/layer_animation_value_observer.h" | 17 #include "cc/animation/layer_animation_value_observer.h" |
| 18 #include "cc/animation/layer_animation_value_provider.h" | 18 #include "cc/animation/layer_animation_value_provider.h" |
| 19 #include "cc/base/cc_export.h" | 19 #include "cc/base/cc_export.h" |
| 20 #include "cc/base/region.h" | 20 #include "cc/base/region.h" |
| 21 #include "cc/base/scoped_ptr_vector.h" | 21 #include "cc/base/scoped_ptr_vector.h" |
| 22 #include "cc/base/synced_property.h" | 22 #include "cc/base/synced_property.h" |
| 23 #include "cc/debug/frame_timing_request.h" | 23 #include "cc/debug/frame_timing_request.h" |
| 24 #include "cc/input/input_handler.h" | 24 #include "cc/input/input_handler.h" |
| 25 #include "cc/input/scrollbar.h" | 25 #include "cc/input/scrollbar.h" |
| 26 #include "cc/layers/draw_properties.h" | 26 #include "cc/layers/draw_properties.h" |
| 27 #include "cc/layers/layer_lists.h" | 27 #include "cc/layers/layer_lists.h" |
| 28 #include "cc/layers/layer_position_constraint.h" | 28 #include "cc/layers/layer_position_constraint.h" |
| 29 #include "cc/layers/render_surface_impl.h" | 29 #include "cc/layers/render_surface_impl.h" |
| 30 #include "cc/layers/scroll_blocks_on.h" |
| 30 #include "cc/output/filter_operations.h" | 31 #include "cc/output/filter_operations.h" |
| 31 #include "cc/quads/shared_quad_state.h" | 32 #include "cc/quads/shared_quad_state.h" |
| 32 #include "cc/resources/resource_provider.h" | 33 #include "cc/resources/resource_provider.h" |
| 33 #include "skia/ext/refptr.h" | 34 #include "skia/ext/refptr.h" |
| 34 #include "third_party/skia/include/core/SkColor.h" | 35 #include "third_party/skia/include/core/SkColor.h" |
| 35 #include "third_party/skia/include/core/SkImageFilter.h" | 36 #include "third_party/skia/include/core/SkImageFilter.h" |
| 36 #include "third_party/skia/include/core/SkPicture.h" | 37 #include "third_party/skia/include/core/SkPicture.h" |
| 37 #include "ui/gfx/geometry/point3_f.h" | 38 #include "ui/gfx/geometry/point3_f.h" |
| 38 #include "ui/gfx/geometry/rect.h" | 39 #include "ui/gfx/geometry/rect.h" |
| 39 #include "ui/gfx/geometry/rect_f.h" | 40 #include "ui/gfx/geometry/rect_f.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 return non_fast_scrollable_region_; | 468 return non_fast_scrollable_region_; |
| 468 } | 469 } |
| 469 | 470 |
| 470 void SetTouchEventHandlerRegion(const Region& region) { | 471 void SetTouchEventHandlerRegion(const Region& region) { |
| 471 touch_event_handler_region_ = region; | 472 touch_event_handler_region_ = region; |
| 472 } | 473 } |
| 473 const Region& touch_event_handler_region() const { | 474 const Region& touch_event_handler_region() const { |
| 474 return touch_event_handler_region_; | 475 return touch_event_handler_region_; |
| 475 } | 476 } |
| 476 | 477 |
| 478 void SetScrollBlocksOn(ScrollBlocksOn scroll_blocks_on) { |
| 479 scroll_blocks_on_ = scroll_blocks_on; |
| 480 } |
| 481 ScrollBlocksOn scroll_blocks_on() const { return scroll_blocks_on_; } |
| 477 void SetDrawCheckerboardForMissingTiles(bool checkerboard) { | 482 void SetDrawCheckerboardForMissingTiles(bool checkerboard) { |
| 478 draw_checkerboard_for_missing_tiles_ = checkerboard; | 483 draw_checkerboard_for_missing_tiles_ = checkerboard; |
| 479 } | 484 } |
| 480 bool draw_checkerboard_for_missing_tiles() const { | 485 bool draw_checkerboard_for_missing_tiles() const { |
| 481 return draw_checkerboard_for_missing_tiles_; | 486 return draw_checkerboard_for_missing_tiles_; |
| 482 } | 487 } |
| 483 | 488 |
| 484 InputHandler::ScrollStatus TryScroll( | 489 InputHandler::ScrollStatus TryScroll( |
| 485 const gfx::PointF& screen_space_point, | 490 const gfx::PointF& screen_space_point, |
| 486 InputHandler::ScrollInputType type) const; | 491 InputHandler::ScrollInputType type, |
| 492 ScrollBlocksOn effective_block_mode) const; |
| 487 | 493 |
| 488 void SetDoubleSided(bool double_sided); | 494 void SetDoubleSided(bool double_sided); |
| 489 bool double_sided() const { return double_sided_; } | 495 bool double_sided() const { return double_sided_; } |
| 490 | 496 |
| 491 void SetTransform(const gfx::Transform& transform); | 497 void SetTransform(const gfx::Transform& transform); |
| 492 const gfx::Transform& transform() const { return transform_; } | 498 const gfx::Transform& transform() const { return transform_; } |
| 493 bool TransformIsAnimating() const; | 499 bool TransformIsAnimating() const; |
| 494 bool TransformIsAnimatingOnImplOnly() const; | 500 bool TransformIsAnimatingOnImplOnly() const; |
| 495 void SetTransformAndInvertibility(const gfx::Transform& transform, | 501 void SetTransformAndInvertibility(const gfx::Transform& transform, |
| 496 bool transform_is_invertible); | 502 bool transform_is_invertible); |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 | 656 |
| 651 // Properties synchronized from the associated Layer. | 657 // Properties synchronized from the associated Layer. |
| 652 gfx::Point3F transform_origin_; | 658 gfx::Point3F transform_origin_; |
| 653 gfx::Size bounds_; | 659 gfx::Size bounds_; |
| 654 ScrollOffsetDelegate* scroll_offset_delegate_; | 660 ScrollOffsetDelegate* scroll_offset_delegate_; |
| 655 LayerImpl* scroll_clip_layer_; | 661 LayerImpl* scroll_clip_layer_; |
| 656 bool scrollable_ : 1; | 662 bool scrollable_ : 1; |
| 657 bool should_scroll_on_main_thread_ : 1; | 663 bool should_scroll_on_main_thread_ : 1; |
| 658 bool have_wheel_event_handlers_ : 1; | 664 bool have_wheel_event_handlers_ : 1; |
| 659 bool have_scroll_event_handlers_ : 1; | 665 bool have_scroll_event_handlers_ : 1; |
| 666 |
| 667 static_assert(ScrollBlocksOnMax < (1 << 3), "ScrollBlocksOn too big"); |
| 668 ScrollBlocksOn scroll_blocks_on_ : 3; |
| 669 |
| 660 bool user_scrollable_horizontal_ : 1; | 670 bool user_scrollable_horizontal_ : 1; |
| 661 bool user_scrollable_vertical_ : 1; | 671 bool user_scrollable_vertical_ : 1; |
| 662 bool stacking_order_changed_ : 1; | 672 bool stacking_order_changed_ : 1; |
| 663 // Whether the "back" of this layer should draw. | 673 // Whether the "back" of this layer should draw. |
| 664 bool double_sided_ : 1; | 674 bool double_sided_ : 1; |
| 665 bool should_flatten_transform_ : 1; | 675 bool should_flatten_transform_ : 1; |
| 666 | 676 |
| 667 // Tracks if drawing-related properties have changed since last redraw. | 677 // Tracks if drawing-related properties have changed since last redraw. |
| 668 bool layer_property_changed_ : 1; | 678 bool layer_property_changed_ : 1; |
| 669 | 679 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 | 759 |
| 750 std::vector<FrameTimingRequest> frame_timing_requests_; | 760 std::vector<FrameTimingRequest> frame_timing_requests_; |
| 751 bool frame_timing_requests_dirty_; | 761 bool frame_timing_requests_dirty_; |
| 752 | 762 |
| 753 DISALLOW_COPY_AND_ASSIGN(LayerImpl); | 763 DISALLOW_COPY_AND_ASSIGN(LayerImpl); |
| 754 }; | 764 }; |
| 755 | 765 |
| 756 } // namespace cc | 766 } // namespace cc |
| 757 | 767 |
| 758 #endif // CC_LAYERS_LAYER_IMPL_H_ | 768 #endif // CC_LAYERS_LAYER_IMPL_H_ |
| OLD | NEW |