| 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/layer_tree_host_impl.h" | 5 #include "cc/layer_tree_host_impl.h" |
| 6 | 6 |
| 7 #include <cmath> | 7 #include <cmath> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 m_onCanDrawStateChangedCalled = false; | 276 m_onCanDrawStateChangedCalled = false; |
| 277 | 277 |
| 278 // Toggle contents textures purged to make sure it toggles canDraw. | 278 // Toggle contents textures purged to make sure it toggles canDraw. |
| 279 setReduceMemoryResult(true); | 279 setReduceMemoryResult(true); |
| 280 m_hostImpl->setManagedMemoryPolicy(ManagedMemoryPolicy( | 280 m_hostImpl->setManagedMemoryPolicy(ManagedMemoryPolicy( |
| 281 m_hostImpl->memoryAllocationLimitBytes() - 1)); | 281 m_hostImpl->memoryAllocationLimitBytes() - 1)); |
| 282 EXPECT_FALSE(m_hostImpl->canDraw()); | 282 EXPECT_FALSE(m_hostImpl->canDraw()); |
| 283 EXPECT_TRUE(m_onCanDrawStateChangedCalled); | 283 EXPECT_TRUE(m_onCanDrawStateChangedCalled); |
| 284 m_onCanDrawStateChangedCalled = false; | 284 m_onCanDrawStateChangedCalled = false; |
| 285 | 285 |
| 286 m_hostImpl->resetContentsTexturesPurged(); | 286 m_hostImpl->activeTree()->ResetContentsTexturesPurged(); |
| 287 EXPECT_TRUE(m_hostImpl->canDraw()); | 287 EXPECT_TRUE(m_hostImpl->canDraw()); |
| 288 EXPECT_TRUE(m_onCanDrawStateChangedCalled); | 288 EXPECT_TRUE(m_onCanDrawStateChangedCalled); |
| 289 m_onCanDrawStateChangedCalled = false; | 289 m_onCanDrawStateChangedCalled = false; |
| 290 } | 290 } |
| 291 | 291 |
| 292 TEST_P(LayerTreeHostImplTest, scrollDeltaNoLayers) | 292 TEST_P(LayerTreeHostImplTest, scrollDeltaNoLayers) |
| 293 { | 293 { |
| 294 ASSERT_FALSE(m_hostImpl->rootLayer()); | 294 ASSERT_FALSE(m_hostImpl->rootLayer()); |
| 295 | 295 |
| 296 scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas()
; | 296 scoped_ptr<ScrollAndScaleSet> scrollInfo = m_hostImpl->processScrollDeltas()
; |
| (...skipping 4387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4684 m_hostImpl->didDrawAllLayers(frame); | 4684 m_hostImpl->didDrawAllLayers(frame); |
| 4685 } | 4685 } |
| 4686 } | 4686 } |
| 4687 | 4687 |
| 4688 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, | 4688 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, |
| 4689 LayerTreeHostImplTest, | 4689 LayerTreeHostImplTest, |
| 4690 ::testing::Values(false, true)); | 4690 ::testing::Values(false, true)); |
| 4691 | 4691 |
| 4692 } // namespace | 4692 } // namespace |
| 4693 } // namespace cc | 4693 } // namespace cc |
| OLD | NEW |