| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "web/tests/sim/SimCompositor.h" | 5 #include "web/tests/sim/SimCompositor.h" |
| 6 | 6 |
| 7 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
| 9 #include "core/layout/compositing/CompositedLayerMapping.h" | 9 #include "core/layout/compositing/CompositedLayerMapping.h" |
| 10 #include "core/paint/PaintLayer.h" | 10 #include "core/paint/PaintLayer.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 m_needsAnimate = true; | 70 m_needsAnimate = true; |
| 71 } | 71 } |
| 72 | 72 |
| 73 void SimCompositor::setDeferCommits(bool deferCommits) | 73 void SimCompositor::setDeferCommits(bool deferCommits) |
| 74 { | 74 { |
| 75 m_deferCommits = deferCommits; | 75 m_deferCommits = deferCommits; |
| 76 } | 76 } |
| 77 | 77 |
| 78 SimDisplayItemList SimCompositor::beginFrame() | 78 SimDisplayItemList SimCompositor::beginFrame() |
| 79 { | 79 { |
| 80 ASSERT(m_webViewImpl); | 80 DCHECK(m_webViewImpl); |
| 81 ASSERT(!m_deferCommits); | 81 DCHECK(!m_deferCommits); |
| 82 ASSERT(m_needsAnimate); | 82 DCHECK(m_needsAnimate); |
| 83 m_needsAnimate = false; | 83 m_needsAnimate = false; |
| 84 | 84 |
| 85 // Always advance the time as if the compositor was running at 60fps. | 85 // Always advance the time as if the compositor was running at 60fps. |
| 86 m_lastFrameTimeMonotonic = monotonicallyIncreasingTime() + 0.016; | 86 m_lastFrameTimeMonotonic = monotonicallyIncreasingTime() + 0.016; |
| 87 | 87 |
| 88 m_webViewImpl->beginFrame(m_lastFrameTimeMonotonic); | 88 m_webViewImpl->beginFrame(m_lastFrameTimeMonotonic); |
| 89 m_webViewImpl->updateAllLifecyclePhases(); | 89 m_webViewImpl->updateAllLifecyclePhases(); |
| 90 | 90 |
| 91 LocalFrame* root = m_webViewImpl->mainFrameImpl()->frame(); | 91 LocalFrame* root = m_webViewImpl->mainFrameImpl()->frame(); |
| 92 | 92 |
| 93 SimDisplayItemList displayList; | 93 SimDisplayItemList displayList; |
| 94 paintFrames(*root, displayList); | 94 paintFrames(*root, displayList); |
| 95 | 95 |
| 96 return displayList; | 96 return displayList; |
| 97 } | 97 } |
| 98 | 98 |
| 99 } // namespace blink | 99 } // namespace blink |
| OLD | NEW |