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/thread_proxy.h" | 7 #include "cc/thread_proxy.h" |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "cc/delay_based_time_source.h" | 10 #include "cc/delay_based_time_source.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 // The texture upload queue may reference textures that were just purged, cl
ear | 364 // The texture upload queue may reference textures that were just purged, cl
ear |
365 // them from the queue. | 365 // them from the queue. |
366 if (m_currentResourceUpdateControllerOnImplThread.get()) | 366 if (m_currentResourceUpdateControllerOnImplThread.get()) |
367 m_currentResourceUpdateControllerOnImplThread->discardUploadsToEvictedRe
sources(); | 367 m_currentResourceUpdateControllerOnImplThread->discardUploadsToEvictedRe
sources(); |
368 return true; | 368 return true; |
369 } | 369 } |
370 | 370 |
371 void ThreadProxy::sendManagedMemoryStats() | 371 void ThreadProxy::sendManagedMemoryStats() |
372 { | 372 { |
373 DCHECK(isImplThread()); | 373 DCHECK(isImplThread()); |
374 if (m_layerTreeHostImpl.get() && m_layerTreeHostImpl->renderer()) | 374 if (!m_layerTreeHostImpl.get()) |
375 m_layerTreeHostImpl->renderer()->sendManagedMemoryStats( | 375 return; |
376 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), | 376 if (!m_layerTreeHostImpl->renderer()) |
377 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyByt
es(), | 377 return; |
378 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); | 378 if (!m_layerTreeHost->contentsTextureManager()) |
| 379 return; |
| 380 |
| 381 m_layerTreeHostImpl->renderer()->sendManagedMemoryStats( |
| 382 m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), |
| 383 m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes()
, |
| 384 m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); |
379 } | 385 } |
380 | 386 |
381 void ThreadProxy::setNeedsRedraw() | 387 void ThreadProxy::setNeedsRedraw() |
382 { | 388 { |
383 DCHECK(isMainThread()); | 389 DCHECK(isMainThread()); |
384 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedraw"); | 390 TRACE_EVENT0("cc", "ThreadProxy::setNeedsRedraw"); |
385 Proxy::implThread()->postTask(createThreadTask(this, &ThreadProxy::setFullRo
otLayerDamageOnImplThread)); | 391 Proxy::implThread()->postTask(createThreadTask(this, &ThreadProxy::setFullRo
otLayerDamageOnImplThread)); |
386 Proxy::implThread()->postTask(createThreadTask(this, &ThreadProxy::setNeedsR
edrawOnImplThread)); | 392 Proxy::implThread()->postTask(createThreadTask(this, &ThreadProxy::setNeedsR
edrawOnImplThread)); |
387 } | 393 } |
388 | 394 |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
973 ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() | 979 ThreadProxy::BeginFrameAndCommitState::BeginFrameAndCommitState() |
974 : monotonicFrameBeginTime(0) | 980 : monotonicFrameBeginTime(0) |
975 { | 981 { |
976 } | 982 } |
977 | 983 |
978 ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() | 984 ThreadProxy::BeginFrameAndCommitState::~BeginFrameAndCommitState() |
979 { | 985 { |
980 } | 986 } |
981 | 987 |
982 } // namespace cc | 988 } // namespace cc |
OLD | NEW |