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 "cc/layer_tree_host.h" | 7 #include "cc/layer_tree_host.h" |
8 | 8 |
9 #include "CCFontAtlas.h" | 9 #include "CCFontAtlas.h" |
10 #include "CCGraphicsContext.h" | 10 #include "CCGraphicsContext.h" |
(...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
323 { | 323 { |
324 TRACE_EVENT0("cc", "LayerTreeHost::didLoseContext"); | 324 TRACE_EVENT0("cc", "LayerTreeHost::didLoseContext"); |
325 DCHECK(Proxy::isMainThread()); | 325 DCHECK(Proxy::isMainThread()); |
326 m_contextLost = true; | 326 m_contextLost = true; |
327 m_numFailedRecreateAttempts = 0; | 327 m_numFailedRecreateAttempts = 0; |
328 setNeedsCommit(); | 328 setNeedsCommit(); |
329 } | 329 } |
330 | 330 |
331 bool LayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect) | 331 bool LayerTreeHost::compositeAndReadback(void *pixels, const IntRect& rect) |
332 { | 332 { |
333 // Clear any pending commits. | |
jamesr
2012/10/23 21:24:34
No, this is definitely not right. You're imposing
jonathan.backer
2012/10/24 16:42:14
Done. Replaced with a DCHECK in ThreadProxy. Enfor
| |
334 setDeferCommits(false); | |
335 | |
333 m_triggerIdleUpdates = false; | 336 m_triggerIdleUpdates = false; |
334 bool ret = m_proxy->compositeAndReadback(pixels, rect); | 337 bool ret = m_proxy->compositeAndReadback(pixels, rect); |
335 m_triggerIdleUpdates = true; | 338 m_triggerIdleUpdates = true; |
336 return ret; | 339 return ret; |
337 } | 340 } |
338 | 341 |
339 void LayerTreeHost::finishAllRendering() | 342 void LayerTreeHost::finishAllRendering() |
340 { | 343 { |
341 if (!m_rendererInitialized) | 344 if (!m_rendererInitialized) |
342 return; | 345 return; |
346 | |
347 // Clear any pending commits. | |
jamesr
2012/10/23 21:24:34
DCHECK, don't handle
jonathan.backer
2012/10/24 16:42:14
Done. Added DCHECK to ThreadProxy.
| |
348 setDeferCommits(false); | |
349 | |
343 m_proxy->finishAllRendering(); | 350 m_proxy->finishAllRendering(); |
344 } | 351 } |
345 | 352 |
353 void LayerTreeHost::setDeferCommits(bool deferCommits) | |
354 { | |
355 m_proxy->setDeferCommits(deferCommits); | |
356 } | |
357 | |
358 bool LayerTreeHost::deferCommits() const | |
359 { | |
360 return m_proxy->deferCommits(); | |
361 } | |
362 | |
346 void LayerTreeHost::renderingStats(RenderingStats* stats) const | 363 void LayerTreeHost::renderingStats(RenderingStats* stats) const |
347 { | 364 { |
348 *stats = m_renderingStats; | 365 *stats = m_renderingStats; |
349 m_proxy->renderingStats(stats); | 366 m_proxy->renderingStats(stats); |
350 } | 367 } |
351 | 368 |
352 const RendererCapabilities& LayerTreeHost::rendererCapabilities() const | 369 const RendererCapabilities& LayerTreeHost::rendererCapabilities() const |
353 { | 370 { |
354 return m_proxy->rendererCapabilities(); | 371 return m_proxy->rendererCapabilities(); |
355 } | 372 } |
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
817 else | 834 else |
818 layer->notifyAnimationFinished(wallClockTime); | 835 layer->notifyAnimationFinished(wallClockTime); |
819 } | 836 } |
820 } | 837 } |
821 | 838 |
822 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) | 839 for (size_t childIndex = 0; childIndex < layer->children().size(); ++childIn dex) |
823 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); | 840 setAnimationEventsRecursive(events, layer->children()[childIndex].get(), wallClockTime); |
824 } | 841 } |
825 | 842 |
826 } // namespace cc | 843 } // namespace cc |
OLD | NEW |