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