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 283 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 return false; | 294 return false; |
295 | 295 |
296 return m_layerTreeHost->contentsTextureManager()->reduceMemoryOnImplThread(l
imitBytes, priorityCutoff, m_layerTreeHostImpl->resourceProvider()); | 296 return m_layerTreeHost->contentsTextureManager()->reduceMemoryOnImplThread(l
imitBytes, priorityCutoff, m_layerTreeHostImpl->resourceProvider()); |
297 } | 297 } |
298 | 298 |
299 void SingleThreadProxy::sendManagedMemoryStats() | 299 void SingleThreadProxy::sendManagedMemoryStats() |
300 { | 300 { |
301 DCHECK(Proxy::isImplThread()); | 301 DCHECK(Proxy::isImplThread()); |
302 if (!m_layerTreeHostImpl.get()) | 302 if (!m_layerTreeHostImpl.get()) |
303 return; | 303 return; |
304 if (!m_layerTreeHostImpl->renderer()) | |
305 return; | |
306 if (!m_layerTreeHost->contentsTextureManager()) | 304 if (!m_layerTreeHost->contentsTextureManager()) |
307 return; | 305 return; |
308 | 306 |
309 m_layerTreeHostImpl->renderer()->sendManagedMemoryStats( | 307 m_layerTreeHostImpl->sendManagedMemoryStats( |
310 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), | 308 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), |
311 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes()
, | 309 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes()
, |
312 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); | 310 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); |
313 } | 311 } |
314 | 312 |
315 // Called by the legacy scheduling path (e.g. where render_widget does the sched
uling) | 313 // Called by the legacy scheduling path (e.g. where render_widget does the sched
uling) |
316 void SingleThreadProxy::compositeImmediately() | 314 void SingleThreadProxy::compositeImmediately() |
317 { | 315 { |
318 if (commitAndComposite()) { | 316 if (commitAndComposite()) { |
319 m_layerTreeHostImpl->swapBuffers(); | 317 m_layerTreeHostImpl->swapBuffers(); |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 392 |
395 void SingleThreadProxy::didSwapFrame() | 393 void SingleThreadProxy::didSwapFrame() |
396 { | 394 { |
397 if (m_nextFrameIsNewlyCommittedFrame) { | 395 if (m_nextFrameIsNewlyCommittedFrame) { |
398 m_nextFrameIsNewlyCommittedFrame = false; | 396 m_nextFrameIsNewlyCommittedFrame = false; |
399 m_layerTreeHost->didCommitAndDrawFrame(); | 397 m_layerTreeHost->didCommitAndDrawFrame(); |
400 } | 398 } |
401 } | 399 } |
402 | 400 |
403 } // namespace cc | 401 } // namespace cc |
OLD | NEW |