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 "CCSingleThreadProxy.h" | 7 #include "CCSingleThreadProxy.h" |
8 | 8 |
9 #include "CCDrawQuad.h" | 9 #include "CCDrawQuad.h" |
10 #include "CCGraphicsContext.h" | 10 #include "CCGraphicsContext.h" |
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 ASSERT(CCProxy::isMainThread()); | 180 ASSERT(CCProxy::isMainThread()); |
181 // Commit immediately | 181 // Commit immediately |
182 { | 182 { |
183 DebugScopedSetMainThreadBlocked mainThreadBlocked; | 183 DebugScopedSetMainThreadBlocked mainThreadBlocked; |
184 DebugScopedSetImplThread impl; | 184 DebugScopedSetImplThread impl; |
185 | 185 |
186 m_layerTreeHostImpl->beginCommit(); | 186 m_layerTreeHostImpl->beginCommit(); |
187 | 187 |
188 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); | 188 m_layerTreeHost->beginCommitOnImplThread(m_layerTreeHostImpl.get()); |
189 | 189 |
190 // CCTextureUpdateController::updateTextures is non-blocking and will | 190 CCTextureUpdateController::updateTextures(m_layerTreeHostImpl->resourceP
rovider(), m_layerTreeHostImpl->resourceProvider()->textureUploader(), &queue); |
191 // return without updating any textures if the uploader is busy. This | |
192 // shouldn't be a problem here as the throttled uploader isn't used in | |
193 // single thread mode. For correctness, loop until no more updates are | |
194 // pending. | |
195 CCResourceProvider* resourceProvider = m_layerTreeHostImpl->resourceProv
ider(); | |
196 while (queue.hasMoreUpdates()) | |
197 CCTextureUpdateController::updateTextures(resourceProvider, resource
Provider->textureUploader(), &queue, maxPartialTextureUpdates()); | |
198 | 191 |
199 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); | 192 m_layerTreeHost->finishCommitOnImplThread(m_layerTreeHostImpl.get()); |
200 | 193 |
201 m_layerTreeHostImpl->commitComplete(); | 194 m_layerTreeHostImpl->commitComplete(); |
202 | 195 |
203 #if !ASSERT_DISABLED | 196 #if !ASSERT_DISABLED |
204 // In the single-threaded case, the scroll deltas should never be | 197 // In the single-threaded case, the scroll deltas should never be |
205 // touched on the impl layer tree. | 198 // touched on the impl layer tree. |
206 OwnPtr<CCScrollAndScaleSet> scrollInfo = m_layerTreeHostImpl->processScr
ollDeltas(); | 199 OwnPtr<CCScrollAndScaleSet> scrollInfo = m_layerTreeHostImpl->processScr
ollDeltas(); |
207 ASSERT(!scrollInfo->scrolls.size()); | 200 ASSERT(!scrollInfo->scrolls.size()); |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
334 | 327 |
335 void CCSingleThreadProxy::didSwapFrame() | 328 void CCSingleThreadProxy::didSwapFrame() |
336 { | 329 { |
337 if (m_nextFrameIsNewlyCommittedFrame) { | 330 if (m_nextFrameIsNewlyCommittedFrame) { |
338 m_nextFrameIsNewlyCommittedFrame = false; | 331 m_nextFrameIsNewlyCommittedFrame = false; |
339 m_layerTreeHost->didCommitAndDrawFrame(); | 332 m_layerTreeHost->didCommitAndDrawFrame(); |
340 } | 333 } |
341 } | 334 } |
342 | 335 |
343 } | 336 } |
OLD | NEW |