| 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/test/layer_tree_test_common.h" | 7 #include "cc/test/layer_tree_test_common.h" |
| 8 | 8 |
| 9 #include "base/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "cc/active_animation.h" | 10 #include "cc/active_animation.h" |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 void ThreadedTest::endTestAfterDelay(int delayMilliseconds) | 341 void ThreadedTest::endTestAfterDelay(int delayMilliseconds) |
| 342 { | 342 { |
| 343 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::endTest)); | 343 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::endTest)); |
| 344 } | 344 } |
| 345 | 345 |
| 346 void ThreadedTest::postSetNeedsAnimateToMainThread() | 346 void ThreadedTest::postSetNeedsAnimateToMainThread() |
| 347 { | 347 { |
| 348 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSe
tNeedsAnimate)); | 348 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSe
tNeedsAnimate)); |
| 349 } | 349 } |
| 350 | 350 |
| 351 void ThreadedTest::postAddAnimationToMainThread() | 351 void ThreadedTest::postAddAnimationToMainThread(Layer* layerToReceiveAnimation) |
| 352 { | 352 { |
| 353 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAd
dAnimation)); | 353 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAd
dAnimation, layerToReceiveAnimation)); |
| 354 } | 354 } |
| 355 | 355 |
| 356 void ThreadedTest::postAddInstantAnimationToMainThread() | 356 void ThreadedTest::postAddInstantAnimationToMainThread() |
| 357 { | 357 { |
| 358 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAd
dInstantAnimation)); | 358 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchAd
dInstantAnimation)); |
| 359 } | 359 } |
| 360 | 360 |
| 361 void ThreadedTest::postSetNeedsCommitToMainThread() | 361 void ThreadedTest::postSetNeedsCommitToMainThread() |
| 362 { | 362 { |
| 363 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSe
tNeedsCommit)); | 363 m_mainThreadProxy->postTask(createThreadTask(this, &ThreadedTest::dispatchSe
tNeedsCommit)); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 447 { | 447 { |
| 448 DCHECK(Proxy::isMainThread()); | 448 DCHECK(Proxy::isMainThread()); |
| 449 | 449 |
| 450 if (m_finished) | 450 if (m_finished) |
| 451 return; | 451 return; |
| 452 | 452 |
| 453 if (m_layerTreeHost.get() && m_layerTreeHost->rootLayer()) | 453 if (m_layerTreeHost.get() && m_layerTreeHost->rootLayer()) |
| 454 addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 0, 0, 0.5, fa
lse); | 454 addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 0, 0, 0.5, fa
lse); |
| 455 } | 455 } |
| 456 | 456 |
| 457 void ThreadedTest::dispatchAddAnimation() | 457 void ThreadedTest::dispatchAddAnimation(Layer* layerToReceiveAnimation) |
| 458 { | 458 { |
| 459 DCHECK(Proxy::isMainThread()); | 459 DCHECK(Proxy::isMainThread()); |
| 460 | 460 |
| 461 if (m_finished) | 461 if (m_finished) |
| 462 return; | 462 return; |
| 463 | 463 |
| 464 if (m_layerTreeHost.get() && m_layerTreeHost->rootLayer()) | 464 if (layerToReceiveAnimation) |
| 465 addOpacityTransitionToLayer(*m_layerTreeHost->rootLayer(), 10, 0, 0.5, t
rue); | 465 addOpacityTransitionToLayer(*layerToReceiveAnimation, 10, 0, 0.5, true); |
| 466 } | 466 } |
| 467 | 467 |
| 468 void ThreadedTest::dispatchSetNeedsAnimateAndCommit() | 468 void ThreadedTest::dispatchSetNeedsAnimateAndCommit() |
| 469 { | 469 { |
| 470 DCHECK(Proxy::isMainThread()); | 470 DCHECK(Proxy::isMainThread()); |
| 471 | 471 |
| 472 if (m_finished) | 472 if (m_finished) |
| 473 return; | 473 return; |
| 474 | 474 |
| 475 if (m_layerTreeHost.get()) { | 475 if (m_layerTreeHost.get()) { |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (m_timedOut) { | 575 if (m_timedOut) { |
| 576 FAIL() << "Test timed out"; | 576 FAIL() << "Test timed out"; |
| 577 Platform::current()->compositorSupport()->shutdown(); | 577 Platform::current()->compositorSupport()->shutdown(); |
| 578 return; | 578 return; |
| 579 } | 579 } |
| 580 afterTest(); | 580 afterTest(); |
| 581 Platform::current()->compositorSupport()->shutdown(); | 581 Platform::current()->compositorSupport()->shutdown(); |
| 582 } | 582 } |
| 583 | 583 |
| 584 } // namespace WebKitTests | 584 } // namespace WebKitTests |
| OLD | NEW |