Chromium Code Reviews| 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 #include "cc/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 1892 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1903 SetNeedsRedraw(); | 1903 SetNeedsRedraw(); |
| 1904 } | 1904 } |
| 1905 | 1905 |
| 1906 if (input_handler_client_) | 1906 if (input_handler_client_) |
| 1907 input_handler_client_->DeliverInputForBeginFrame(); | 1907 input_handler_client_->DeliverInputForBeginFrame(); |
| 1908 | 1908 |
| 1909 Animate(); | 1909 Animate(); |
| 1910 | 1910 |
| 1911 for (auto* it : video_frame_controllers_) | 1911 for (auto* it : video_frame_controllers_) |
| 1912 it->OnBeginFrame(args); | 1912 it->OnBeginFrame(args); |
| 1913 | |
| 1914 input_handler_state_ = InputHandlerState::INSIDE_IMPL_FRAME; | |
| 1913 } | 1915 } |
| 1914 | 1916 |
| 1915 void LayerTreeHostImpl::DidFinishImplFrame() { | 1917 void LayerTreeHostImpl::DidFinishImplFrame() { |
| 1918 input_handler_state_ = InputHandlerState::IDLE; | |
|
chongz
2017/04/27 16:19:47
Is this the right place, or should I put it in the
| |
| 1916 current_begin_frame_tracker_.Finish(); | 1919 current_begin_frame_tracker_.Finish(); |
| 1917 decoded_image_tracker_.NotifyFrameFinished(); | 1920 decoded_image_tracker_.NotifyFrameFinished(); |
| 1918 } | 1921 } |
| 1919 | 1922 |
| 1920 void LayerTreeHostImpl::UpdateViewportContainerSizes() { | 1923 void LayerTreeHostImpl::UpdateViewportContainerSizes() { |
| 1921 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); | 1924 LayerImpl* inner_container = active_tree_->InnerViewportContainerLayer(); |
| 1922 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); | 1925 LayerImpl* outer_container = active_tree_->OuterViewportContainerLayer(); |
| 1923 | 1926 |
| 1924 if (!inner_container) | 1927 if (!inner_container) |
| 1925 return; | 1928 return; |
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2531 return active_tree_->CurrentBrowserControlsShownRatio(); | 2534 return active_tree_->CurrentBrowserControlsShownRatio(); |
| 2532 } | 2535 } |
| 2533 | 2536 |
| 2534 void LayerTreeHostImpl::BindToClient(InputHandlerClient* client, | 2537 void LayerTreeHostImpl::BindToClient(InputHandlerClient* client, |
| 2535 bool wheel_scroll_latching_enabled) { | 2538 bool wheel_scroll_latching_enabled) { |
| 2536 DCHECK(input_handler_client_ == NULL); | 2539 DCHECK(input_handler_client_ == NULL); |
| 2537 input_handler_client_ = client; | 2540 input_handler_client_ = client; |
| 2538 touchpad_and_wheel_scroll_latching_enabled_ = wheel_scroll_latching_enabled; | 2541 touchpad_and_wheel_scroll_latching_enabled_ = wheel_scroll_latching_enabled; |
| 2539 } | 2542 } |
| 2540 | 2543 |
| 2544 InputHandler::InputHandlerState LayerTreeHostImpl::GetInputHandlerState() | |
| 2545 const { | |
| 2546 return input_handler_state_; | |
| 2547 }; | |
| 2548 | |
| 2541 InputHandler::ScrollStatus LayerTreeHostImpl::TryScroll( | 2549 InputHandler::ScrollStatus LayerTreeHostImpl::TryScroll( |
| 2542 const gfx::PointF& screen_space_point, | 2550 const gfx::PointF& screen_space_point, |
| 2543 InputHandler::ScrollInputType type, | 2551 InputHandler::ScrollInputType type, |
| 2544 const ScrollTree& scroll_tree, | 2552 const ScrollTree& scroll_tree, |
| 2545 ScrollNode* scroll_node) const { | 2553 ScrollNode* scroll_node) const { |
| 2546 InputHandler::ScrollStatus scroll_status; | 2554 InputHandler::ScrollStatus scroll_status; |
| 2547 scroll_status.main_thread_scrolling_reasons = | 2555 scroll_status.main_thread_scrolling_reasons = |
| 2548 MainThreadScrollingReason::kNotScrollingOnMain; | 2556 MainThreadScrollingReason::kNotScrollingOnMain; |
| 2549 if (!!scroll_node->main_thread_scrolling_reasons) { | 2557 if (!!scroll_node->main_thread_scrolling_reasons) { |
| 2550 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread"); | 2558 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Failed ShouldScrollOnMainThread"); |
| (...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4296 } | 4304 } |
| 4297 | 4305 |
| 4298 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { | 4306 void LayerTreeHostImpl::UpdateScrollSourceInfo(bool is_wheel_scroll) { |
| 4299 if (is_wheel_scroll) | 4307 if (is_wheel_scroll) |
| 4300 has_scrolled_by_wheel_ = true; | 4308 has_scrolled_by_wheel_ = true; |
| 4301 else | 4309 else |
| 4302 has_scrolled_by_touch_ = true; | 4310 has_scrolled_by_touch_ = true; |
| 4303 } | 4311 } |
| 4304 | 4312 |
| 4305 } // namespace cc | 4313 } // namespace cc |
| OLD | NEW |