Move memory allocation/stats structs to gpu:: and remove bazillion copies
This moves the memory allocation / stats structs from content to gpu:: and
eliminates many redundant copies of this information in different parts of the
stack. This also moves the stats sending and allocation callbacks to
gpu::ContextSupport / gpu::GpuControl to get rid of the bounce through
WebKit::WebGraphicsContext3D.
The new flow for cc to register for memory allocation changes and pass stats to
the manager is this:
cc:: registers for MemoryAllocationChanged callbacks and sends stats via the
gpu::ContextSupport interface. Memory allocations are represented by a
gpu::MemoryAllocation struct and memory statistics are sent in a
gpu::ManagedMemoryStats struct.
The implementation of gpu::ContextSupport (gpu::gles2::GLES2Implementation)
forwards the calls to gpu::GpuControl. content::CommandBufferProxyImpl's
implementation of these maps the calls to content IPCs that drive the memory
manager implementation.
This patch gets rid of the following things:
*) WebKit::WebGraphicsMemory(Allocation|Stats) go away. These were used only
because cc was not able to depend on the previous locations of the
allocation/stats structs in content::. Now that these structs are in gpu::, the
compositor (which is the only thing using these) can see them directly
*) WebGraphicsContext3D::sendManagedMemoryStatsCHROMIUM /
setMemoryAllocationChangedCallbackCHROMIUM go away.
*) cc:ManagedMemoryPolicy's cutoff fields are now
gpu::MemoryAllocation::PriorityCutoff enums instead of an (inconsistently named)
copy.
*) GpuMemoryAllocationForBrowser goes away and is managed directly in content.
gpu::GpuMemoryAllocationForRenderer is renamed to just gpu::MemoryAllocation
*) Many proxies and converters go away.
cc::ManagedMemoryPolicy sticks around in this patch, even though it's largely
the same as gpu::MemoryAllocation, since it's sometimes used by code that
doesn't go through the gpu memory allocation path - such as android_webview -
and it has some additional state (num_resource_limit) that's not applicable to a
general gpu::MemoryAllocation. Chris tells me this struct is due for
simplification as well, so maybe it'll make sense to fold it in in a future
patch.
Diffstat:
53 files changed, 345 insertions(+), 713 deletions(-)
BUG=181120
R=piman,ccameron
Review URL: https://codereview.chromium.org/45243002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@231527 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/ppapi/proxy/ppapi_command_buffer_proxy.cc b/ppapi/proxy/ppapi_command_buffer_proxy.cc
index 9ea9d69..063cafb 100644
--- a/ppapi/proxy/ppapi_command_buffer_proxy.cc
+++ b/ppapi/proxy/ppapi_command_buffer_proxy.cc
@@ -213,6 +213,11 @@
NOTREACHED();
}
+void PpapiCommandBufferProxy::SendManagedMemoryStats(
+ const gpu::ManagedMemoryStats& stats) {
+ NOTREACHED();
+}
+
bool PpapiCommandBufferProxy::SupportsGpuMemoryBuffer() {
return false;
}