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/single_thread_proxy.h" | 7 #include "cc/single_thread_proxy.h" |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/draw_quad.h" | 10 #include "cc/draw_quad.h" |
(...skipping 271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 DCHECK(isImplThread()); | 282 DCHECK(isImplThread()); |
283 if (!m_layerTreeHost->contentsTextureManager()) | 283 if (!m_layerTreeHost->contentsTextureManager()) |
284 return false; | 284 return false; |
285 | 285 |
286 return m_layerTreeHost->contentsTextureManager()->reduceMemoryOnImplThread(l
imitBytes, priorityCutoff, m_layerTreeHostImpl->resourceProvider()); | 286 return m_layerTreeHost->contentsTextureManager()->reduceMemoryOnImplThread(l
imitBytes, priorityCutoff, m_layerTreeHostImpl->resourceProvider()); |
287 } | 287 } |
288 | 288 |
289 void SingleThreadProxy::sendManagedMemoryStats() | 289 void SingleThreadProxy::sendManagedMemoryStats() |
290 { | 290 { |
291 DCHECK(Proxy::isImplThread()); | 291 DCHECK(Proxy::isImplThread()); |
292 if (m_layerTreeHostImpl.get() && m_layerTreeHostImpl->renderer()) | 292 if (!m_layerTreeHostImpl.get()) |
293 m_layerTreeHostImpl->renderer()->sendManagedMemoryStats( | 293 return; |
294 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), | 294 if (!m_layerTreeHostImpl->renderer()) |
295 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyByt
es(), | 295 return; |
296 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); | 296 if (!m_layerTreeHost->contentsTextureManager()) |
| 297 return; |
| 298 |
| 299 m_layerTreeHostImpl->renderer()->sendManagedMemoryStats( |
| 300 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), |
| 301 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes()
, |
| 302 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); |
297 } | 303 } |
298 | 304 |
299 // Called by the legacy scheduling path (e.g. where render_widget does the sched
uling) | 305 // Called by the legacy scheduling path (e.g. where render_widget does the sched
uling) |
300 void SingleThreadProxy::compositeImmediately() | 306 void SingleThreadProxy::compositeImmediately() |
301 { | 307 { |
302 if (commitAndComposite()) { | 308 if (commitAndComposite()) { |
303 m_layerTreeHostImpl->swapBuffers(); | 309 m_layerTreeHostImpl->swapBuffers(); |
304 didSwapFrame(); | 310 didSwapFrame(); |
305 } | 311 } |
306 } | 312 } |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 | 389 |
384 void SingleThreadProxy::didSwapFrame() | 390 void SingleThreadProxy::didSwapFrame() |
385 { | 391 { |
386 if (m_nextFrameIsNewlyCommittedFrame) { | 392 if (m_nextFrameIsNewlyCommittedFrame) { |
387 m_nextFrameIsNewlyCommittedFrame = false; | 393 m_nextFrameIsNewlyCommittedFrame = false; |
388 m_layerTreeHost->didCommitAndDrawFrame(); | 394 m_layerTreeHost->didCommitAndDrawFrame(); |
389 } | 395 } |
390 } | 396 } |
391 | 397 |
392 } | 398 } |
OLD | NEW |