| 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 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <cmath> | 10 #include <cmath> |
| (...skipping 3212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3223 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar()); | 3223 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar()); |
| 3224 | 3224 |
| 3225 host_impl_->MouseMoveAt(gfx::Point(116, 100)); | 3225 host_impl_->MouseMoveAt(gfx::Point(116, 100)); |
| 3226 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_near_scrollbar()); | 3226 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_near_scrollbar()); |
| 3227 | 3227 |
| 3228 scrollbar_animation_controller->set_mouse_move_distance_for_test(102.f); | 3228 scrollbar_animation_controller->set_mouse_move_distance_for_test(102.f); |
| 3229 host_impl_->MouseMoveAt(gfx::Point(116, 100)); | 3229 host_impl_->MouseMoveAt(gfx::Point(116, 100)); |
| 3230 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar()); | 3230 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_near_scrollbar()); |
| 3231 | 3231 |
| 3232 did_request_redraw_ = false; | 3232 did_request_redraw_ = false; |
| 3233 EXPECT_EQ(Layer::INVALID_ID, | 3233 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_over_scrollbar()); |
| 3234 host_impl_->scroll_layer_id_when_mouse_over_scrollbar()); | |
| 3235 host_impl_->MouseMoveAt(gfx::Point(10, 100)); | 3234 host_impl_->MouseMoveAt(gfx::Point(10, 100)); |
| 3236 EXPECT_EQ(117, host_impl_->scroll_layer_id_when_mouse_over_scrollbar()); | 3235 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_over_scrollbar()); |
| 3237 host_impl_->MouseMoveAt(gfx::Point(10, 120)); | 3236 host_impl_->MouseMoveAt(gfx::Point(10, 120)); |
| 3238 EXPECT_EQ(117, host_impl_->scroll_layer_id_when_mouse_over_scrollbar()); | 3237 EXPECT_TRUE(scrollbar_animation_controller->mouse_is_over_scrollbar()); |
| 3239 host_impl_->MouseMoveAt(gfx::Point(150, 120)); | 3238 host_impl_->MouseMoveAt(gfx::Point(150, 120)); |
| 3240 EXPECT_EQ(Layer::INVALID_ID, | 3239 EXPECT_FALSE(scrollbar_animation_controller->mouse_is_over_scrollbar()); |
| 3241 host_impl_->scroll_layer_id_when_mouse_over_scrollbar()); | |
| 3242 } | 3240 } |
| 3243 | 3241 |
| 3244 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf1) { | 3242 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf1) { |
| 3245 SetupMouseMoveAtWithDeviceScale(1.f); | 3243 SetupMouseMoveAtWithDeviceScale(1.f); |
| 3246 } | 3244 } |
| 3247 | 3245 |
| 3248 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf2) { | 3246 TEST_F(LayerTreeHostImplTest, MouseMoveAtWithDeviceScaleOf2) { |
| 3249 SetupMouseMoveAtWithDeviceScale(2.f); | 3247 SetupMouseMoveAtWithDeviceScale(2.f); |
| 3250 } | 3248 } |
| 3251 | 3249 |
| (...skipping 8151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11403 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); | 11401 EXPECT_TRUE(host_impl_->use_gpu_rasterization()); |
| 11404 | 11402 |
| 11405 // Re-initialize with a software output surface. | 11403 // Re-initialize with a software output surface. |
| 11406 compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware(); | 11404 compositor_frame_sink_ = FakeCompositorFrameSink::CreateSoftware(); |
| 11407 host_impl_->InitializeRenderer(compositor_frame_sink_.get()); | 11405 host_impl_->InitializeRenderer(compositor_frame_sink_.get()); |
| 11408 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); | 11406 EXPECT_FALSE(host_impl_->use_gpu_rasterization()); |
| 11409 } | 11407 } |
| 11410 | 11408 |
| 11411 } // namespace | 11409 } // namespace |
| 11412 } // namespace cc | 11410 } // namespace cc |
| OLD | NEW |