| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_TREES_LAYER_TREE_IMPL_H_ | 5 #ifndef CC_TREES_LAYER_TREE_IMPL_H_ |
| 6 #define CC_TREES_LAYER_TREE_IMPL_H_ | 6 #define CC_TREES_LAYER_TREE_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <unordered_map> | 11 #include <unordered_map> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/macros.h" | 14 #include "base/macros.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "cc/base/synced_property.h" | 16 #include "cc/base/synced_property.h" |
| 17 #include "cc/input/event_listener_properties.h" |
| 17 #include "cc/input/layer_selection_bound.h" | 18 #include "cc/input/layer_selection_bound.h" |
| 18 #include "cc/layers/layer_impl.h" | 19 #include "cc/layers/layer_impl.h" |
| 19 #include "cc/output/begin_frame_args.h" | 20 #include "cc/output/begin_frame_args.h" |
| 20 #include "cc/output/renderer.h" | 21 #include "cc/output/renderer.h" |
| 21 #include "cc/output/swap_promise.h" | 22 #include "cc/output/swap_promise.h" |
| 22 #include "cc/resources/ui_resource_client.h" | 23 #include "cc/resources/ui_resource_client.h" |
| 23 #include "cc/trees/layer_tree_host_impl.h" | 24 #include "cc/trees/layer_tree_host_impl.h" |
| 24 #include "cc/trees/property_tree.h" | 25 #include "cc/trees/property_tree.h" |
| 25 | 26 |
| 26 namespace base { | 27 namespace base { |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 const gfx::BoxF& box, | 437 const gfx::BoxF& box, |
| 437 gfx::BoxF* bounds) const; | 438 gfx::BoxF* bounds) const; |
| 438 | 439 |
| 439 bool have_scroll_event_handlers() const { | 440 bool have_scroll_event_handlers() const { |
| 440 return have_scroll_event_handlers_; | 441 return have_scroll_event_handlers_; |
| 441 } | 442 } |
| 442 void set_have_scroll_event_handlers(bool have_event_handlers) { | 443 void set_have_scroll_event_handlers(bool have_event_handlers) { |
| 443 have_scroll_event_handlers_ = have_event_handlers; | 444 have_scroll_event_handlers_ = have_event_handlers; |
| 444 } | 445 } |
| 445 | 446 |
| 446 bool have_wheel_event_handlers() const { return have_wheel_event_handlers_; } | 447 EventListenerProperties event_listener_properties( |
| 447 void set_have_wheel_event_handlers(bool have_event_handlers) { | 448 EventListenerClass event_class) const { |
| 448 have_wheel_event_handlers_ = have_event_handlers; | 449 return event_listener_properties_[static_cast<size_t>(event_class)]; |
| 450 } |
| 451 void set_event_listener_properties(EventListenerClass event_class, |
| 452 EventListenerProperties event_properties) { |
| 453 event_listener_properties_[static_cast<size_t>(event_class)] = |
| 454 event_properties; |
| 449 } | 455 } |
| 450 | 456 |
| 451 protected: | 457 protected: |
| 452 explicit LayerTreeImpl( | 458 explicit LayerTreeImpl( |
| 453 LayerTreeHostImpl* layer_tree_host_impl, | 459 LayerTreeHostImpl* layer_tree_host_impl, |
| 454 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, | 460 scoped_refptr<SyncedProperty<ScaleGroup>> page_scale_factor, |
| 455 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, | 461 scoped_refptr<SyncedTopControls> top_controls_shown_ratio, |
| 456 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); | 462 scoped_refptr<SyncedElasticOverscroll> elastic_overscroll); |
| 457 float ClampPageScaleFactorToLimits(float page_scale_factor) const; | 463 float ClampPageScaleFactorToLimits(float page_scale_factor) const; |
| 458 void PushPageScaleFactorAndLimits(const float* page_scale_factor, | 464 void PushPageScaleFactorAndLimits(const float* page_scale_factor, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 bool has_ever_been_drawn_; | 535 bool has_ever_been_drawn_; |
| 530 | 536 |
| 531 std::vector<scoped_ptr<SwapPromise>> swap_promise_list_; | 537 std::vector<scoped_ptr<SwapPromise>> swap_promise_list_; |
| 532 std::vector<scoped_ptr<SwapPromise>> pinned_swap_promise_list_; | 538 std::vector<scoped_ptr<SwapPromise>> pinned_swap_promise_list_; |
| 533 | 539 |
| 534 UIResourceRequestQueue ui_resource_request_queue_; | 540 UIResourceRequestQueue ui_resource_request_queue_; |
| 535 | 541 |
| 536 int render_surface_layer_list_id_; | 542 int render_surface_layer_list_id_; |
| 537 | 543 |
| 538 bool have_scroll_event_handlers_; | 544 bool have_scroll_event_handlers_; |
| 539 bool have_wheel_event_handlers_; | 545 EventListenerProperties event_listener_properties_[static_cast<size_t>( |
| 546 EventListenerClass::kNumClasses)]; |
| 540 | 547 |
| 541 // Whether or not Blink's viewport size was shrunk by the height of the top | 548 // Whether or not Blink's viewport size was shrunk by the height of the top |
| 542 // controls at the time of the last layout. | 549 // controls at the time of the last layout. |
| 543 bool top_controls_shrink_blink_size_; | 550 bool top_controls_shrink_blink_size_; |
| 544 float top_controls_height_; | 551 float top_controls_height_; |
| 545 | 552 |
| 546 // The amount that the top controls are shown from 0 (hidden) to 1 (fully | 553 // The amount that the top controls are shown from 0 (hidden) to 1 (fully |
| 547 // shown). | 554 // shown). |
| 548 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; | 555 scoped_refptr<SyncedTopControls> top_controls_shown_ratio_; |
| 549 | 556 |
| 550 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; | 557 scoped_ptr<PendingPageScaleAnimation> pending_page_scale_animation_; |
| 551 | 558 |
| 552 private: | 559 private: |
| 553 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); | 560 DISALLOW_COPY_AND_ASSIGN(LayerTreeImpl); |
| 554 }; | 561 }; |
| 555 | 562 |
| 556 } // namespace cc | 563 } // namespace cc |
| 557 | 564 |
| 558 #endif // CC_TREES_LAYER_TREE_IMPL_H_ | 565 #endif // CC_TREES_LAYER_TREE_IMPL_H_ |
| OLD | NEW |