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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 { | 276 { |
277 if (!commitIfNeeded()) | 277 if (!commitIfNeeded()) |
278 return; | 278 return; |
279 | 279 |
280 if (doComposite()) { | 280 if (doComposite()) { |
281 m_layerTreeHostImpl->swapBuffers(); | 281 m_layerTreeHostImpl->swapBuffers(); |
282 didSwapFrame(); | 282 didSwapFrame(); |
283 } | 283 } |
284 } | 284 } |
285 | 285 |
| 286 void CCSingleThreadProxy::forceSerializeOnSwapBuffers() |
| 287 { |
| 288 { |
| 289 DebugScopedSetImplThread impl; |
| 290 if (m_layerRendererInitialized) |
| 291 m_layerTreeHostImpl->layerRenderer()->doNoOp(); |
| 292 } |
| 293 } |
| 294 |
286 bool CCSingleThreadProxy::commitIfNeeded() | 295 bool CCSingleThreadProxy::commitIfNeeded() |
287 { | 296 { |
288 ASSERT(CCProxy::isMainThread()); | 297 ASSERT(CCProxy::isMainThread()); |
289 | 298 |
290 if (!m_layerTreeHost->updateLayers()) | 299 if (!m_layerTreeHost->updateLayers()) |
291 return false; | 300 return false; |
292 | 301 |
293 doCommit(); | 302 doCommit(); |
294 return true; | 303 return true; |
295 } | 304 } |
(...skipping 23 matching lines...) Expand all Loading... |
319 | 328 |
320 void CCSingleThreadProxy::didSwapFrame() | 329 void CCSingleThreadProxy::didSwapFrame() |
321 { | 330 { |
322 if (m_nextFrameIsNewlyCommittedFrame) { | 331 if (m_nextFrameIsNewlyCommittedFrame) { |
323 m_nextFrameIsNewlyCommittedFrame = false; | 332 m_nextFrameIsNewlyCommittedFrame = false; |
324 m_layerTreeHost->didCommitAndDrawFrame(); | 333 m_layerTreeHost->didCommitAndDrawFrame(); |
325 } | 334 } |
326 } | 335 } |
327 | 336 |
328 } | 337 } |
OLD | NEW |