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 "cc/single_thread_proxy.h" | 5 #include "cc/single_thread_proxy.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "cc/draw_quad.h" | 8 #include "cc/draw_quad.h" |
9 #include "cc/graphics_context.h" | 9 #include "cc/graphics_context.h" |
10 #include "cc/layer_tree_host.h" | 10 #include "cc/layer_tree_host.h" |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
335 NOTREACHED(); | 335 NOTREACHED(); |
336 } | 336 } |
337 | 337 |
338 bool SingleThreadProxy::commitAndComposite() | 338 bool SingleThreadProxy::commitAndComposite() |
339 { | 339 { |
340 DCHECK(Proxy::isMainThread()); | 340 DCHECK(Proxy::isMainThread()); |
341 | 341 |
342 if (!m_layerTreeHost->initializeRendererIfNeeded()) | 342 if (!m_layerTreeHost->initializeRendererIfNeeded()) |
343 return false; | 343 return false; |
344 | 344 |
345 // Unlink any texture backings that were deleted | 345 m_layerTreeHost->contentsTextureManager()->unlinkAndClearEvictedBackings(); |
346 PrioritizedResourceManager::BackingList evictedContentsTexturesBackings; | |
347 { | |
348 DebugScopedSetImplThread impl(this); | |
349 m_layerTreeHost->contentsTextureManager()->getEvictedBackings(evictedCon
tentsTexturesBackings); | |
350 } | |
351 m_layerTreeHost->contentsTextureManager()->unlinkEvictedBackings(evictedCont
entsTexturesBackings); | |
352 | 346 |
353 scoped_ptr<ResourceUpdateQueue> queue = make_scoped_ptr(new ResourceUpdateQu
eue); | 347 scoped_ptr<ResourceUpdateQueue> queue = make_scoped_ptr(new ResourceUpdateQu
eue); |
354 m_layerTreeHost->updateLayers(*(queue.get()), m_layerTreeHostImpl->memoryAll
ocationLimitBytes()); | 348 m_layerTreeHost->updateLayers(*(queue.get()), m_layerTreeHostImpl->memoryAll
ocationLimitBytes()); |
355 | 349 |
356 if (m_layerTreeHostImpl->contentsTexturesPurged()) | 350 if (m_layerTreeHostImpl->contentsTexturesPurged()) |
357 m_layerTreeHostImpl->resetContentsTexturesPurged(); | 351 m_layerTreeHostImpl->resetContentsTexturesPurged(); |
358 | 352 |
359 m_layerTreeHost->willCommit(); | 353 m_layerTreeHost->willCommit(); |
360 doCommit(queue.Pass()); | 354 doCommit(queue.Pass()); |
361 bool result = doComposite(); | 355 bool result = doComposite(); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
400 | 394 |
401 void SingleThreadProxy::didSwapFrame() | 395 void SingleThreadProxy::didSwapFrame() |
402 { | 396 { |
403 if (m_nextFrameIsNewlyCommittedFrame) { | 397 if (m_nextFrameIsNewlyCommittedFrame) { |
404 m_nextFrameIsNewlyCommittedFrame = false; | 398 m_nextFrameIsNewlyCommittedFrame = false; |
405 m_layerTreeHost->didCommitAndDrawFrame(); | 399 m_layerTreeHost->didCommitAndDrawFrame(); |
406 } | 400 } |
407 } | 401 } |
408 | 402 |
409 } // namespace cc | 403 } // namespace cc |
OLD | NEW |