Chromium Code Reviews| 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/test/layer_tree_test_common.h" | 5 #include "cc/test/layer_tree_test_common.h" |
| 6 | 6 |
| 7 #include "cc/animation.h" | 7 #include "cc/animation.h" |
| 8 #include "cc/animation_registrar.h" | 8 #include "cc/animation_registrar.h" |
| 9 #include "cc/content_layer.h" | 9 #include "cc/content_layer.h" |
| 10 #include "cc/input_handler.h" | 10 #include "cc/input_handler.h" |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 71 void MockLayerTreeHostImpl::beginCommit() | 71 void MockLayerTreeHostImpl::beginCommit() |
| 72 { | 72 { |
| 73 LayerTreeHostImpl::beginCommit(); | 73 LayerTreeHostImpl::beginCommit(); |
| 74 m_testHooks->beginCommitOnThread(this); | 74 m_testHooks->beginCommitOnThread(this); |
| 75 } | 75 } |
| 76 | 76 |
| 77 void MockLayerTreeHostImpl::commitComplete() | 77 void MockLayerTreeHostImpl::commitComplete() |
| 78 { | 78 { |
| 79 LayerTreeHostImpl::commitComplete(); | 79 LayerTreeHostImpl::commitComplete(); |
| 80 m_testHooks->commitCompleteOnThread(this); | 80 m_testHooks->commitCompleteOnThread(this); |
| 81 | |
| 82 if (!settings().implSidePainting) | |
| 83 m_testHooks->treeActivatedOnThread(this); | |
|
piman
2013/02/26 22:49:21
Should this be before LayerTreeHostImpl::commitCom
danakj
2013/02/26 22:56:54
It could be commit complete - they're equal at the
piman
2013/02/26 23:19:21
This part is only relevant for non-impl-side-paint
danakj
2013/02/26 23:32:55
Oh sorry I replied about a completely different li
| |
| 84 | |
| 81 } | 85 } |
| 82 | 86 |
| 83 bool MockLayerTreeHostImpl::prepareToDraw(FrameData& frame) | 87 bool MockLayerTreeHostImpl::prepareToDraw(FrameData& frame) |
| 84 { | 88 { |
| 85 bool result = LayerTreeHostImpl::prepareToDraw(frame); | 89 bool result = LayerTreeHostImpl::prepareToDraw(frame); |
| 86 if (!m_testHooks->prepareToDrawOnThread(this, frame, result)) | 90 if (!m_testHooks->prepareToDrawOnThread(this, frame, result)) |
| 87 result = false; | 91 result = false; |
| 88 return result; | 92 return result; |
| 89 } | 93 } |
| 90 | 94 |
| 91 void MockLayerTreeHostImpl::drawLayers(FrameData& frame) | 95 void MockLayerTreeHostImpl::drawLayers(FrameData& frame) |
| 92 { | 96 { |
| 93 LayerTreeHostImpl::drawLayers(frame); | 97 LayerTreeHostImpl::drawLayers(frame); |
| 94 m_testHooks->drawLayersOnThread(this); | 98 m_testHooks->drawLayersOnThread(this); |
| 95 } | 99 } |
| 96 | 100 |
| 97 void MockLayerTreeHostImpl::activatePendingTreeIfNeeded() | 101 bool MockLayerTreeHostImpl::activatePendingTreeIfNeeded() |
| 98 { | 102 { |
| 99 if (!pendingTree()) | 103 if (!pendingTree()) |
| 100 return; | 104 return false; |
| 101 | 105 |
| 102 if (m_testHooks->canActivatePendingTree()) | 106 if (!m_testHooks->canActivatePendingTree()) |
| 103 activatePendingTree(); | 107 return false; |
| 108 | |
| 109 bool activated = LayerTreeHostImpl::activatePendingTreeIfNeeded(); | |
| 110 if (activated) | |
| 111 m_testHooks->treeActivatedOnThread(this); | |
| 112 return activated; | |
| 113 } | |
| 114 | |
| 115 bool MockLayerTreeHostImpl::initializeRenderer(scoped_ptr<OutputSurface> outputS urface) | |
| 116 { | |
| 117 bool success = LayerTreeHostImpl::initializeRenderer(outputSurface.Pass()); | |
| 118 m_testHooks->initializedRendererOnThread(this, success); | |
| 119 return success; | |
| 104 } | 120 } |
| 105 | 121 |
| 106 void MockLayerTreeHostImpl::animateLayers(base::TimeTicks monotonicTime, base::T ime wallClockTime) | 122 void MockLayerTreeHostImpl::animateLayers(base::TimeTicks monotonicTime, base::T ime wallClockTime) |
| 107 { | 123 { |
| 108 m_testHooks->willAnimateLayers(this, monotonicTime); | 124 m_testHooks->willAnimateLayers(this, monotonicTime); |
| 109 LayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime); | 125 LayerTreeHostImpl::animateLayers(monotonicTime, wallClockTime); |
| 110 m_testHooks->animateLayers(this, monotonicTime); | 126 m_testHooks->animateLayers(this, monotonicTime); |
| 111 } | 127 } |
| 112 | 128 |
| 113 void MockLayerTreeHostImpl::updateAnimationState() | 129 void MockLayerTreeHostImpl::updateAnimationState() |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 470 ASSERT_FALSE(m_layerTreeHost.get()); | 486 ASSERT_FALSE(m_layerTreeHost.get()); |
| 471 m_client.reset(); | 487 m_client.reset(); |
| 472 if (m_timedOut) { | 488 if (m_timedOut) { |
| 473 FAIL() << "Test timed out"; | 489 FAIL() << "Test timed out"; |
| 474 return; | 490 return; |
| 475 } | 491 } |
| 476 afterTest(); | 492 afterTest(); |
| 477 } | 493 } |
| 478 | 494 |
| 479 } // namespace cc | 495 } // namespace cc |
| OLD | NEW |