| 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 "CCThreadedTest.h" | 7 #include "CCThreadedTest.h" |
| 8 | 8 |
| 9 #include "CCActiveAnimation.h" | 9 #include "CCActiveAnimation.h" |
| 10 #include "CCInputHandler.h" | 10 #include "CCInputHandler.h" |
| 11 #include "CCLayerAnimationController.h" | 11 #include "CCLayerAnimationController.h" |
| 12 #include "CCLayerImpl.h" | 12 #include "CCLayerImpl.h" |
| 13 #include "CCLayerTreeHostImpl.h" | 13 #include "CCLayerTreeHostImpl.h" |
| 14 #include "CCScopedThreadProxy.h" | 14 #include "CCScopedThreadProxy.h" |
| 15 #include "CCSingleThreadProxy.h" | 15 #include "CCSingleThreadProxy.h" |
| 16 #include "CCTextureUpdateQueue.h" | 16 #include "CCTextureUpdateQueue.h" |
| 17 #include "CCThreadTask.h" | 17 #include "CCThreadTask.h" |
| 18 #include "CCTimingFunction.h" | 18 #include "CCTimingFunction.h" |
| 19 #include "base/stl_util.h" | 19 #include "base/stl_util.h" |
| 20 #include "cc/content_layer.h" | 20 #include "cc/content_layer.h" |
| 21 #include "cc/layer.h" | 21 #include "cc/layer.h" |
| 22 #include "cc/test/animation_test_common.h" | 22 #include "cc/test/animation_test_common.h" |
| 23 #include "cc/test/fake_web_compositor_output_surface.h" | 23 #include "cc/test/fake_web_compositor_output_surface.h" |
| 24 #include "cc/test/fake_web_graphics_context_3d.h" | 24 #include "cc/test/fake_web_graphics_context_3d.h" |
| 25 #include "cc/test/occlusion_tracker_test_common.h" | 25 #include "cc/test/occlusion_tracker_test_common.h" |
| 26 #include "cc/test/tiled_layer_test_common.h" | 26 #include "cc/test/tiled_layer_test_common.h" |
| 27 #include "cc/test/test_common.h" |
| 28 #include "cc/settings.h" |
| 27 #include "testing/gmock/include/gmock/gmock.h" | 29 #include "testing/gmock/include/gmock/gmock.h" |
| 28 #include <public/Platform.h> | 30 #include <public/Platform.h> |
| 29 #include <public/WebCompositorSupport.h> | 31 #include <public/WebCompositorSupport.h> |
| 30 #include <public/WebFilterOperation.h> | 32 #include <public/WebFilterOperation.h> |
| 31 #include <public/WebFilterOperations.h> | 33 #include <public/WebFilterOperations.h> |
| 32 #include <public/WebThread.h> | 34 #include <public/WebThread.h> |
| 33 | 35 |
| 34 using namespace cc; | 36 using namespace cc; |
| 35 using namespace WebKit; | 37 using namespace WebKit; |
| 36 | 38 |
| (...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 if (m_finished) | 521 if (m_finished) |
| 520 return; | 522 return; |
| 521 | 523 |
| 522 if (m_layerTreeHost.get()) | 524 if (m_layerTreeHost.get()) |
| 523 m_layerTreeHost->didAddAnimation(); | 525 m_layerTreeHost->didAddAnimation(); |
| 524 } | 526 } |
| 525 | 527 |
| 526 void CCThreadedTest::runTest(bool threaded) | 528 void CCThreadedTest::runTest(bool threaded) |
| 527 { | 529 { |
| 528 // For these tests, we will enable threaded animations. | 530 // For these tests, we will enable threaded animations. |
| 529 Platform::current()->compositorSupport()->setAcceleratedAnimationEnabled(tru
e); | 531 CCScopedSettings scopedSettings; |
| 532 Settings::setAcceleratedAnimationEnabled(true); |
| 530 | 533 |
| 531 if (threaded) { | 534 if (threaded) { |
| 532 m_webThread.reset(WebKit::Platform::current()->createThread("CCThreadedT
est")); | 535 m_webThread.reset(WebKit::Platform::current()->createThread("CCThreadedT
est")); |
| 533 Platform::current()->compositorSupport()->initialize(m_webThread.get()); | 536 Platform::current()->compositorSupport()->initialize(m_webThread.get()); |
| 534 } else | 537 } else |
| 535 Platform::current()->compositorSupport()->initialize(0); | 538 Platform::current()->compositorSupport()->initialize(0); |
| 536 | 539 |
| 537 DCHECK(CCProxy::isMainThread()); | 540 DCHECK(CCProxy::isMainThread()); |
| 538 m_mainThreadProxy = CCScopedThreadProxy::create(CCProxy::mainThread()); | 541 m_mainThreadProxy = CCScopedThreadProxy::create(CCProxy::mainThread()); |
| 539 | 542 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 557 if (m_timedOut) { | 560 if (m_timedOut) { |
| 558 FAIL() << "Test timed out"; | 561 FAIL() << "Test timed out"; |
| 559 Platform::current()->compositorSupport()->shutdown(); | 562 Platform::current()->compositorSupport()->shutdown(); |
| 560 return; | 563 return; |
| 561 } | 564 } |
| 562 afterTest(); | 565 afterTest(); |
| 563 Platform::current()->compositorSupport()->shutdown(); | 566 Platform::current()->compositorSupport()->shutdown(); |
| 564 } | 567 } |
| 565 | 568 |
| 566 } // namespace WebKitTests | 569 } // namespace WebKitTests |
| OLD | NEW |