| 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "cc/layer_tree_host_impl.h" | 7 #include "cc/layer_tree_host_impl.h" |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 | 10 |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 // This point is still inside the non-fast region. | 480 // This point is still inside the non-fast region. |
| 481 EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(10, 10), InputHandlerClient::Wh
eel), InputHandlerClient::ScrollOnMainThread); | 481 EXPECT_EQ(m_hostImpl->scrollBegin(gfx::Point(10, 10), InputHandlerClient::Wh
eel), InputHandlerClient::ScrollOnMainThread); |
| 482 } | 482 } |
| 483 | 483 |
| 484 TEST_P(LayerTreeHostImplTest, maxScrollOffsetChangedByDeviceScaleFactor) | 484 TEST_P(LayerTreeHostImplTest, maxScrollOffsetChangedByDeviceScaleFactor) |
| 485 { | 485 { |
| 486 setupScrollAndContentsLayers(gfx::Size(100, 100)); | 486 setupScrollAndContentsLayers(gfx::Size(100, 100)); |
| 487 | 487 |
| 488 float deviceScaleFactor = 2; | 488 float deviceScaleFactor = 2; |
| 489 gfx::Size layoutViewport(25, 25); | 489 gfx::Size layoutViewport(25, 25); |
| 490 gfx::Size deviceViewport(gfx::ToFlooredSize(layoutViewport.Scale(deviceScale
Factor))); | 490 gfx::Size deviceViewport(gfx::ToFlooredSize(gfx::ScaleSize(layoutViewport, d
eviceScaleFactor))); |
| 491 m_hostImpl->setViewportSize(layoutViewport, deviceViewport); | 491 m_hostImpl->setViewportSize(layoutViewport, deviceViewport); |
| 492 m_hostImpl->setDeviceScaleFactor(deviceScaleFactor); | 492 m_hostImpl->setDeviceScaleFactor(deviceScaleFactor); |
| 493 EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollOffset(), gfx::Vector2d(25, 25))
; | 493 EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollOffset(), gfx::Vector2d(25, 25))
; |
| 494 | 494 |
| 495 deviceScaleFactor = 1; | 495 deviceScaleFactor = 1; |
| 496 m_hostImpl->setViewportSize(layoutViewport, layoutViewport); | 496 m_hostImpl->setViewportSize(layoutViewport, layoutViewport); |
| 497 m_hostImpl->setDeviceScaleFactor(deviceScaleFactor); | 497 m_hostImpl->setDeviceScaleFactor(deviceScaleFactor); |
| 498 EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollOffset(), gfx::Vector2d(75, 75))
; | 498 EXPECT_EQ(m_hostImpl->rootLayer()->maxScrollOffset(), gfx::Vector2d(75, 75))
; |
| 499 } | 499 } |
| 500 | 500 |
| (...skipping 3916 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4417 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat
a); | 4417 verifyRenderPassTestData(removeRenderPassesCases[testCaseIndex], testDat
a); |
| 4418 testCaseIndex++; | 4418 testCaseIndex++; |
| 4419 } | 4419 } |
| 4420 } | 4420 } |
| 4421 | 4421 |
| 4422 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4422 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
| 4423 LayerTreeHostImplTest, | 4423 LayerTreeHostImplTest, |
| 4424 ::testing::Values(false, true)); | 4424 ::testing::Values(false, true)); |
| 4425 | 4425 |
| 4426 } // anonymous namespace | 4426 } // anonymous namespace |
| OLD | NEW |