| 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/thread_proxy.h" | 5 #include "cc/thread_proxy.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "cc/delay_based_time_source.h" | 9 #include "cc/delay_based_time_source.h" |
| 10 #include "cc/draw_quad.h" | 10 #include "cc/draw_quad.h" |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 390 } | 390 } |
| 391 | 391 |
| 392 void ThreadProxy::sendManagedMemoryStats() | 392 void ThreadProxy::sendManagedMemoryStats() |
| 393 { | 393 { |
| 394 DCHECK(isImplThread()); | 394 DCHECK(isImplThread()); |
| 395 if (!m_layerTreeHostImpl.get()) | 395 if (!m_layerTreeHostImpl.get()) |
| 396 return; | 396 return; |
| 397 if (!m_layerTreeHost->contentsTextureManager()) | 397 if (!m_layerTreeHost->contentsTextureManager()) |
| 398 return; | 398 return; |
| 399 | 399 |
| 400 // If we are using impl-side painting, then sendManagedMemoryStats is called |
| 401 // directly after the tile manager's manage function, and doesn't need to |
| 402 // interact with main thread's layer tree. |
| 403 if (m_layerTreeHost->settings().implSidePainting) |
| 404 return; |
| 405 |
| 400 m_layerTreeHostImpl->sendManagedMemoryStats( | 406 m_layerTreeHostImpl->sendManagedMemoryStats( |
| 401 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), | 407 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), |
| 402 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes()
, | 408 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes()
, |
| 403 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); | 409 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); |
| 404 } | 410 } |
| 405 | 411 |
| 406 void ThreadProxy::setNeedsRedraw() | 412 void ThreadProxy::setNeedsRedraw() |
| 407 { | 413 { |
| 408 DCHECK(isMainThread()); | 414 DCHECK(isMainThread()); |
| 409 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedraw"); | 415 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedraw"); |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1006 } | 1012 } |
| 1007 | 1013 |
| 1008 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ
est) | 1014 void ThreadProxy::commitPendingOnImplThreadForTesting(CommitPendingRequest* requ
est) |
| 1009 { | 1015 { |
| 1010 DCHECK(isImplThread()); | 1016 DCHECK(isImplThread()); |
| 1011 request->commitPending = m_schedulerOnImplThread->commitPending(); | 1017 request->commitPending = m_schedulerOnImplThread->commitPending(); |
| 1012 request->completion.signal(); | 1018 request->completion.signal(); |
| 1013 } | 1019 } |
| 1014 | 1020 |
| 1015 } // namespace cc | 1021 } // namespace cc |
| OLD | NEW |