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 2485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2496 gfx::Transform screen_space_transform = | 2496 gfx::Transform screen_space_transform = |
2497 scroll_tree.ScreenSpaceTransform(scroll_node->id); | 2497 scroll_tree.ScreenSpaceTransform(scroll_node->id); |
2498 if (!screen_space_transform.IsInvertible()) { | 2498 if (!screen_space_transform.IsInvertible()) { |
2499 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Ignored NonInvertibleTransform"); | 2499 TRACE_EVENT0("cc", "LayerImpl::TryScroll: Ignored NonInvertibleTransform"); |
2500 scroll_status.thread = InputHandler::SCROLL_IGNORED; | 2500 scroll_status.thread = InputHandler::SCROLL_IGNORED; |
2501 scroll_status.main_thread_scrolling_reasons = | 2501 scroll_status.main_thread_scrolling_reasons = |
2502 MainThreadScrollingReason::kNonInvertibleTransform; | 2502 MainThreadScrollingReason::kNonInvertibleTransform; |
2503 return scroll_status; | 2503 return scroll_status; |
2504 } | 2504 } |
2505 | 2505 |
2506 if (scroll_node->contains_non_fast_scrollable_region) { | 2506 if (!scroll_node->non_fast_scrollable_region.IsEmpty()) { |
2507 bool clipped = false; | 2507 bool clipped = false; |
2508 gfx::Transform inverse_screen_space_transform( | 2508 gfx::Transform inverse_screen_space_transform( |
2509 gfx::Transform::kSkipInitialization); | 2509 gfx::Transform::kSkipInitialization); |
2510 if (!screen_space_transform.GetInverse(&inverse_screen_space_transform)) { | 2510 if (!screen_space_transform.GetInverse(&inverse_screen_space_transform)) { |
2511 // TODO(shawnsingh): We shouldn't be applying a projection if screen space | 2511 // TODO(shawnsingh): We shouldn't be applying a projection if screen space |
2512 // transform is uninvertible here. Perhaps we should be returning | 2512 // transform is uninvertible here. Perhaps we should be returning |
2513 // SCROLL_ON_MAIN_THREAD in this case? | 2513 // SCROLL_ON_MAIN_THREAD in this case? |
2514 } | 2514 } |
2515 | 2515 |
2516 gfx::PointF hit_test_point_in_layer_space = MathUtil::ProjectPoint( | 2516 gfx::PointF hit_test_point_in_layer_space = MathUtil::ProjectPoint( |
2517 inverse_screen_space_transform, screen_space_point, &clipped); | 2517 inverse_screen_space_transform, screen_space_point, &clipped); |
2518 if (!clipped && | 2518 if (!clipped && scroll_node->non_fast_scrollable_region.Contains( |
2519 active_tree() | 2519 gfx::ToRoundedPoint(hit_test_point_in_layer_space))) { |
2520 ->LayerById(scroll_node->owning_layer_id) | |
2521 ->non_fast_scrollable_region() | |
2522 .Contains(gfx::ToRoundedPoint(hit_test_point_in_layer_space))) { | |
2523 TRACE_EVENT0("cc", | 2520 TRACE_EVENT0("cc", |
2524 "LayerImpl::tryScroll: Failed NonFastScrollableRegion"); | 2521 "LayerImpl::tryScroll: Failed NonFastScrollableRegion"); |
2525 scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD; | 2522 scroll_status.thread = InputHandler::SCROLL_ON_MAIN_THREAD; |
2526 scroll_status.main_thread_scrolling_reasons = | 2523 scroll_status.main_thread_scrolling_reasons = |
2527 MainThreadScrollingReason::kNonFastScrollableRegion; | 2524 MainThreadScrollingReason::kNonFastScrollableRegion; |
2528 return scroll_status; | 2525 return scroll_status; |
2529 } | 2526 } |
2530 } | 2527 } |
2531 | 2528 |
2532 if (!scroll_node->scrollable) { | 2529 if (!scroll_node->scrollable) { |
(...skipping 1612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4145 worker_context_visibility_ = | 4142 worker_context_visibility_ = |
4146 worker_context->CacheController()->ClientBecameVisible(); | 4143 worker_context->CacheController()->ClientBecameVisible(); |
4147 } else { | 4144 } else { |
4148 worker_context->CacheController()->ClientBecameNotVisible( | 4145 worker_context->CacheController()->ClientBecameNotVisible( |
4149 std::move(worker_context_visibility_)); | 4146 std::move(worker_context_visibility_)); |
4150 } | 4147 } |
4151 } | 4148 } |
4152 } | 4149 } |
4153 | 4150 |
4154 } // namespace cc | 4151 } // namespace cc |
OLD | NEW |