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