diff options
author | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 20:03:08 +0000 |
---|---|---|
committer | ccameron@chromium.org <ccameron@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-25 20:03:08 +0000 |
commit | 3d21e02ecb88cb2a86045a1678ca99edee62622d (patch) | |
tree | 0d325b828c9112abc3dfa3e757d50defd67e6154 /cc/single_thread_proxy.cc | |
parent | 189230a0b89f399b0fdf3147855d48138523bd71 (diff) | |
download | chromium_src-3d21e02ecb88cb2a86045a1678ca99edee62622d.zip chromium_src-3d21e02ecb88cb2a86045a1678ca99edee62622d.tar.gz chromium_src-3d21e02ecb88cb2a86045a1678ca99edee62622d.tar.bz2 |
Report memory usage statistics from the renderer.
Add functions to PrioritizedTextureManager to report the amount of visible and nearly-visible memory, based on the requested set of textures to draw (note that this is a superset of the backings that will be visible and nearly-visible). Add a unittest for this functionality.
Add infrastructure in the Proxy to send this data to the renderer. From here the data will go to the WebGraphicsContext3D, then the GPU command buffer, and finally the GPU memory manager.
BUG=134750
Review URL: https://chromiumcodereview.appspot.com/11230064
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164154 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/single_thread_proxy.cc')
-rw-r--r-- | cc/single_thread_proxy.cc | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/cc/single_thread_proxy.cc b/cc/single_thread_proxy.cc index 9667e75..d9918fa 100644 --- a/cc/single_thread_proxy.cc +++ b/cc/single_thread_proxy.cc @@ -286,6 +286,16 @@ bool SingleThreadProxy::reduceContentsTextureMemoryOnImplThread(size_t limitByte return m_layerTreeHost->contentsTextureManager()->reduceMemoryOnImplThread(limitBytes, priorityCutoff, m_layerTreeHostImpl->resourceProvider()); } +void SingleThreadProxy::sendManagedMemoryStats() +{ + DCHECK(Proxy::isImplThread()); + if (m_layerTreeHostImpl.get() && m_layerTreeHostImpl->renderer()) + m_layerTreeHostImpl->renderer()->sendManagedMemoryStats( + m_layerTreeHost->contentsTextureManager()->memoryVisibleBytes(), + m_layerTreeHost->contentsTextureManager()->memoryVisibleAndNearbyBytes(), + m_layerTreeHost->contentsTextureManager()->memoryUseBytes()); +} + // Called by the legacy scheduling path (e.g. where render_widget does the scheduling) void SingleThreadProxy::compositeImmediately() { |