summaryrefslogtreecommitdiffstats
path: root/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
diff options
context:
space:
mode:
authorjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 04:56:29 +0000
committerjamesr@chromium.org <jamesr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-29 04:56:29 +0000
commitf44d555f9942ccbb0c88e911a40aeb507ba48872 (patch)
tree81da447c3ec53b05f4a9c8facc87b07c98e66473 /cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
parent33aeb08e822ea55a18eb12fdd2364f2fd8af0df6 (diff)
downloadchromium_src-f44d555f9942ccbb0c88e911a40aeb507ba48872.zip
chromium_src-f44d555f9942ccbb0c88e911a40aeb507ba48872.tar.gz
chromium_src-f44d555f9942ccbb0c88e911a40aeb507ba48872.tar.bz2
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
Diffstat (limited to 'cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc')
-rw-r--r--cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
index a1990b0..c432a5e 100644
--- a/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
+++ b/cc/trees/layer_tree_host_pixeltest_on_demand_raster.cc
@@ -29,8 +29,8 @@ class LayerTreeHostOnDemandRasterPixelTest : public LayerTreePixelTest {
virtual void BeginCommitOnThread(LayerTreeHostImpl* impl) OVERRIDE {
// Not enough memory available. Enforce on-demand rasterization.
impl->SetMemoryPolicy(
- ManagedMemoryPolicy(1, ManagedMemoryPolicy::CUTOFF_ALLOW_EVERYTHING,
- 1, ManagedMemoryPolicy::CUTOFF_ALLOW_NOTHING,
+ ManagedMemoryPolicy(1, gpu::MemoryAllocation::CUTOFF_ALLOW_EVERYTHING,
+ 1, gpu::MemoryAllocation::CUTOFF_ALLOW_NOTHING,
1000));
impl->SetDiscardBackBufferWhenNotVisible(true);
}