OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
337 DebugScopedSetImplThread impl; | 337 DebugScopedSetImplThread impl; |
338 if (m_layerRendererInitialized) | 338 if (m_layerRendererInitialized) |
339 m_layerTreeHostImpl->layerRenderer()->doNoOp(); | 339 m_layerTreeHostImpl->layerRenderer()->doNoOp(); |
340 } | 340 } |
341 } | 341 } |
342 | 342 |
343 bool CCSingleThreadProxy::commitAndComposite() | 343 bool CCSingleThreadProxy::commitAndComposite() |
344 { | 344 { |
345 ASSERT(CCProxy::isMainThread()); | 345 ASSERT(CCProxy::isMainThread()); |
346 | 346 |
| 347 if (!m_layerTreeHost->initializeLayerRendererIfNeeded()) |
| 348 return false; |
| 349 |
347 CCTextureUpdater updater; | 350 CCTextureUpdater updater; |
348 | 351 m_layerTreeHost->updateLayers(updater); |
349 if (!m_layerTreeHost->updateLayers(updater)) | |
350 return false; | |
351 | 352 |
352 m_layerTreeHost->willCommit(); | 353 m_layerTreeHost->willCommit(); |
353 doCommit(updater); | 354 doCommit(updater); |
354 bool result = doComposite(); | 355 bool result = doComposite(); |
355 m_layerTreeHost->didBeginFrame(); | 356 m_layerTreeHost->didBeginFrame(); |
356 return result; | 357 return result; |
357 } | 358 } |
358 | 359 |
359 bool CCSingleThreadProxy::doComposite() | 360 bool CCSingleThreadProxy::doComposite() |
360 { | 361 { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
392 | 393 |
393 void CCSingleThreadProxy::didSwapFrame() | 394 void CCSingleThreadProxy::didSwapFrame() |
394 { | 395 { |
395 if (m_nextFrameIsNewlyCommittedFrame) { | 396 if (m_nextFrameIsNewlyCommittedFrame) { |
396 m_nextFrameIsNewlyCommittedFrame = false; | 397 m_nextFrameIsNewlyCommittedFrame = false; |
397 m_layerTreeHost->didCommitAndDrawFrame(); | 398 m_layerTreeHost->didCommitAndDrawFrame(); |
398 } | 399 } |
399 } | 400 } |
400 | 401 |
401 } | 402 } |
OLD | NEW |